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

Method validate_item

detrsmpl/core/cameras/camera_parameters.py:516–538  ·  view source on GitHub ↗

Check whether the key and its value matches definition in CameraParameter.SUPPORTED_KEYS. Args: key (Any): Key in CameraParameter. val (Any): Value to the key. Raises: KeyError: key cannot b

(self, key: Any, val: Any)

Source from the content-addressed store, hash-verified

514 return cam
515
516 def validate_item(self, key: Any, val: Any) -> List:
517 """Check whether the key and its value matches definition in
518 CameraParameter.SUPPORTED_KEYS.
519
520 Args:
521 key (Any):
522 Key in CameraParameter.
523 val (Any):
524 Value to the key.
525
526 Raises:
527 KeyError:
528 key cannot be found in
529 CameraParameter.SUPPORTED_KEYS.
530 TypeError:
531 Value's type doesn't match definition.
532 Returns:
533 key (Any): The input key.
534 val (Any): The value casted into correct format.
535 """
536 self.__check_key__(key)
537 formatted_val = self.__validate_value_type__(key, val)
538 return key, formatted_val
539
540 def __check_key__(self, key: Any) -> None:
541 """Check whether the key matches definition in

Callers 3

__init__Method · 0.95
set_mat_listMethod · 0.95
set_valueMethod · 0.95

Calls 2

__check_key__Method · 0.95

Tested by

no test coverage detected