MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / clean_node

Function clean_node

pymongo/common.py:165–173  ·  view source on GitHub ↗

Split and normalize a node name from a hello response.

(node: str)

Source from the content-addressed store, hash-verified

163
164
165def clean_node(node: str) -> tuple[str, int]:
166 """Split and normalize a node name from a hello response."""
167 host, port = partition_node(node)
168
169 # Normalize hostname to lowercase, since DNS is case-insensitive:
170 # https://tools.ietf.org/html/rfc4343
171 # This prevents useless rediscovery if "foo.com" is in the seed list but
172 # "FOO.com" is in the hello response.
173 return host.lower(), port
174
175
176def raise_config_error(key: str, suggestions: Optional[list[str]] = None) -> NoReturn:

Callers 8

get_addressesFunction · 0.90
make_server_descriptionFunction · 0.90
_run_scenarioFunction · 0.90
run_scenarioFunction · 0.90
run_scenarioMethod · 0.90
_run_scenarioFunction · 0.90
run_scenarioFunction · 0.90
run_scenarioMethod · 0.90

Calls 1

partition_nodeFunction · 0.85

Tested by 8

get_addressesFunction · 0.72
make_server_descriptionFunction · 0.72
_run_scenarioFunction · 0.72
run_scenarioFunction · 0.72
run_scenarioMethod · 0.72
_run_scenarioFunction · 0.72
run_scenarioFunction · 0.72
run_scenarioMethod · 0.72