(self, instance, format)
Check whether the instance conforms to the given format.

        Arguments:

            instance (*any primitive type*, i.e. str, number, bool):

                The instance to check

            format (str):

                The format that instance should conform to


        Raises:

            FormatError: if the instance does not conform to ``format``
Check whether the instance conforms to the given format.
Check whether the instance conforms to the given format .
def check(self, instance, format):
        """
        Check whether the instance conforms to the given format.

        Arguments:

            instance (*any primitive type*, i.e. str, number, bool):

                The instance to check

            format (str):

                The format that instance should conform to


        Raises:

            FormatError: if the instance does not conform to ``format``
        """

        if format not in self.checkers:
            return

        func, raises = self.checkers[format]
        result, cause = None, None
        try:
            result = func(instance)
        except raises as e:
            cause = e
        if not result:
            raise FormatError(f"{instance!r} is not a {format!r}", cause=cause)
def check ( self , instance , format ) : if format not in self . checkers : return func , raises = self . checkers [ format ] result , cause = None , None try : result = func ( instance ) except raises as e : cause = e if not result : raise FormatError ( f"{instance!r} is not a {format!r}" , cause = cause )