code: def from_board(cls: Type[GameT], board: chess.Board) -> GameT:
          
          # Setup the initial position.
          game = cls()
          game.setup(board.root())
          node = game  # type: GameNode
  
          # Replay all moves.
          for move in board.move_stack:
              node = node.add_variation(move)
  
          game.headers["Result"] = board.result()
          return game
docs: Creates a game from the move stack of a :class:`~chess.Board()`.