class_docstr: Gym Dictionary with arbitrary keys updatable after instantiation
  
  Example:
     space = FlexDict({})
     space['key'] = spaces.Box(4,)
  See also: documentation for gym.spaces.Dict
code: def __init__(self, spaces=None, **spaces_kwargs):
      err = "Use either Dict(spaces=dict(...)) or Dict(foo=x, bar=z)"
      assert (spaces is None) or (not spaces_kwargs), err
  
      if spaces is None:
          spaces = spaces_kwargs
  
      for space in spaces.values():
          self.assertSpace(space)
  
      super().__init__(spaces=spaces)
  
file_path: ray/rllib/utils/spaces/flexdict.py
imports: import gymnasium
  from ray.rllib.utils.annotations import PublicAPI
label_desc: Use image node_id 1 to create a new FlexDict object from inherited base classes: gym.spaces with example: obj = FlexDict(spaces)