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

Method get

box/box.py:457–469  ·  view source on GitHub ↗
(self, key, default=NO_DEFAULT)

Source from the content-addressed store, hash-verified

455 return [(k, self[k]) for k in self.keys(dotted=True)]
456
457 def get(self, key, default=NO_DEFAULT):
458 if key not in self:
459 if default is NO_DEFAULT:
460 if self._box_config["default_box"] and self._box_config["default_box_none_transform"]:
461 return self.__get_default(key)
462 else:
463 return None
464 if isinstance(default, dict) and not isinstance(default, Box):
465 return Box(default)
466 if isinstance(default, list) and not isinstance(default, box.BoxList):
467 return box.BoxList(default)
468 return default
469 return self[key]
470
471 def copy(self) -> Box:
472 config = self.__box_config()

Callers 12

test_default_boxMethod · 0.95
test_getMethod · 0.95
test_get_default_boxMethod · 0.95
__sub__Method · 0.95
mp_queue_testFunction · 0.80
test_through_queueMethod · 0.80
__init__Method · 0.80
__getitem__Method · 0.80
__delitem__Method · 0.80
__setitem__Method · 0.80
_is_intact_typeMethod · 0.80
__hash__Method · 0.80

Calls 2

__get_defaultMethod · 0.95
BoxClass · 0.85

Tested by 5

test_default_boxMethod · 0.76
test_getMethod · 0.76
test_get_default_boxMethod · 0.76
mp_queue_testFunction · 0.64
test_through_queueMethod · 0.64