Populate model parameters from a dictionary of parameters

        Parameters
        ----------
        data : dict
            List of parameter dictionaries

        Returns
        -------
        None
427681
def data_from_dict(self, data):
        

        nvars = []
        for key, val in data.items():
            self.__dict__[key].extend(val)

            # assure the same parameter matrix size
            if len(nvars) > 1 and len(val) != nvars[-1]:
                raise IndexError(
                    'Model <{}> parameter <{}> must have the same length'.
                    format(self._name, key))
            nvars.append(len(val))

        # assign idx-uid mapping
        for i, idx in zip(range(self.n), self.idx):
            self.uid[idx] = i
959148
def param_dict_to_str(data):
    """"""
    if data is None or not data:
        return ""
    pairs = []
    for key, val in data.items():
        if isinstance(val, (list, tuple, set)) or is_numpy_1d_array(val):
            pairs.append(str(key) + '=' + ','.join(map(str, val)))
        elif isinstance(val, string_type) or isinstance(val, numeric_types) or is_numeric(val):
            pairs.append(str(key) + '=' + str(val))
        elif val is not None:
            raise TypeError('Unknown type of parameter:%s, got:%s'
                            % (key, type(val).__name__))
    return ' '.join(pairs)
318434
def data_to_list(self, sysbase=False):
        
        ret = list()

        # for each element
        for i in range(self.n):
            # read the parameter values and put in the temp dict ``e``
            e = {}
            for key in self.data_keys:
                if sysbase and (key in self._store):
                    val = self._store[key][i]
                else:
                    val = self.__dict__[key][i]
                e[key] = val

            ret.append(e)

        return ret
169444
def to_params(self):
        '''
        
        '''
        params = {}
        custom_params = {}
        for key in self.custom_params:
            custom_params[key] = self.custom_params[key]
        ext_params = {}
        for key in self.ext_params:
            ext_params[key] = self.ext_params[key]
        for key in LAUNCH_DATA_PARAMETERS:
            if hasattr(self, key):
                params[key] = getattr(self, key)
        params.update(custom_params)
        params.update(ext_params)
        return params
896626
def to_list_of_dicts(self, **kwargs):
        
        if kwargs:
            return self.filter(**kwargs).to_list_of_dicts()
        return [param.to_dict() for param in self._params]
1156623
def _process_params(self, params):
        
        new_params = OrderedDict()
        for param_name, param_value in sorted(params.items()):
            param_value = params[param_name]
            ParamClass = AirtableParams._get(param_name)
            new_params.update(ParamClass(param_value).to_param_dict())
        return new_params
68044
def _load_data(self, data, from_db=False):
        
        self._data = data[:]
        self.setattrs(
            values=[],
            node_stack=[],
            node_dict={},
        )
        self._from_db = from_db
612562
def _param_to_list(self):
        
        for item in self._params:
            self.__dict__[item] = list(self.__dict__[item])
1188681
def from_dict(self, data, recursive=1):
        
        # Find other linked resources
        data = self._encode_resource(data, recursive=recursive)
        self.data = data
816081
def set_params(self, data):
        """"""
        bytes_io = BytesIO(data)

        assert struct.unpack("<I", bytes_io.read(4))[0] == 0xb5890dba

        self.nonce = bytes_io.read(16)
        self.server_nonce = bytes_io.read(16)

        self.g = struct.unpack("<I", bytes_io.read(4))[0]

        self.dh_prime = deserialize_string(bytes_io)
        self.g_a = deserialize_string(bytes_io)

        self.server_time = struct.unpack("<I", bytes_io.read(4))[0]
112087
def parameters_from_model(parameters_model):
        
        parameters = {}
        for p in parameters_model:
            if p.is_function:
                code, defaults, closure = pickle.loads(p.value)
                parameters[p.key] = func_load(code, defaults, closure, globs=globals())
            elif p.is_set:
                parameters[p.key] = set(p.value)
            else:
                parameters[p.key] = p.value
        return parameters
1242636
def _loadData(self, data):
        
        self._data = data
        self.fastKey = data.attrib.get('fastKey')
        self.key = data.attrib.get('key')
        self.thumb = data.attrib.get('thumb')
        self.title = data.attrib.get('title')
        self.type = data.attrib.get('type')
1057868
def to_param_dict(self):
        
        param_dict = {}
        for index, dictionary in enumerate(self.value):
            for key, value in dictionary.items():
                param_name = '{param_name}[{index}][{key}]'.format(
                                                    param_name=self.param_name,
                                                    index=index,
                                                    key=key)
                param_dict[param_name] = value
        return OrderedDict(sorted(param_dict.items()))
643492
def expand_models(self, target, data):
        
        if isinstance(data, dict):
            data = data.values()
        for chunk in data:
            if target in chunk:
                yield self.init_target_object(target, chunk)
            else:
                for key, item in chunk.items():
                    yield self.init_single_object(key, item)
135404
def _get_params(self, rdata):
        
        if 'params' in rdata:
            if isinstance(rdata['params'], dict) \
                    or isinstance(rdata['params'], list) \
                    or rdata['params'] is None:
                return rdata['params']
            else:
                # wrong type
                raise InvalidRequestError
        else:
            return None
1360648
def initial_populate(self, data):
        
        if self.config.parsed:
            return False
        # Otherwise, create a new ConfigKey.
        self.config.load_from_dict(data)
        return True
167994
def load(self, data: dict):
        
        for i, label in enumerate(self.keys):
            key = label.cget('text')
            if key in data.keys():
                entry_was_enabled = True if \
                    self.values[i].cget('state') == 'normal' else False
                if not entry_was_enabled:
                    self.values[i].config(state='normal')

                self.values[i].delete(0, tk.END)
                self.values[i].insert(0, str(data[key]))

                if not entry_was_enabled:
                    self.values[i].config(state='disabled')