Convert the given input to a list.
    
    Intelligently handles list and non-string values, returning
    as-is and passing to the list builtin respectively.
    
    The default optional keyword arguments allow for lists in the form::
    
        "foo,bar, baz   , diz" -> ['foo', 'bar', 'baz', 'diz']
    
    For a far more advanced method of converting a string to a list of
    values see :class:`KeywordProcessor`.
    
    :param input: the value to convert to a list
    :type input: any
    
    :param separator: The character (or string) to use to split the
                      input.  May be None to split on any whitespace.
    :type separator: basestring or None
    
    :param strip: If True, the values found by splitting will be stripped
                  of extraneous whitespace.
    :type strip: bool
    
    :param empty: If True, allow empty list items.
    :type empty: bool
    
    :returns: converted values as a list
    :rtype: list

def array(input, separator=',', strip=True, empty=False):
    """Convert the given input to a list.
    
    Intelligently handles list and non-string values, returning
    as-is and passing to the list builtin respectively.
    
    The default optional keyword arguments allow for lists in the form::
    
        "foo,bar, baz   , diz" -> ['foo', 'bar', 'baz', 'diz']
    
    For a far more advanced method of converting a string to a list of
    values see :class:`KeywordProcessor`.
    
    :param input: the value to convert to a list
    :type input: any
    
    :param separator: The character (or string) to use to split the
                      input.  May be None to split on any whitespace.
    :type separator: basestring or None
    
    :param strip: If True, the values found by splitting will be stripped
                  of extraneous whitespace.
    :type strip: bool
    
    :param empty: If True, allow empty list items.
    :type empty: bool
    
    :returns: converted values as a list
    :rtype: list
    """
    
    if input is None:
        return []
    
    if isinstance(input, list):
        if not empty:
            return [i for i in input if i]
        
        return input
    
    if not isinstance(input, (binary, unicode)):
        if not empty:
            return [i for i in list(input) if i]
        
        return list(input)
    
    if not strip:
        if not empty:
            return [i for i in input.split(separator) if i]
        
        return input.split(separator)
    
    if not empty:
        return [i for i in [i.strip() for i in input.split(separator)] if i]
    
    return [i.strip() for i in input.split(separator)]