code: def _get_sequence(value, n, channel_index, name):
      """Formats a value input for gen_nn_ops."""
      # Performance is fast-pathed for common cases:
      # `None`, `list`, `tuple` and `int`.
      if value is None:
          return [1] * (n + 2)
  
      # Always convert `value` to a `list`.
      if isinstance(value, list):
          pass
      elif isinstance(value, tuple):
          value = list(value)
      elif isinstance(value, int):
          value = [value]
      elif not isinstance(value, collections.abc.Sized):
          value = [value]
      else:
          value = list(value)  # Try casting to a list.
  
      len_value = len(value)
  
      # Fully specified, including batch and channel dims.
      if len_value == n + 2:
          return value
  
      # Apply value to spatial dims only.
      if len_value == 1:
          value = value * n  # Broadcast to spatial dimensions.
      elif len_value != n:
          raise ValueError(
              "{} should be of length 1, {} or {} but was {}".format(
                  name, n, n + 2, len_value
              )
          )
  
      # Add batch and channel dims (always 1).
      if channel_index == 1:
          return [1, 1] + value
      else:
          return [1] + value + [1]
  
file_path: probability/tensorflow_probability/python/internal/backend/numpy/nn.py
imports: import collections
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import numpy_array
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import l2_normalize
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import log_softmax
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import reduce_logsumexp
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import reduce_mean
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import softmax
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import softplus
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import squared_difference
  from tensorflow_probability.python.internal.backend.numpy.numpy_math import top_k
  from tensorflow_probability.python.internal.backend.numpy.ops import stop_gradient
label_desc: Use image node_id 1 for calling a global function with example usage: _get_sequence(value, n, channel_index, name) and returns: unknown, value, unknown, unknown