@classmethod
def from_url(cls, url, db=None, decode_components=False, **kwargs):
    "\n        Return a connection pool configured from the given URL.\n\n        For example::\n\n            redis://[:password]@localhost:6379/0\n            rediss://[:password]@localhost:6379/0\n            unix://[:password]@/path/to/socket.sock?db=0\n\n        Three URL schemes are supported:\n            redis:// creates a normal TCP socket connection\n            rediss:// creates a SSL wrapped TCP socket connection\n            unix:// creates a Unix Domain Socket connection\n\n        There are several ways to specify a database number. The parse function\n        will return the first specified option:\n            1. A ``db`` querystring option, e.g. redis://localhost?db=0\n            2. If using the redis:// scheme, the path argument of the url, e.g.\n               redis://localhost/0\n            3. The ``db`` argument to this function.\n\n        If none of these options are specified, db=0 is used.\n\n        The ``decode_components`` argument allows this function to work with\n        percent-encoded URLs. If this argument is set to ``True`` all ``%xx``\n        escapes will be replaced by their single-character equivalents after\n        the URL has been parsed. This only applies to the ``hostname``,\n        ``path``, and ``password`` components.\n\n        Any additional querystring arguments and keyword arguments will be\n        passed along to the ConnectionPool class's initializer. In the case\n        of conflicting arguments, querystring arguments always win.\n        "
    url_string = url
    url = urlparse(url)
    qs = ''
    if (('?' in url.path) and (not url.query)):
        qs = url.path.split('?', 1)[1]
        url = urlparse(url_string[:(- (len(qs) + 1))])
    else:
        qs = url.query
    url_options = {}
    for (name, value) in iteritems(parse_qs(qs)):
        if (value and (len(value) > 0)):
            url_options[name] = value[0]
    if decode_components:
        password = (unquote(url.password) if url.password else None)
        path = (unquote(url.path) if url.path else None)
        hostname = (unquote(url.hostname) if url.hostname else None)
    else:
        password = url.password
        path = url.path
        hostname = url.hostname
    if (url.scheme == 'unix'):
        url_options.update({'password': password, 'path': path, 'connection_class': UnixDomainSocketConnection})
    else:
        url_options.update({'host': hostname, 'port': int((url.port or 6379)), 'password': password})
        if (('db' not in url_options) and path):
            try:
                url_options['db'] = int(path.replace('/', ''))
            except (AttributeError, ValueError):
                pass
        if (url.scheme == 'rediss'):
            url_options['connection_class'] = SSLConnection
    url_options['db'] = int(url_options.get('db', (db or 0)))
    kwargs.update(url_options)
    if ('charset' in kwargs):
        warnings.warn(DeprecationWarning('"charset" is deprecated. Use "encoding" instead'))
        kwargs['encoding'] = kwargs.pop('charset')
    if ('errors' in kwargs):
        warnings.warn(DeprecationWarning('"errors" is deprecated. Use "encoding_errors" instead'))
        kwargs['encoding_errors'] = kwargs.pop('errors')
    return cls(**kwargs)
Return a connection pool configured from the given URL.

For example::

    redis://[:password]@localhost:6379/0
    rediss://[:password]@localhost:6379/0
    unix://[:password]@/path/to/socket.sock?db=0

Three URL schemes are supported:
    redis:// creates a normal TCP socket connection
    rediss:// creates a SSL wrapped TCP socket connection
    unix:// creates a Unix Domain Socket connection

There are several ways to specify a database number. The parse function
will return the first specified option:
    1. A ``db`` querystring option, e.g. redis://localhost?db=0
    2. If using the redis:// scheme, the path argument of the url, e.g.
       redis://localhost/0
    3. The ``db`` argument to this function.

If none of these options are specified, db=0 is used.

The ``decode_components`` argument allows this function to work with
percent-encoded URLs. If this argument is set to ``True`` all ``%xx``
escapes will be replaced by their single-character equivalents after
the URL has been parsed. This only applies to the ``hostname``,
``path``, and ``password`` components.

Any additional querystring arguments and keyword arguments will be
passed along to the ConnectionPool class's initializer. In the case
of conflicting arguments, querystring arguments always win.
@classmethod
def from_url(cls, url, db=None, decode_components=False, **kwargs):
    "\n        Return a connection pool configured from the given URL.\n\n        For example::\n\n            redis://[:password]@localhost:6379/0\n            rediss://[:password]@localhost:6379/0\n            unix://[:password]@/path/to/socket.sock?db=0\n\n        Three URL schemes are supported:\n            redis:// creates a normal TCP socket connection\n            rediss:// creates a SSL wrapped TCP socket connection\n            unix:// creates a Unix Domain Socket connection\n\n        There are several ways to specify a database number. The parse function\n        will return the first specified option:\n            1. A ``db`` querystring option, e.g. redis://localhost?db=0\n            2. If using the redis:// scheme, the path argument of the url, e.g.\n               redis://localhost/0\n            3. The ``db`` argument to this function.\n\n        If none of these options are specified, db=0 is used.\n\n        The ``decode_components`` argument allows this function to work with\n        percent-encoded URLs. If this argument is set to ``True`` all ``%xx``\n        escapes will be replaced by their single-character equivalents after\n        the URL has been parsed. This only applies to the ``hostname``,\n        ``path``, and ``password`` components.\n\n        Any additional querystring arguments and keyword arguments will be\n        passed along to the ConnectionPool class's initializer. In the case\n        of conflicting arguments, querystring arguments always win.\n        "
    url_string = url
    url = urlparse(url)
    qs = 
    if (('?' in url.path) and (not url.query)):
        qs = url.path.split('?', 1)[1]
        url = urlparse(url_string[:(- (len(qs) + 1))])
    else:
        qs = url.query
    url_options = {}
    for (name, value) in iteritems(parse_qs(qs)):
        if (value and (len(value) > 0)):
            url_options[name] = value[0]
    if decode_components:
        password = (unquote(url.password) if url.password else None)
        path = (unquote(url.path) if url.path else None)
        hostname = (unquote(url.hostname) if url.hostname else None)
    else:
        password = url.password
        path = url.path
        hostname = url.hostname
    if (url.scheme == 'unix'):
        url_options.update({'password': password, 'path': path, 'connection_class': UnixDomainSocketConnection})
    else:
        url_options.update({'host': hostname, 'port': int((url.port or 6379)), 'password': password})
        if (('db' not in url_options) and path):
            try:
                url_options['db'] = int(path.replace('/', ))
            except (AttributeError, ValueError):
                pass
        if (url.scheme == 'rediss'):
            url_options['connection_class'] = SSLConnection
    url_options['db'] = int(url_options.get('db', (db or 0)))
    kwargs.update(url_options)
    if ('charset' in kwargs):
        warnings.warn(DeprecationWarning('"charset" is deprecated. Use "encoding" instead'))
        kwargs['encoding'] = kwargs.pop('charset')
    if ('errors' in kwargs):
        warnings.warn(DeprecationWarning('"errors" is deprecated. Use "encoding_errors" instead'))
        kwargs['encoding_errors'] = kwargs.pop('errors')
    return cls(**kwargs)