code: def make_runnable_in_session(
      graph, name="make_graph_runnable_in_session"
  ):
      """Allows a graph containing `None` fields to be run in a `tf.Session`.
  
      The `None` values of `graph` are replaced by `tf.no_op()`. This function is
      meant to be called just before a call to `sess.run` on a Tensorflow session
      `sess`, as `None` values currently cannot be run through a session.
  
      Args:
        graph: A `graphs.GraphsTuple` containing `Tensor`s or `None` values.
        name: (string, optional) A name for the operation.
  
      Returns:
        A `graphs.GraphsTuple` `graph_output` such that, for any field `x` in NODES,
        EDGES, GLOBALS, RECEIVERS, SENDERS, N_NODE, N_EDGE, and a Tensorflow session
        `sess`, if `graph.x` was `None`, `sess.run(graph_output)` is `None`, and
        otherwise
      """
      none_fields = [k for k in ALL_FIELDS if getattr(graph, k) is None]
      with tf.name_scope(name):
          return graph.map(lambda _: tf.no_op(), none_fields)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  from absl import logging
  from graph_nets import graphs
  from graph_nets import utils_np
  import six
  from six.moves import range
  import tensorflow
  import tree
label_desc: Use image node_id 12 for calling a global function with example usage: make_runnable_in_session(graph, name) and returns: graph