Read json cluster and populate as cluster class
964052
def read_cluster(data, id=1):
    """"""
    cl = cluster(1)

    # seqs = [s.values()[0] for s in data['seqs']]
    names = [s.keys()[0] for s in data['seqs']]
    cl.add_id_member(names, 1)
    freq = defaultdict()
    [freq.update({s.keys()[0]: s.values()[0]}) for s in data['freq']]
112400
def from_json(cls, json):
    
    mapreduce_spec = cls(json["name"],
                         json["mapreduce_id"],
                         json["mapper_spec"],
                         json.get("params"),
                         json.get("hooks_class_name"))
    return mapreduce_spec
1271661
public static JsonNode readJson(Reader source, ClassLoader classLoader) {
        return SerializationUtils.readJson(source, classLoader);
    }
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))
659279
def from_json(cls, data, json_schema_class=None):
        
        schema = cls.json_schema if json_schema_class is None else json_schema_class()
        return schema.load(data)
319449
def load_json(self, json):
        """"""
        for key in json:
            if key == "wandb_version":
                continue
            self._items[key] = json[key].get('value')
            self._descriptions[key] = json[key].get('desc')
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
747671
def from_json(cls, json_data):
        """"""
        # Example Data:
        # { "grpId": "11817", "grpName": "7603_Digi", "grpDescription": "7603_Digi root group",
        #   "grpPath": "\/7603_Digi\/", "grpParentId": "1"}
        return cls(
            group_id=json_data["grpId"],
            name=json_data["grpName"],
            description=json_data.get("grpDescription", ""),
            path=json_data["grpPath"],
            parent_id=json_data["grpParentId"],
        )
522795
def load(cls, tree_path):
        """"""
        with open(tree_path) as f:
            tree_dict = json.load(f)

        return cls.from_dict(tree_dict)
820910
def from_json(cls, json):
    """"""
    return cls(json[cls.BLOB_KEY_PARAM],
               json[cls.INITIAL_POSITION_PARAM],
               json[cls.END_POSITION_PARAM])
1233443
def initMazeFromJSON(jsonString, cellClass=Cell, gridClass=Grid):
    ''''''
    
    jsonObj = json.loads(jsonString)
    rows=jsonObj["rows"]
    columns=jsonObj["columns"]
    grid=gridClass(rows,columns,cellClass)
    grid.algorithm=jsonObj["algorithm"]
    grid.algorithm_key=jsonObj["algorithm_key"]
    grid.braid=jsonObj["braid"]

    #init cells
    #for each cell link those that are neigbors
    for _cell in jsonObj["cells"]:
        cell=json.loads(_cell)
        gridCell=grid.getCell(cell["row"],cell["column"])
        if "content" in cell:
            gridCell.content=cell["content"]
        else:
            gridCell.setContent(" ")
        
        if cell["north"]:
            gridCell.link(gridCell.north)
        if cell["east"]:
            gridCell.link(gridCell.east)
        if cell["south"]:
            gridCell.link(gridCell.south)
        if cell["west"]:
            gridCell.link(gridCell.west)

    return grid
154823
def load_json(file, new_root_dir=None, decompression=False):
    """"""
    if decompression:
        with open(file, 'rb') as f:
            my_object = load(f, decompression=decompression)
    else:
        with open(file, 'r') as f:
            my_object = load(f, decompression=decompression)
    if new_root_dir:
        my_object.root_dir = new_root_dir

    return my_object
532845
def from_node(index, data, modify_index=None):
        

        try:
            data = json.loads(data)
        except (TypeError, ValueError):
            data = None
            modify_index = 0
        if not isinstance(data, dict):
            data = {}
        return ClusterConfig(index, data, index if modify_index is None else modify_index)
713191
def populate_values(self):
        '''
        
        '''
        obj = self._get_base_state()
        self.base_state = json.dumps(obj)
844915
def from_json(cls, json):
    
    return cls(
        namespace_range.NamespaceRange.from_json_object(
            json[cls.NAMESPACE_RANGE_PARAM]),
        json[cls.BATCH_SIZE_PARAM])
1172814
def getJson(cls, url, method='GET', headers={}, data=None, socket=None, timeout=120):
        
        if not 'Content-Type' in headers:
            headers['Content-Type'] = ['application/json']

        body = yield cls().getBody(url, method, headers, data, socket, timeout)

        defer.returnValue(json.loads(body))
897781
def from_json(cls, path, fatal=True, logger=None):
        
        result = cls()
        result.load(path, fatal=fatal, logger=logger)
        return result