code: def _get_static_value(pred):
      """Helper function for getting static values from maybe-tensor objects."""
      if JAX_MODE:
          try:
              return np.asarray(pred)
          except:  # JAX sometimes raises raw Exception in __array__.  # pylint: disable=bare-except
              return None
      if tf.is_tensor(pred):
          pred_value = tf.get_static_value(tf.convert_to_tensor(pred))
  
          # Explicitly check for tf.Tensor, to avoid an AttributeError
          # when requesting `KerasTensor.graph`.
          if pred_value is None and isinstance(pred, tf.Tensor):
              pred_value = tensor_util.try_evaluate_constant(pred)
          return pred_value
      return pred
  
imports: import decorator
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal.backend import numpy
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.ops import control_flow_case
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 5 for calling a global function with example usage: _get_static_value(pred) and returns: pred, pred_value, np, None