code: def _to_list(value, name=None, list_length=None):
      """Converts hparam value into a list.
  
      If :attr:`list_length` is given,
      then the canonicalized :attr:`value` must be of
      length :attr:`list_length`.
      """
      if not isinstance(value, (list, tuple)):
          if list_length is not None:
              value = [value] * list_length
          else:
              value = [value]
      if list_length is not None and len(value) != list_length:
          name = "" if name is None else name
          raise ValueError(
              "hparams '%s' must be a list of length %d"
              % (name, list_length)
          )
      return value
  
file_path: texar/texar/tf/modules/networks/conv_networks.py
imports: import tensorflow
  from texar.tf.modules.networks.network_base import FeedForwardNetworkBase
  from texar.tf.modules.networks.network_base import _build_layers
  from texar.tf.core.layers import get_pooling_layer_hparams, get_activation_fn
  from texar.tf.utils.utils import uniquify_str
  from texar.tf.utils.shapes import mask_sequences
  from texar.tf.hyperparams import HParams
label_desc: Use image node_id 1 for calling a global function with example usage: _to_list(value, name, list_length) and returns: value