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

Method __contains__

box/box.py:407–423  ·  view source on GitHub ↗
(self, item)

Source from the content-addressed store, hash-verified

405 return list(items)
406
407 def __contains__(self, item):
408 in_me = super().__contains__(item)
409 if not self._box_config["box_dots"] or not isinstance(item, str):
410 return in_me
411 if in_me:
412 return True
413 if "." not in item:
414 return False
415 try:
416 first_item, children = _parse_box_dots(self, item)
417 except BoxError:
418 return False
419 else:
420 if not super().__contains__(first_item):
421 return False
422 it = self[first_item]
423 return isinstance(it, Iterable) and children in it
424
425 def keys(self, dotted: bool = False):
426 if not dotted:

Callers

nothing calls this directly

Calls 1

_parse_box_dotsFunction · 0.85

Tested by

no test coverage detected