code: def prepare_tuple_argument(arg, n, arg_name, validate_args=False):
      """Helper which processes `Tensor`s to tuples in standard form."""
      # Short-circuiting incoming lists and tuples here avoids both
      # Tensor packing / unpacking and numpy 1.20.+ pickiness about
      # np.array(tuple of Tensor).
      if isinstance(arg, (tuple, list)):
          if len(arg) == n:
              return tuple(arg)
          if len(arg) == 1:
              return (arg[0],) * n
  
      arg_size = ps.size(arg)
      arg_size_ = tf.get_static_value(arg_size)
      assertions = []
      if arg_size_ is not None:
          if arg_size_ not in (1, n):
              raise ValueError(
                  "The size of `{}` must be equal to `1` or to the rank "
                  "of the convolution (={}). Saw size = {}".format(
                      arg_name, n, arg_size_
                  )
              )
      elif validate_args:
          assertions.append(
              assert_util.assert_equal(
                  ps.logical_or(arg_size == 1, arg_size == n),
                  True,
                  message=(
                      "The size of `{}` must be equal to `1` or to the rank of the "
                      "convolution (={})".format(arg_name, n)
                  ),
              )
          )
  
      with tf.control_dependencies(assertions):
          arg = ps.broadcast_to(arg, shape=[n])
          arg = ps.unstack(arg, num=n)
          return arg
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.nn.util import utils
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 15 for calling a global function with example usage: prepare_tuple_argument(arg, n, arg_name, validate_args) and returns: arg, tuple, unknown