code: def set_list_param(params, name, value, min_len=None, max_len=None):
      
      if value is None:
          return
  
      if type(value) is dict:
          raise ValueError(
              "Parameter '%s' cannot be a dict." % name)
  
      try:
          value = list(value)
      except:
          raise ValueError(
              "Parameter '%s' must be a list (or a type that can be turned into"
              "a list) or None, got %r." % (name, value))
  
      if min_len is not None and len(value) < min_len:
          raise ValueError(
              "Parameter '%s' must not be shorter than %r, got %r." % (
                  name, min_len, value))
      if max_len is not None and len(value) > max_len:
          raise ValueError(
              "Parameter '%s' must not be longer than %r, got %r." % (
                  name, max_len, value))
  
      list_str = ''
      for item in value:
          list_str += '%s,' % item
      set_str_param(params, name, list_str)
docs: Set a list parameter if applicable.
  
      :param dict params: A dict containing API call parameters.
  
      :param str name: The name of the parameter to set.
  
      :param list value:
          The value of the parameter. If ``None``, the field will not be set. If
          an instance of ``set``, ``tuple``, or type that can be turned into
          a ``list``, the relevant field will be set. If ``dict``, will raise
          ``ValueError``. Any other value will raise a ``ValueError``.
  
      :param int min_len:
          If provided, values shorter than this will raise ``ValueError``.
  
      :param int max_len:
          If provided, values longer than this will raise ``ValueError``.