MCPcopy Index your code
hub / github.com/python-pendulum/pendulum / get

Method get

src/pendulum/locales/locale.py:58–72  ·  view source on GitHub ↗
(self, key: str, default: Any | None = None)

Source from the content-addressed store, hash-verified

56 return locale.lower()
57
58 def get(self, key: str, default: Any | None = None) -> Any:
59 if key in self._key_cache:
60 return self._key_cache[key]
61
62 parts = key.split(".")
63 try:
64 result = self._data[parts[0]]
65 for part in parts[1:]:
66 result = result[part]
67 except KeyError:
68 result = default
69
70 self._key_cache[key] = result
71
72 return self._key_cache[key]
73
74 def translation(self, key: str) -> Any:
75 return self.get(f"translations.{key}")

Callers 12

translationMethod · 0.95
ordinalizeMethod · 0.95
parseFunction · 0.80
_parseFunction · 0.80
_normalizeFunction · 0.80
_parseFunction · 0.80
_get_windows_timezoneFunction · 0.80
_get_unix_timezoneFunction · 0.80
formatMethod · 0.80
FormatterClass · 0.80
_format_tokenMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected