code: def _value_and_gradient(fn, *args):
      """Calls `fn` and computes the gradient of the result wrt `arg`."""
      if tfe_context.executing_eagerly():
          v, g = tfe_backprop.val_and_grad_function(fn)(args)
      else:
          v = fn(*args)
          g = gradients_impl.gradients(v, args)
      return v, g
  
imports: import collections
  import importlib
  import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops.distributions import special_math
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 4 for calling a global function with example usage: _value_and_gradient(fn) and returns: v,  g