wrapper for :py:func:`json.load`
972584
def load(cls, fp, **kwargs):
    """"""
    json_obj = json.load(fp, **kwargs)
    return parse(cls, json_obj)
410473
function _load(source, callback) {
  fs.readFile(source, {encoding: 'utf8'}, _jsonLoaded.bind(null, callback));
}
814081
async def json(self, *, loads: JSONDecoder=DEFAULT_JSON_DECODER) -> Any:
        """"""
        body = await self.text()
        return loads(body)
1065604
def load(json_src, save=False):
    """"""
    if isinstance(json_src, six.string_types):
        json_src = json_lib.loads(json_src)

    if isinstance(json_src, list):
        return [getattr(objects, obj['class']).load(obj, save)
                for obj in json_src]

    return getattr(objects, json_src['class']).load(json_src, save)
91290
def import_json():
    '''
    
    '''
    for fast_json in ('ujson', 'yajl', 'json'):
        try:
            mod = __import__(fast_json)
            log.trace('loaded %s json lib', fast_json)
            return mod
        except ImportError:
            continue
1083134
def loadjson(filename, asnparrays=False):
    
    with open(filename) as f:
        data = json.load(f)
    if asnparrays:
        for key, value in data.items():
            if type(value) is list:
                data[key] = np.asarray(value)
            if type(value) is dict:
                for key2, value2 in value.items():
                    if type(value2) is list:
                        data[key][key2] = np.asarray(value2)
    return data
989918
def loads_json_or_yaml(file_path, content):
    
    if os.path.splitext(file_path)[1] == ".json":
        return json.loads(content)
    else:
        return inginious.common.custom_yaml.load(content)
1062927
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            return cls.from_dict(json.load(f))
536593
def json_or_jsonp(func):
    """"""
    @wraps(func)
    def _(*args, **kwargs):
        mimetype = 'application/javascript'
        callback = request.args.get('callback', None)
        if callback is None:
            content = func(*args, **kwargs)

        else:
            content = "%s(%s)" % (callback, func(*args, **kwargs))
        return current_app.response_class(content, mimetype=mimetype)
    return _
38992
def load_json(file):
    """"""
    here = os.path.dirname(os.path.abspath(__file__))
    with open(os.path.join(here, file)) as jfile:
        data = json.load(jfile)
    return data
173664
def load_json(filename):
    """"""
    try:
        if PY2:
            args = 'rb'
        else:
            args = 'r'
        with open(filename, args) as fid:
            data = json.load(fid)
        return data, None
    except Exception as err:
        return None, str(err)
1055982
def _load_json(self):
        
        if os.path.isfile(self.expectations_json):
            self.log.info("Loading expectation config from file {file}".format(file=self.expectations_json))
            return json.load(open(self.expectations_json))
        else:
            self.log.info("Loading expectation config from string")
            return json.loads(self.expectations_json)
397166
def loads(s, as_dict=False, *args, **kwargs):
    
    if as_dict or (not isinstance(s, six.string_types)):
        s = json.dumps(s)
    kwargs['object_hook'] = object_hook
    return json.loads(s, *args, **kwargs)
660291
def load_jsonf(fpath, encoding):
    
    with codecs.open(fpath, encoding=encoding) as f:
        return json.load(f)
307470
def load(self, filename):
        """"""
        content = open(filename)
        return Config(json.load(content))
1348591
def json_decoder(content, *args, **kwargs):
    
    if not content:
        return None
    json_value = content.decode()
    return json.loads(json_value)
1265437
def load_result_json(result_path, json_file_name):
    """"""
    json_path = os.path.join(result_path, json_file_name)

    _list = []
    if os.path.isfile(json_path):
        with open(json_path) as json_data:
            try:
                _list = json.load(json_data)
            except ValueError as err:
                logger.error(
                    'Failed to load json: {}, {}'.format(json_path, err))

    return _list