

def determine_transport(url, transports=default_transports):
    '\n    Given a URL determine the appropriate transport instance.\n    '
    url_components = urlparse.urlparse(url)
    scheme = url_components.scheme.lower()
    netloc = url_components.netloc
    if (not scheme):
        raise TransportError(("URL missing scheme '%s'." % url))
    if (not netloc):
        raise TransportError(("URL missing hostname '%s'." % url))
    for transport in transports:
        if (scheme in transport.schemes):
            return transport
    raise TransportError(("Unsupported URL scheme '%s'." % netloc))

dataset/ETHPy150Open core-api/python-client/coreapi/transports/__init__.py determine_transport/VarMisuse@108/176 `scheme`->`netloc`