MCPcopy Index your code
hub / github.com/python/cpython / get_host_info

Method get_host_info

Lib/xmlrpc/client.py:1197–1215  ·  view source on GitHub ↗
(self, host)

Source from the content-addressed store, hash-verified

1195 # x509 info). The header and x509 fields may be None.
1196
1197 def get_host_info(self, host):
1198
1199 x509 = {}
1200 if isinstance(host, tuple):
1201 host, x509 = host
1202
1203 auth, host = urllib.parse._splituser(host)
1204
1205 if auth:
1206 auth = urllib.parse.unquote_to_bytes(auth)
1207 auth = base64.encodebytes(auth).decode("utf-8")
1208 auth = "".join(auth.split()) # get rid of whitespace
1209 extra_headers = [
1210 ("Authorization", "Basic " + auth)
1211 ]
1212 else:
1213 extra_headers = []
1214
1215 return host, extra_headers, x509
1216
1217 ##
1218 # Connect to server.

Callers 3

test_get_host_infoMethod · 0.95
make_connectionMethod · 0.95
make_connectionMethod · 0.80

Calls 3

decodeMethod · 0.45
joinMethod · 0.45
splitMethod · 0.45

Tested by 1

test_get_host_infoMethod · 0.76