MCPcopy Index your code
hub / github.com/RustPython/RustPython / urlparse

Function urlparse

Lib/urllib/parse.py:374–397  ·  view source on GitHub ↗

Parse a URL into 6 components: :// / ; ? # The result is a named 6-tuple with fields corresponding to the above. It is either a ParseResult or ParseResultBytes object, depending on the type of the url parameter. The username, password,

(url, scheme='', allow_fragments=True)

Source from the content-addressed store, hash-verified

372del _fix_result_transcoding
373
374def urlparse(url, scheme='', allow_fragments=True):
375 """Parse a URL into 6 components:
376 <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
377
378 The result is a named 6-tuple with fields corresponding to the
379 above. It is either a ParseResult or ParseResultBytes object,
380 depending on the type of the url parameter.
381
382 The username, password, hostname, and port sub-components of netloc
383 can also be accessed as attributes of the returned object.
384
385 The scheme argument provides the default value of the scheme
386 component when no scheme is found in url.
387
388 If allow_fragments is False, no attempt is made to separate the
389 fragment component from the previous component, which can be either
390 path or query.
391
392 Note that % escapes are not expanded.
393 """
394 url, scheme, _coerce_result = _coerce_args(url, scheme)
395 scheme, netloc, url, params, query, fragment = _urlparse(url, scheme, allow_fragments)
396 result = ParseResult(scheme or '', netloc or '', url, params or '', query or '', fragment or '')
397 return _coerce_result(result)
398
399def _urlparse(url, scheme=None, allow_fragments=True):
400 scheme, netloc, url, query, fragment = _urlsplit(url, scheme, allow_fragments)

Callers 6

handle_requestMethod · 0.90
request_hostFunction · 0.90
http_error_302Method · 0.90
http_error_401Method · 0.90
_load_packageFunction · 0.90
parse_requirementFunction · 0.85

Calls 3

_coerce_argsFunction · 0.85
_urlparseFunction · 0.85
ParseResultClass · 0.85

Tested by 1

handle_requestMethod · 0.72