class_docstr: A space representing graph information as a series of `nodes` connected with `edges` according to an adjacency matrix represented as a series of `edge_links`.
  
  Example usage::
  
      self.observation_space = spaces.Graph(node_space=space.Box(low=-100, high=100, shape=(3,)), edge_space=spaces.Discrete(3))
class_docstr_tok: ["A","space","representing","graph","information","as","a","series","of","`","nodes","`","connected","with","`","edges","`","according","to","an","adjacency","matrix","represented","as","a","series","of","`","edge_links","`",".","Example","usage",":",":","self.observation_space","=","spaces.Graph","(","node_space=space.Box","(","low=-100",",","high=100",",","shape=","(","3",",",")",")",",","edge_space=spaces.Discrete","(","3",")",")"]
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: NamedTuple) -> list:
      """Convert a batch of samples from this space to a JSONable data type."""
      # serialize as list of dicts
      ret_n = []
      for sample in sample_n:
          ret = {}
          ret["nodes"] = sample.nodes.tolist()
          if sample.edges is not None:
              ret["edges"] = sample.edges.tolist()
              ret["edge_links"] = sample.edge_links.tolist()
          ret_n.append(ret)
      return ret_n
  
file_path: gym/gym/spaces/graph.py
imports: from typing import NamedTuple, Optional, Sequence, Tuple, Union
  import numpy
  from gym.logger import warn
  from gym.spaces.box import Box
  from gym.spaces.discrete import Discrete
  from gym.spaces.multi_discrete import MultiDiscrete
  from gym.spaces.space import Space
label_desc: Use image node_id 8 for calling the Graph obj's underlying member method code with example usage: obj.to_jsonable(sample_n) and returns: ret_n