

def split(text, delimiter=','):
    "\n    Split a comma-separated list of strings.\n\n    :param text: The text to split (a string).\n    :param delimiter: The delimiter to split on (a string).\n    :returns: A list of zero or more nonempty strings.\n\n    Here's the default behavior of Python's built in :func:`str.split()`\n    function:\n\n    >>> 'foo,bar, baz,'.split(',')\n    ['foo', 'bar', ' baz', '']\n\n    In contrast here's the default behavior of the :func:`split()` function:\n\n    >>> from humanfriendly.text import split\n    >>> split('foo,bar, baz,')\n    ['foo', 'bar', 'baz']\n\n    Here is an example that parses a nested data structure (a mapping of\n    logging level names to one or more styles per level) that's encoded in a\n    string so it can be set as an environment variable:\n\n    >>> from pprint import pprint\n    >>> encoded_data = 'debug=green;warning=yellow;error=red;critical=red,bold'\n    >>> parsed_data = dict((k, split(v, ',')) for k, v in (split(kv, '=') for kv in split(encoded_data, ';')))\n    >>> pprint(parsed_data)\n    {'debug': ['green'],\n     'warning': ['yellow'],\n     'error': ['red'],\n     'critical': ['red', 'bold']}\n    "
    return [token.strip() for token in text.split(delimiter) if (token and (not token.isspace()))]

dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py split/original