code: def _listify_validator(scalar_validator, allow_stringlist=False):
      def f(s):
          if isinstance(s, six.string_types):
              try:
                  return [
                      scalar_validator(v.strip())
                      for v in s.split(",")
                      if v.strip()
                  ]
              except Exception:
                  if allow_stringlist:
                      # Sometimes, a list of colors might be a single string
                      # of single-letter colornames. So give that a shot.
                      return [
                          scalar_validator(v.strip())
                          for v in s
                          if v.strip()
                      ]
                  else:
                      raise
          # We should allow any generic sequence type, including generators,
          # Numpy ndarrays, and pandas data structures.  However, unordered
          # sequences, such as sets, should be allowed but discouraged unless the
          # user desires pseudorandom behavior.
          elif isinstance(s, Iterable) and not isinstance(s, Mapping):
              # The condition on this list comprehension will preserve the
              # behavior of filtering out any empty strings (behavior was
              # from the original validate_stringlist()), while allowing
              # any non-string/text scalar values such as numbers and arrays.
              return [
                  scalar_validator(v)
                  for v in s
                  if not isinstance(v, six.string_types) or v
              ]
          else:
              raise ValueError(
                  "{!r} must be of type: string or non-dictionary "
                  "iterable".format(s)
              )
  
      try:
          f.__name__ = "{}list".format(scalar_validator.__name__)
      except AttributeError:  # class instance.
          f.__name__ = "{}List".format(type(scalar_validator).__name__)
      f.__doc__ = scalar_validator.__doc__
      return f
  
imports: from __future__ import absolute_import, division, print_function
  import six
  from functools import reduce
  import operator
  import os
  import warnings
  import re
  from matplotlib import cbook, testing
  from matplotlib.cbook import mplDeprecation, deprecated, ls_mapper
  from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  from matplotlib.colors import is_color_like
  from cycler import Cycler, cycler
label_desc: Use image node_id 1 for calling a global function with example usage: _listify_validator(scalar_validator, allow_stringlist) and returns: f, unknown, unknown, unknown