Import scenes from JSON response.
542058
def data_import(self, json_response):
        """"""
        if 'data' not in json_response:
            raise PyVLXException('no element data found: {0}'.format(
                json.dumps(json_response)))
        data = json_response['data']
        for item in data:
            self.load_scene(item)
554601
def _load_response(response):
    '''
    
    '''

    try:
        data = salt.utils.json.loads(response.text)
    except ValueError:
        data = response.text

    ret = {'code': response.status_code, 'content': data}

    return ret
1172044
def from_dict(cls, json_object):
        """"""
        config = OpenAIGPTConfig(vocab_size_or_config_json_file=-1)
        for key, value in json_object.items():
            config.__dict__[key] = value
        return config
223447
def import_from_json(filename_or_fobj, encoding="utf-8", *args, **kwargs):
    

    source = Source.from_file(filename_or_fobj, mode="rb", plugin_name="json", encoding=encoding)

    json_obj = json.load(source.fobj, encoding=source.encoding)
    field_names = list(json_obj[0].keys())
    table_rows = [[item[key] for key in field_names] for item in json_obj]

    meta = {"imported_from": "json", "source": source}
    return create_table([field_names] + table_rows, meta=meta, *args, **kwargs)
582792
def fromJSON(value):
        """"""
        if isinstance(value, str):
            value = json.loads(value)
        elif isinstance(value, dict): pass
        else:
            raise AttributeError("Invalid input")
        return Extension(typeName=value['typeName'],
                         capabilities=value['capabilities'],
                         enabled=value['enabled'] == "true",
                         maxUploadFileSize=value['maxUploadFileSize'],
                         allowedUploadFileType=value['allowedUploadFileTypes'],
                         properties=value['properties'])
1241544
def from_json(data):
        
        memfiles = InMemoryFiles()
        memfiles.files = json.loads(data)
        return memfiles
535405
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'words' in _dict:
            args['words'] = [Word._from_dict(x) for x in (_dict.get('words'))]
        else:
            raise ValueError(
                'Required property \'words\' not present in Words JSON')
        return cls(**args)
556460
def import_json(cls, filename):
        
        with open(filename, 'rb') as f:
            json_graph = f.read().decode('utf-8')
        return cls.from_json(json_graph)
497426
def from_payload(self, payload):
        """"""
        number_of_objects = payload[0]
        self.remaining_scenes = payload[-1]
        predicted_len = number_of_objects * 65 + 2
        if len(payload) != predicted_len:
            raise PyVLXException('scene_list_notification_wrong_length')
        self.scenes = []
        for i in range(number_of_objects):
            scene = payload[(i*65+1):(i*65+66)]
            number = scene[0]
            name = bytes_to_string(scene[1:])
            self.scenes.append((number, name))
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))
1163968
def from_json(s):
    
    d = json.loads(s)
    sbp = SBP.from_json_dict(d)
    return sbp
264835
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'models' in _dict:
            args['models'] = [
                TranslationModel._from_dict(x) for x in (_dict.get('models'))
            ]
        else:
            raise ValueError(
                'Required property \'models\' not present in TranslationModels JSON'
            )
        return cls(**args)
816643
def parse_json(text: str, encoding: str = "utf-8") -> HistogramBase:
    """"""
    data = json.loads(text, encoding=encoding)
    return create_from_dict(data, format_name="JSON")
301912
def json_numpy_loader():
    """"""
    data = request.get_json()
    logger.debug('Received JSON data of length {:,}'.format(len(data)))
    return data
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
339379
def load_json_network(json_dict):
    """"""
    network = pyphi.Network.from_json(json_dict['network'])
    state = json_dict['state']
    return (network, state)
489677
def from_json(cls, json):
    
    return cls(json[cls.BLOB_KEY_PARAM],
               json[cls.START_INDEX_PARAM],
               json[cls.END_INDEX_PARAM])