def loadSchema(uri, base_uri=None):
<EOL>if uri in _loaded_schemas:<EOL><INDENT>return _loaded_schemas[uri]<EOL><DEDENT>error_uri = uri<EOL>if base_uri is not None:<EOL><INDENT>error_uri += '<STR_LIT>' % base_uri<EOL><DEDENT>try:<EOL><INDENT>logger.debug('<STR_LIT>' % uri)<EOL>_loaded_schemas[uri] = etree.XMLSchema(etree.parse(uri,<EOL>parser=_get_xmlparser(),<EOL>base_url=base_uri))<EOL>return _loaded_schemas[uri]<EOL><DEDENT>except IOError as io_err:<EOL><INDENT>raise IOError('<STR_LIT>' % (error_uri, io_err))<EOL><DEDENT>except etree.XMLSchemaParseError as parse_err:<EOL><INDENT>raise etree.XMLSchemaParseError('<STR_LIT>' % (error_uri, parse_err))<EOL><DEDENT>
Load an XSD XML document (specified by filename or URL), and return a
    :class:`lxml.etree.XMLSchema`.