MCPcopy
hub / github.com/pandas-dev/pandas / _get_single_key

Function _get_single_key

pandas/_config/config.py:127–140  ·  view source on GitHub ↗
(pat: str)

Source from the content-addressed store, hash-verified

125
126
127def _get_single_key(pat: str) -> str:
128 keys = _select_options(pat)
129 if len(keys) == 0:
130 _warn_if_deprecated(pat)
131 raise OptionError(f"No such keys(s): {pat!r}")
132 if len(keys) > 1:
133 raise OptionError("Pattern matched multiple keys")
134 key = keys[0]
135
136 _warn_if_deprecated(key)
137
138 key = _translate_key(key)
139
140 return key
141
142
143def get_option(pat: str) -> Any:

Callers 3

get_optionFunction · 0.85
set_optionFunction · 0.85
get_default_valFunction · 0.85

Calls 4

_select_optionsFunction · 0.85
_warn_if_deprecatedFunction · 0.85
OptionErrorClass · 0.85
_translate_keyFunction · 0.85

Tested by

no test coverage detected