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

Function _normalize_options

pymongo/uri_parser_shared.py:345–364  ·  view source on GitHub ↗

Normalizes option names in the options dictionary by converting them to their internally-used names. :param options: Instance of _CaseInsensitiveDictionary containing MongoDB URI options.

(options: _CaseInsensitiveDictionary)

Source from the content-addressed store, hash-verified

343
344
345def _normalize_options(options: _CaseInsensitiveDictionary) -> _CaseInsensitiveDictionary:
346 """Normalizes option names in the options dictionary by converting them to
347 their internally-used names.
348
349 :param options: Instance of _CaseInsensitiveDictionary containing
350 MongoDB URI options.
351 """
352 # Expand the tlsInsecure option.
353 tlsinsecure = options.get("tlsinsecure")
354 if tlsinsecure is not None:
355 for opt in _IMPLICIT_TLSINSECURE_OPTS:
356 # Implicit options are logically the same as tlsInsecure.
357 options[opt] = tlsinsecure
358
359 for optname in list(options):
360 intname = INTERNAL_URI_OPTION_NAME_MAP.get(optname, None)
361 if intname is not None:
362 options[intname] = options.pop(optname)
363
364 return options
365
366
367def validate_options(opts: Mapping[str, Any], warn: bool = False) -> MutableMapping[str, Any]:

Callers 4

split_optionsFunction · 0.85
_parse_kms_tls_optionsFunction · 0.85

Calls 2

getMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected