def transport_from_url(url):
if '<STR_LIT:/>' not in url and '<STR_LIT::>' in url and url.rsplit('<STR_LIT::>')[-<NUM_LIT:1>].isdigit():<EOL><INDENT>url = '<STR_LIT>' + url<EOL><DEDENT>url = urlparse.urlsplit(url, scheme="<STR_LIT>", allow_fragments=False)  <EOL>try:<EOL><INDENT>transport = TRANSPORTS[url.scheme.lower()]<EOL><DEDENT>except KeyError:<EOL><INDENT>if not any((url.netloc, url.query)) and url.path.isdigit():<EOL><INDENT>return transport_from_url("<STR_LIT>" % (url.scheme, url.path))<EOL><DEDENT>else:<EOL><INDENT>raise URLError("<STR_LIT>" % url.geturl())<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return transport(url)<EOL><DEDENT>
Create a transport for the given URL.