code: def _prepare(f, xs_dtypes, xs_shapes):
      """Return a function that executes 'f'.
  
        In TF 2.x, this is the same as `f`.
        In TF 1.x, returns a Python function that executes the graph defined by `f`
        in a Session.
  
      Args:
        f: the function.
        xs_dtypes: dtypes of f's arguments.
        xs_shapes: shapes of f's arguments.
  
      Returns:
      """
      if context.executing_eagerly():
  
          def decorated_eager(*xs_data):
              return f(*map(ops.convert_to_tensor, xs_data))
  
          return decorated_eager
      xs = [
          array_ops.placeholder(x_dtype, shape=x_shape)
          for x_dtype, x_shape in zip(xs_dtypes, xs_shapes)
      ]
      y = f(*xs)
      sess = ops.get_default_session()
  
      def decorated_graph(*xs_data):
          xs_data = [_to_numpy(a) for a in xs_data]
          return sess.run(y, feed_dict=dict(zip(xs, xs_data)))
  
      return decorated_graph
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: _prepare(f, xs_dtypes, xs_shapes) and returns: decorated_graph, decorated_eager, sess, f