MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / __check_value__

Method __check_value__

detrsmpl/data/data_structures/human_data.py:793–816  ·  view source on GitHub ↗

Check whether the value matches definition in HumanData.SUPPORTED_KEYS. Args: key (Any): Key in HumanData. val (Any): Value to the key. Returns: bool: True for matched, ortherwise False.

(self, key: Any, val: Any)

Source from the content-addressed store, hash-verified

791 return ret_key_check
792
793 def __check_value__(self, key: Any, val: Any) -> bool:
794 """Check whether the value matches definition in
795 HumanData.SUPPORTED_KEYS.
796
797 Args:
798 key (Any):
799 Key in HumanData.
800 val (Any):
801 Value to the key.
802
803 Returns:
804 bool:
805 True for matched, ortherwise False.
806
807 Raises:
808 ValueError:
809 Value is supported but doesn't match definition.
810 """
811 ret_bool = self.__check_value_type__(key, val) and\
812 self.__check_value_shape__(key, val) and\
813 self.__check_value_len__(key, val)
814 if not ret_bool:
815 raise ValueError(self.__class__.__get_value_error_msg__())
816 return ret_bool
817
818 def __check_value_type__(self, key: Any, val: Any) -> bool:
819 """Check whether the type of val matches definition in

Callers 2

__setitem__Method · 0.95
set_raw_valueMethod · 0.95

Calls 4

__check_value_type__Method · 0.95
__check_value_shape__Method · 0.95
__check_value_len__Method · 0.95

Tested by

no test coverage detected