(self, value: T.Any)
return True
Check that a value is valid.

        :param value: A value to check
        :return: True if it is valid, False otherwise
Check that a value is valid.
Check that a value is valid .
def check(self, value: T.Any) -> bool:
        """Check that a value is valid.

        :param value: A value to check
        :return: True if it is valid, False otherwise
        """
        if not isinstance(value, self.container):
            return False
        iter_ = iter(value.values()) if isinstance(value, dict) else iter(value)
        for each in iter_:
            if not isinstance(each, self.contains):
                return False
        if self.pairs and len(value) % 2 != 0:
            return False
        if not value and not self.allow_empty:
            return False
        return True
def check ( self , value : T . Any ) -> bool : if not isinstance ( value , self . container ) : return False iter_ = iter ( value . values ( ) ) if isinstance ( value , dict ) else iter ( value ) for each in iter_ : if not isinstance ( each , self . contains ) : return False if self . pairs and len ( value ) % 2 != 0 : return False if not value and not self . allow_empty : return False return True