class_docstr: A dictionary of :class:`Space` instances.
  
  Elements of this space are (ordered) dictionaries of elements from the constituent spaces.
  
  Example usage:
  
      >>> from gym.spaces import Dict, Discrete
      >>> observation_space = Dict({"position": Discrete(2), "velocity": Discrete(3)})
      >>> observation_space.sample()
      OrderedDict([('position', 1), ('velocity', 2)])
  
  Example usage [nested]::
  
      >>> from gym.spaces import Box, Dict, Discrete, MultiBinary, MultiDiscrete
      >>> Dict(
      ...     {
      ...         "ext_controller": MultiDiscrete([5, 2, 2]),
      ...         "inner_state": Dict(
      ...             {
      ...                 "charge": Discrete(100),
      ...                 "system_checks": MultiBinary(10),
      ...                 "job_status": Dict(
      ...                     {
      ...                         "task": Discrete(5),
      ...                         "progress": Box(low=0, high=100, shape=()),
      ...                     }
      ...                 ),
      ...             }
      ...         ),
      ...     }
      ... )
  
  It can be convenient to use :class:`Dict` spaces if you want to make complex observations or actions more human-readable.
  Usually, it will not be possible to use elements of this space directly in learning code. However, you can easily
  convert `Dict` observations to flat arrays by using a :class:`gym.wrappers.FlattenObservation` wrapper. Similar wrappers can be
  implemented to deal with :class:`Dict` actions.
docstr: Convert a batch of samples from this space to a JSONable data type.
docstr_tok: ["Convert","a","batch","of","samples","from","this","space","to","a","JSONable","data","type","."]
code: def to_jsonable(self, sample_n: list) -> dict:
      """Convert a batch of samples from this space to a JSONable data type."""
      # serialize as dict-repr of vectors
      return {
          key: space.to_jsonable([sample[key] for sample in sample_n])
          for key, space in self.spaces.items()
      }
  
imports: from collections import OrderedDict
  from collections.abc import Mapping, Sequence
  from typing import Any
  from typing import Dict
  from typing import List, Optional
  from typing import Sequence
  from typing import Tuple, Union
  import numpy
  from gym.spaces.space import Space
label_desc: Use image node_id 12 for calling the Dict obj's underlying member method code with example usage: obj.to_jsonable(sample_n) and returns: unknown