Connection
Base URL, credentials and a reachable server.
Keep a filled-board fixture alongside validation code and inspect the separate unit checks before connecting the Boolean result to an interface message.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def sudoku_complete(board):
if type(board) is not list or len(board) != 9:
raise ValueError("nine rows")
if any(type(row) is not list or len(row) != 9 or
any(type(v) is not int or not 1 <= v <= 9 for v in row) for row in board):
raise ValueError("nine integer digits per row")
target = set(range(1,10))
units = board + [list(col) for col in zip(*board)]
units += [[board[y+dy][x+dx] for dy in range(3) for dx in range(3)]
for y in (0,3,6) for x in (0,3,6)]
return all(set(unit) == target for unit in units)