def validate(cls, instance):
        """Validate a JSON representation against :attr:`schema`.

        Arguments
        ---------
        instance : :class:`dict`
            JSON representation to validate, either previously returned by :meth:`as_json`
            or retrieved from an external source.

        Raises
        ------
        :exc:`InvalidAnnotation`
            If :py:`instance` doesn't conform to :attr:`schema`.
        """
        # TODO: Remove this. Ignore a deprecation warning from jschon's rfc3986 dependency.
        with warnings.catch_warnings():
            warnings.filterwarnings("ignore", category=DeprecationWarning)
            result = cls.__jschon_schema().evaluate(jschon.JSON(instance))

        if not result.valid:
            raise InvalidAnnotation("Invalid instance:\n" +
                                    pprint.pformat(result.output("basic")["errors"],
                                                   sort_dicts=False))
Validate a JSON representation against :attr:`schema`.

        Arguments
        ---------
        instance : :class:`dict`
            JSON representation to validate, either previously returned by :meth:`as_json`
            or retrieved from an external source.

        Raises
        ------
        :exc:`InvalidAnnotation`
            If :py:`instance` doesn't conform to :attr:`schema`.
        
amaranth/lib/meta.py