parameters: (game,
                     depth_limit=-1,
                     include_terminals=True,
                     include_chance_states=False,
                     include_mean_field_states=False,
                     to_string=lambda s: s.history_str(),
                     stop_if_encountered=True)
return_statement: return all_states
docstring: Gets all states in the game, indexed by their string representation.
  
    For small games only! Useful for methods that solve the  games explicitly,
    i.e. value iteration. Use this default implementation with caution as it does
    a recursive tree walk of the game and could easily fill up memory for larger
    games or games with long horizons.
  
    Currently only works for sequential games.
  
    Arguments:
      game: The game to analyze, as returned by `load_game`.
      depth_limit: How deeply to analyze the game tree. Negative means no limit, 0
        means root-only, etc.
      include_terminals: If True, include terminal states.
      include_chance_states: If True, include chance node states.
      include_mean_field_states: If True, include mean field node states.
      to_string: The serialization function. We expect this to be
        `lambda s: s.history_str()` as this enforces perfect recall, but for
          historical reasons, using `str` is also supported, but the goal is to
          remove this argument.
      stop_if_encountered: if this is set, do not keep recursively adding states
        if this state is already in the list. This allows support for games that
        have cycles.
  
    Returns:
      A `dict` with `to_string(state)` keys and `pyspiel.State` values containing
      all states encountered traversing the game tree up to the specified depth.
docstring_summary: Gets all states in the game, indexed by their string representation.
docstring_tokens: Gets all states in the game indexed by their string representation .
function: def get_all_states(game,
                     depth_limit=-1,
                     include_terminals=True,
                     include_chance_states=False,
                     include_mean_field_states=False,
                     to_string=lambda s: s.history_str(),
                     stop_if_encountered=True):
    """Gets all states in the game, indexed by their string representation.
  
    For small games only! Useful for methods that solve the  games explicitly,
    i.e. value iteration. Use this default implementation with caution as it does
    a recursive tree walk of the game and could easily fill up memory for larger
    games or games with long horizons.
  
    Currently only works for sequential games.
  
    Arguments:
      game: The game to analyze, as returned by `load_game`.
      depth_limit: How deeply to analyze the game tree. Negative means no limit, 0
        means root-only, etc.
      include_terminals: If True, include terminal states.
      include_chance_states: If True, include chance node states.
      include_mean_field_states: If True, include mean field node states.
      to_string: The serialization function. We expect this to be
        `lambda s: s.history_str()` as this enforces perfect recall, but for
          historical reasons, using `str` is also supported, but the goal is to
          remove this argument.
      stop_if_encountered: if this is set, do not keep recursively adding states
        if this state is already in the list. This allows support for games that
        have cycles.
  
    Returns:
      A `dict` with `to_string(state)` keys and `pyspiel.State` values containing
      all states encountered traversing the game tree up to the specified depth.
    """
    root_states = game.new_initial_states()
    all_states = dict()
  
    for root in root_states:
      # Then, do a recursive tree walk to fill up the map.
      _get_subgames_states(
          state=root,
          all_states=all_states,
          depth_limit=depth_limit,
          depth=0,
          include_terminals=include_terminals,
          include_chance_states=include_chance_states,
          include_mean_field_states=include_mean_field_states,
          to_string=to_string,
          stop_if_encountered=stop_if_encountered)
  
    if not all_states:
      raise ValueError("GetSubgameStates returned 0 states!")
  
    return all_states
function_tokens: def get_all_states ( game , depth_limit = - 1 , include_terminals = True , include_chance_states = False , include_mean_field_states = False , to_string = lambda s : s . history_str ( ) , stop_if_encountered = True ) : root_states = game . new_initial_states ( ) all_states = dict ( ) for root in root_states : # Then, do a recursive tree walk to fill up the map. _get_subgames_states ( state = root , all_states = all_states , depth_limit = depth_limit , depth = 0 , include_terminals = include_terminals , include_chance_states = include_chance_states , include_mean_field_states = include_mean_field_states , to_string = to_string , stop_if_encountered = stop_if_encountered ) if not all_states : raise ValueError ( "GetSubgameStates returned 0 states!" ) return all_states