code: def prefer_static_value(x):
      """Return static value of tensor `x` if available, else `x`.
  
      Args:
        x: `Tensor` (already converted).
  
      Returns:
        Numpy array (if static value is obtainable), else `Tensor`.
      """
      static_x = tf.get_static_value(x)
      if static_x is not None:
          return static_x
      return x
  
imports: import functools
  import hashlib
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 35 for calling a global function with example usage: prefer_static_value(x) and returns: x, static_x