Step through the items in a piece of json, and update an analysis dict
    with the values found.
356722
def update_json_analysis(analysis, j):
    
    def _analyze_list(l, parent=""):
        for v in l:
            if isinstance(v, (dict, CaseInsensitiveDict)):
                _analyze_json(v, parent=parent)
            elif isinstance(v, list):
                _analyze_list(v, parent=parent+"[]")
            else:
                analysis[parent].add(v)


    def _analyze_json(d, parent=""):
        for k, v in d.iteritems():
            if parent:
                path = ".".join([parent, k])
            else:
                path = k
            if isinstance(v, (dict, CaseInsensitiveDict)):
                _analyze_json(v, parent=path)
            elif isinstance(v, list):
                _analyze_list(v, parent=path+"[]")
            else:
                analysis[path].add(v)

    if isinstance(j, list):
        _analyze_list(j)
    if isinstance(j, (dict, CaseInsensitiveDict)):
        _analyze_json(j)
1136819
function updateTrack( newList, oldList, steps,  rawNewValue, oldKeyMap ){
    
    for(var i =0, slen = steps.length; i < slen ;i++){
      var step = steps[i];
      switch( step.mode){
        case 0 : //remove
          removeRange(step.index, step.len, group.children, oldKeyMap);
          break;
        case 1 : //insert
          addRange(step.index, step.index + step.len, newList, rawNewValue, oldKeyMap )
          break;
      }
    }     
    var children = group.children;
    for(var j=1, len = children.length; j < len; j++){
      var child = children[j];
      if( child ){
        child.data[variable] = newList[j-1];
        child.data[indexName] = j-1
      }
    }

    
  }
270647
def _objectify(self, json_data=None, data={}):
        ''''''
        if json_data:
            # Parse the data
            try:
                data = json.loads(json_data)
            except ValueError:
                # If parsing failed, then raise the string which likely contains an error message instead of data
                raise RedmineError(json_data)
        # Check to see if there is a data wrapper
        # Some replies will have {'issue':{<data>}} instead of just {<data>}
        try:
            data = data[self._item_type]
        except KeyError:
            pass

        # Either returns a new item or updates the item in the cache and returns that
        return self._redmine.check_cache(self._item_type, data, self._object)
1177990
def _from_dict(cls, _dict):
        """"""
        args = {}
        xtra = _dict.copy()
        if 'intent' in _dict:
            args['intent'] = _dict.get('intent')
            del xtra['intent']
        else:
            raise ValueError(
                'Required property \'intent\' not present in RuntimeIntent JSON'
            )
        if 'confidence' in _dict:
            args['confidence'] = _dict.get('confidence')
            del xtra['confidence']
        else:
            raise ValueError(
                'Required property \'confidence\' not present in RuntimeIntent JSON'
            )
        args.update(xtra)
        return cls(**args)
763504
def update_attrs(self):
        
        for key, value in self._response_json.items():
            if key != 'results' and type(value) not in (list, dict):
                setattr(self, key, value)
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))
442200
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'matching_results' in _dict:
            args['matching_results'] = _dict.get('matching_results')
        if 'results' in _dict:
            args['results'] = [
                QueryNoticesResult._from_dict(x) for x in (_dict.get('results'))
            ]
        if 'aggregations' in _dict:
            args['aggregations'] = [
                QueryAggregation._from_dict(x)
                for x in (_dict.get('aggregations'))
            ]
        if 'passages' in _dict:
            args['passages'] = [
                QueryPassages._from_dict(x) for x in (_dict.get('passages'))
            ]
        if 'duplicates_removed' in _dict:
            args['duplicates_removed'] = _dict.get('duplicates_removed')
        return cls(**args)
947439
def update(self, json_state):
        
        if self._type in CONST.BINARY_SENSOR_TYPES:
            self._json_state['status'] = json_state['status']
        else:
            self._json_state.update(
                {k: json_state[k] for k in json_state if self._json_state.get(k)})
381592
def update(self, result, spec):
        """"""
        if isinstance(spec, dict):
            if spec:
                spec_value = next(iter(spec.values()))
                for key, value in result.items():
                    result[key] = self.update(value, spec_value)
        if isinstance(spec, list):
            if spec:
                for i, value in enumerate(result):
                    result[i] = self.update(value, spec[0])
        if isinstance(spec, tuple):
            return tuple(self.update(value, s)
                         for s, value in zip(spec, result))
        if callable(spec):
            return spec(result)
        return result
888426
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'key' in _dict:
            args['key'] = _dict.get('key')
        if 'matching_results' in _dict:
            args['matching_results'] = _dict.get('matching_results')
        if 'aggregations' in _dict:
            args['aggregations'] = [
                QueryAggregation._from_dict(x)
                for x in (_dict.get('aggregations'))
            ]
        return cls(**args)
54000
def update_summary_qc(data, key, base=None, secondary=None):
    
    summary = get_summary_qc(data, {})
    if base and secondary:
        summary[key] = {"base": base, "secondary": secondary}
    elif base:
        summary[key] = {"base": base}
    elif secondary:
        summary[key] = {"secondary": secondary}
    data = set_summary_qc(data, summary)
    return data
98828
def update(self, *args):
        
        for d in args:
            for (key, value) in d.items():
                self.__setitem__(key, value)
1090121
function update(item, model, data, funcParams) {
    var working = [];
    var definedByData = [];

    _.forEach(data, function(value, key) {
        if (_.isFunction(value)) {
            working.push(Promise.resolve(value()).then(function(val) {
                item[key] = val;
            }));
        } else item[key] = value;
        definedByData.push(value);
    });

    _.forEach(model.itemDef, function(value, key) {
        if (value && value.__precalc) {
            var func = value.__precalc, previousVal = data[key];
            working.push(Promise.resolve(func.call(item, previousVal, funcParams || {})).then(function(val) {
                item[key] = (val && val._stWrapped) ? val.val : val;
            }));
        } // if the property has not been set from the itemDef yet. This allows item def properties to be changed
        else if (!_.has(item, key) || definedByData.indexOf(key) !== -1) item[key] = value;
    });

    return Promise.all(working);
}
627109
def update(self, json_state):
        
        self._json_state.update(
            {k: json_state[k] for k in json_state if self._json_state.get(k)})
        self._update_name()
819527
def revise(self, data):
        
        if not isinstance(data, dict):
            raise TypeError("`data` has to be a dict!")

        for key, value in data.items():
            if value is not None:
                setattr(self, key, deepcopy(value))
30187
def updateItem(self, instance, subKey, value):
    """"""
    instanceId = statsId(instance)

    container = _Stats.getContainerForObject(instanceId)
    self._aggregate(instanceId, container, value, subKey)
1097362
def recursive_update(_dict, _update):
    
    for k, v in _update.items():
        if isinstance(v, collections.Mapping):
            r = recursive_update(_dict.get(k, {}), v)
            _dict[k] = r
        else:
            _dict[k] = _update[k]
    return _dict