MCPcopy Create free account
hub / github.com/cdgriffith/Box / _resolve_key

Function _resolve_key

box/comments.py:198–205  ·  view source on GitHub ↗

The key in `container` the YAML key ended up as, or a sentinel when it isn't there.

(container, key)

Source from the content-addressed store, hash-verified

196
197
198def _resolve_key(container, key):
199 """The key in `container` the YAML key ended up as, or a sentinel when it isn't there."""
200 if isinstance(container, (list, tuple)):
201 return key if isinstance(key, int) and 0 <= key < len(container) else _MISSING
202 if dict.__contains__(container, key):
203 return key
204 found = container._comment_resolve(key) # only Box / BoxList containers get here
205 return found if dict.__contains__(container, found) else _MISSING
206
207
208_MISSING = object()

Callers 1

apply_commentsFunction · 0.85

Calls 2

__contains__Method · 0.45
_comment_resolveMethod · 0.45

Tested by

no test coverage detected