@classmethod
def check_schema(cls, schema, namespaces=None):
    """
        Validates the given schema against the XSD meta-schema (:attr:`meta_schema`).

        :param schema: the schema instance that has to be validated.
        :param namespaces: is an optional mapping from namespace prefix to URI.

        :raises: :exc:`XMLSchemaValidationError` if the schema is invalid.
        """
    if not cls.meta_schema.maps.types:
        cls.meta_schema.maps.build()
    for error in cls.meta_schema.iter_errors(schema, namespaces=namespaces):
        raise error
