code: def get_base_struct_from_space(space):
      """Returns a Tuple/Dict Space as native (equally structured) py tuple/dict.
  
      Args:
          space: The Space to get the python struct for.
  
      Returns:
          Union[dict,tuple,gym.Space]: The struct equivalent to the given Space.
              Note that the returned struct still contains all original
              "primitive" Spaces (e.g. Box, Discrete).
  
      .. testcode::
          :skipif: True
  
          get_base_struct_from_space(Dict({
              "a": Box(),
              "b": Tuple([Discrete(2), Discrete(3)])
          }))
  
      .. testoutput::
  
          dict(a=Box(), b=tuple(Discrete(2), Discrete(3)))
      """
  
      def _helper_struct(space_):
          if isinstance(space_, Tuple):
              return tuple(_helper_struct(s) for s in space_)
          elif isinstance(space_, Dict):
              return {
                  k: _helper_struct(space_[k]) for k in space_.spaces
              }
          else:
              return space_
  
      return _helper_struct(space)
  
file_path: ray/rllib/utils/spaces/space_utils.py
imports: import gymnasium
  from gymnasium.spaces import Tuple, Dict
  import numpy
  from ray.rllib.utils.annotations import DeveloperAPI
  import tree
  from typing import Any, List, Optional, Union
label_desc: Use image node_id 3 for calling a global function with example usage: get_base_struct_from_space(space) and returns: _helper_struct, tuple, unknown, space_