def load_schema(schema_ref,  <EOL>cache=None   <EOL>):<EOL>
metaschema_names, _metaschema_doc, metaschema_loader = get_metaschema()<EOL>if cache is not None:<EOL><INDENT>metaschema_loader.cache.update(cache)<EOL><DEDENT>schema_doc, schema_metadata = metaschema_loader.resolve_ref(schema_ref, "<STR_LIT>")<EOL>if not isinstance(schema_doc, MutableSequence):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>validate_doc(metaschema_names, schema_doc, metaschema_loader, True)<EOL>metactx = schema_metadata.get("<STR_LIT>", {})<EOL>metactx.update(collect_namespaces(schema_metadata))<EOL>schema_ctx = jsonld_context.salad_to_jsonld_context(schema_doc, metactx)[<NUM_LIT:0>]<EOL>document_loader = Loader(schema_ctx, cache=cache)<EOL>avsc_names = make_avro_schema(schema_doc, document_loader)<EOL>return document_loader, avsc_names, schema_metadata, metaschema_loader<EOL>
Load a schema that can be used to validate documents using load_and_validate.

return: document_loader, avsc_names, schema_metadata, metaschema_loader