code: def get_graph(input_graphs, index):
      """Indexes into a graph.
  
      Given a `graphs.GraphsTuple` containing arrays and an index (either
      an `int` or a `slice`), index into the nodes, edges and globals to extract the
      graphs specified by the slice, and returns them into an another instance of a
      `graphs.GraphsTuple` containing `Tensor`s.
  
      Args:
        input_graphs: A `graphs.GraphsTuple` containing numpy arrays.
        index: An `int` or a `slice`, to index into `graph`. `index` should be
          compatible with the number of graphs in `graphs`.
  
      Returns:
        A `graphs.GraphsTuple` containing numpy arrays, made of the extracted
          graph(s).
  
      Raises:
        TypeError: if `index` is not an `int` or a `slice`.
      """
      if isinstance(index, int):
          graph_slice = slice(index, index + 1)
      elif isinstance(index, slice):
          graph_slice = index
      else:
          raise TypeError("unsupported type: %s" % type(index))
      data_dicts = graphs_tuple_to_data_dicts(input_graphs)[graph_slice]
      return graphs.GraphsTuple(**_concatenate_data_dicts(data_dicts))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from graph_nets import graphs
  import networkx
  import numpy
  from six.moves import range
  from six.moves import zip
label_desc: Use image node_id 16 for calling a global function with example usage: get_graph(input_graphs, index) and returns: graphs