code: def add_schemas(path, ext="json"):
      
      if not os.path.exists(path):
          raise SchemaPathError()
      filepat = "*." + ext if ext else "*"
      for f in glob.glob(os.path.join(path, filepat)):
          with open(f, 'r') as fp:
              try:
                  schema = json.load(fp)
              except ValueError:
                  raise SchemaParseError("error parsing '{}'".format(f))
          name = os.path.splitext(os.path.basename(f))[0]
          schemata[name] = Schema(schema)
docs: Add schemas from files in 'path'.
  
      :param path: Path with schema files. Schemas are named by their file,
                   with the extension stripped. e.g., if path is "/tmp/foo",
                   then the schema in "/tmp/foo/bar.json" will be named "bar".
      :type path: str
      :param ext: File extension that identifies schema files
      :type ext: str
      :return: None
      :raise: SchemaPathError, if no such path. SchemaParseError, if a schema
              is not valid JSON.