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

Function _get_validator

pymongo/common.py:810–818  ·  view source on GitHub ↗
(
    key: str, validators: dict[str, Callable[[Any, Any], Any]], normed_key: Optional[str] = None
)

Source from the content-addressed store, hash-verified

808
809
810def _get_validator(
811 key: str, validators: dict[str, Callable[[Any, Any], Any]], normed_key: Optional[str] = None
812) -> Callable[[Any, Any], Any]:
813 normed_key = normed_key or key
814 try:
815 return validators[normed_key]
816 except KeyError:
817 suggestions = get_close_matches(normed_key, validators, cutoff=0.2)
818 raise_config_error(key, suggestions)
819
820
821def validate(option: str, value: Any) -> tuple[str, Any]:

Callers 2

validateFunction · 0.85
get_validated_optionsFunction · 0.85

Calls 1

raise_config_errorFunction · 0.85

Tested by

no test coverage detected