Did I find the right examples for you? yes no

All Samples(10)  |  Call(5)  |  Derive(0)  |  Import(5)
Parse a URL into 5 components:
<scheme>://<netloc>/<path>?<query>#<fragment>
Return a 5-tuple: (scheme, netloc, path, query, fragment).
Note that we don't break the components up in smaller bits
(e.g. netloc is a single string) and we don't expand % escapes.

        def urlsplit(url, scheme='', allow_fragments=True):
    """Parse a URL into 5 components:
    :///?#
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes."""
    allow_fragments = bool(allow_fragments)
    key = url, scheme, allow_fragments, type(url), type(scheme)
    cached = _parse_cache.get(key, None)
    if cached:
        return cached
    if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth
        clear_cache()
    netloc = query = fragment = ''
    i = url.find(':')
    if i > 0:
        if url[:i] == 'http': # optimize the common case
            scheme = url[:i].lower()
            url = url[i+1:]
            if url[:2] == '//':
                netloc, url = _splitnetloc(url, 2)
                if (('[' in netloc and ']' not in netloc) or
                        (']' in netloc and '[' not in netloc)):
                    raise ValueError("Invalid IPv6 URL")
            if allow_fragments and '#' in url:
                url, fragment = url.split('#', 1)
            if '?' in url:
                url, query = url.split('?', 1)
            v = SplitResult(scheme, netloc, url, query, fragment)
            _parse_cache[key] = v
            return v
        for c in url[:i]:
            if c not in scheme_chars:
                break
        else:
            # make sure "url" is not actually a port number (in which case
            # "scheme" is really part of the path)
            rest = url[i+1:]
            if not rest or any(c not in '0123456789' for c in rest):
                # not a port number
                scheme, url = url[:i].lower(), rest

    if url[:2] == '//':
        netloc, url = _splitnetloc(url, 2)
        if (('[' in netloc and ']' not in netloc) or
                (']' in netloc and '[' not in netloc)):
            raise ValueError("Invalid IPv6 URL")
    if allow_fragments and '#' in url:
        url, fragment = url.split('#', 1)
    if '?' in url:
        url, query = url.split('?', 1)
    v = SplitResult(scheme, netloc, url, query, fragment)
    _parse_cache[key] = v
    return v
        


src/s/h/shove-0.5.6/shove/stores/ftp.py   shove(Download)
 
from shove.store import BaseStore
from shove._compat import StringIO, urlsplit
 
__all__ = ['FTPStore']
    def __init__(self, engine, **kw):
        super(FTPStore, self).__init__(engine, **kw)
        user = kw.get('user', 'anonymous')
        password = kw.get('password', '')
        spliturl = urlsplit(engine)

src/s/h/shove-0.5.6/shove/stores/redisdb.py   shove(Download)
    raise ImportError('requires the redis library')
 
from shove._compat import urlsplit
 
from shove.store import BaseStore
    def __init__(self, engine, **kw):
        super(RedisStore, self).__init__(engine, **kw)
        spliturl = urlsplit(engine)
        self._db = spliturl.path.replace('/', '')
        self._hostname = spliturl.hostname

src/s/h/shove-0.5.6/shove/stores/mongodb.py   shove(Download)
    raise ImportError('requires pymongo library')
 
from shove._compat import urlsplit
from shove.store import SimpleStore
 
    def __init__(self, engine, **kw):
        super(MongoDBStore, self).__init__(engine, **kw)
        spliturl = urlsplit(engine)
        _, dbpath, self._colpath = spliturl.path.split('/')
        self._conn = Connection(host=spliturl.hostname, port=spliturl.port)

src/s/h/shove-0.5.6/shove/stores/cassandra.py   shove(Download)
    raise ImportError('requires pycassa library')
 
from shove._compat import urlsplit
from shove.store import SimpleStore
 
    def __init__(self, engine, **kw):
        super(CassandraStore, self).__init__(engine, **kw)
        spliturl = urlsplit(engine)
        _, keyspace, column_family = spliturl.path.split('/')
        try:

src/s/h/shove-0.5.6/shove/caches/redisdb.py   shove(Download)
 
from shove.base import Base
from shove._compat import urlsplit
 
__all__ = ['RedisCache']
    def __init__(self, engine, **kw):
        super(RedisCache, self).__init__(engine, **kw)
        spliturl = urlsplit(engine)
        host, port = spliturl[1].split(':')
        db = spliturl[2].replace('/', '')