def parse_redis_url(redis_url):
    '''
    >>> parse_redis_url('redis://:pass%20@localhost:1234/selecteddb%20')
    ('localhost', 1234, 'pass ', 'selecteddb ')
    >>> parse_redis_url('redis://:pass%20@localhost:1234/')
    ('localhost', 1234, 'pass ', None)
    >>> parse_redis_url('redis://localhost:1234/')
    ('localhost', 1234, None, None)
    >>> parse_redis_url('redis://localhost:1234')
    ('localhost', 1234, None, None)
    >>> parse_redis_url('redis://localhost/')
    ('localhost', 6379, None, None)
    >>> parse_redis_url('redis://')
    ('localhost', 6379, None, None)
    >>> parse_redis_url('redis://')
    ('localhost', 6379, None, None)
    '''
    (use, pas, hos, por, pat) = _parse_url(redis_url, 'redis://', def_port=6379)
    return (hos, por, pas, pat)
def parse_redis_url ( redis_url ) : ( use , pas , hos , por , pat ) = _parse_url ( redis_url , 'redis://' , def_port = 6379 ) return ( hos , por , pas , pat )
>>> parse_redis_url('redis://:pass%20@localhost:1234/selecteddb%20')
    ('localhost', 1234, 'pass ', 'selecteddb ')
    >>> parse_redis_url('redis://:pass%20@localhost:1234/')
    ('localhost', 1234, 'pass ', None)
    >>> parse_redis_url('redis://localhost:1234/')
    ('localhost', 1234, None, None)
    >>> parse_redis_url('redis://localhost:1234')
    ('localhost', 1234, None, None)
    >>> parse_redis_url('redis://localhost/')
    ('localhost', 6379, None, None)
    >>> parse_redis_url('redis://')
    ('localhost', 6379, None, None)
    >>> parse_redis_url('redis://')
    ('localhost', 6379, None, None)