Load the JSON schema at the given path as a Python object.

    Args:
        schema_path: A filename for a JSON schema.

    Returns:
        A Python object representation of the schema.
336223
def load_schema(schema_path):
    
    try:
        with open(schema_path) as schema_file:
            schema = json.load(schema_file)
    except ValueError as e:
        raise SchemaInvalidError('Invalid JSON in schema or included schema: '
                                 '%s\n%s' % (schema_file.name, str(e)))

    return schema
1065372
def load_schema(name):
    

    data = pkgutil.get_data('jsonschema', "schemas/{0}.json".format(name))
    return json.loads(data.decode("utf-8"))
595806
def load_swagger_spec(self, filepath=None):
        
        if filepath is True or filepath is None:
            filepath = self.file_spec.format(server=self.server)

        return json.load(open(filepath))
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
457472
def _loadMetaFromJson(self, path):
        
        try:
            with (path / 'metadata.json').open() as infile:
                return json.load(infile)
        except FileNotFoundError:
            logger.error('Metadata does not exist at ' + str(path))
            return None
380063
def load(self, schemafile=None):
        """"""
        if schemafile is not None:
            self._schemafile = schemafile

        try:
            self.data = json.load(open(self._schemafile))
        except (IOError, ValueError), e:
            msg = "Could not load schema file '" + self._schemafile + "': '" + str(e) + "'"
            raise jsonschema.SchemaError(msg)

        self.loaded = True
884362
def load(data_path):
        
        with open(data_path, "r") as data_file:
            raw_data = data_file.read()

        data_file.close()
        return raw_data
587523
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            json_string = f.read()
        return cls.from_json(json_string)
736122
def _schema_from_json_file_object(self, file_obj):
        
        json_data = json.load(file_obj)
        return [SchemaField.from_api_repr(field) for field in json_data]
931707
def _load_schemas(self):
        """"""
        for filename in os.listdir(self.settings['SCHEMA_DIR']):
            if filename[-4:] == 'json':
                name = filename[:-5]
                with open(self.settings['SCHEMA_DIR'] + filename) as the_file:
                    self.schemas[name] = json.load(the_file)
                    self.logger.debug("Successfully loaded " + filename + " schema")
1029150
def load(cls, copula_path):
        
        with open(copula_path) as f:
            copula_dict = json.load(f)

        return cls.from_dict(copula_dict)
277086
def load_from_file(cls, file_path: str):
        
        with open(file_path, "r") as f:
            data = json.load(f)
            item = cls.decode(data=data)
        return item
1301529
function load(schema) {
  var obj;
  if (typeof schema == 'string' && schema !== 'null') {
    // This last predicate is to allow `avro.parse('null')` to work similarly
    // to `avro.parse('int')` and other primitives (null needs to be handled
    // separately since it is also a valid JSON identifier).
    try {
      obj = JSON.parse(schema);
    } catch (err) {
      if (~schema.indexOf('/')) {
        // This can't be a valid name, so we interpret is as a filepath. This
        // makes is always feasible to read a file, independent of its name
        // (i.e. even if its name is valid JSON), by prefixing it with `./`.
        obj = JSON.parse(fs.readFileSync(schema));
      }
    }
  }
  if (obj === undefined) {
    obj = schema;
  }
  return obj;
}
367813
def load_objects_from_json(path, as_dict=False):
    
    f = open(path, 'r')
    if as_dict:
        result = json.load(f)
    else:
        result = json.load(f, cls=JSONObjectDecoder, substitute_modules=substitute_modules)
    f.close()
    return result
1129684
def load(self, path):
        
        with open(path, 'rb') as f:
            self.data = f.read()
            self.root = et.fromstring(self.data)
1073813
def get_dict_from_json_file(path, encoding='utf-8'):
    
    with open(path, encoding=encoding) as data_file:
        return json.loads(data_file.read())
1200767
def load_data_file(path_of_file):
    
    if os.path.exists(path_of_file):
        return storage_utils.load_objects_from_json(path_of_file)
    raise ValueError("Data file not found: {0}".format(path_of_file))