extend or assign new data to datapoint
498936
def _extend_data(self, datapoint, new_data):
        
        if new_data:
            try:
                self.data[datapoint].extend(new_data)
            except KeyError:
                self.data[datapoint] = new_data
1148744
def new_value(self, key, value):
        """"""
        data = self.model.get_data()
        data[key] = value
        self.set_data(data)
1080804
function(newData) {
          var requiresRefresh = newData.length > 0 || newData.length < self.dataLength;

          self.dataLength = newData.length;

          return !!requiresRefresh;
        }
393855
function extendData({
  data,
  lengthAngle: totalAngle,
  totalValue,
  paddingAngle,
}) {
  const total = totalValue || sumValues(data);
  const normalizedTotalAngle = valueBetween(totalAngle, -360, 360);
  const numberOfPaddings =
    Math.abs(normalizedTotalAngle) === 360 ? data.length : data.length - 1;
  const degreesTakenByPadding =
    Math.abs(paddingAngle) * numberOfPaddings * Math.sign(normalizedTotalAngle);
  const singlePaddingDegrees = degreesTakenByPadding / numberOfPaddings;
  const degreesTakenByPaths = normalizedTotalAngle - degreesTakenByPadding;
  let lastSegmentEnd = 0;

  return data.map(dataEntry => {
    const valueInPercentage = (dataEntry.value / total) * 100;
    const degrees = extractPercentage(degreesTakenByPaths, valueInPercentage);
    const startOffset = lastSegmentEnd;
    lastSegmentEnd = lastSegmentEnd + degrees + singlePaddingDegrees;

    return {
      percentage: valueInPercentage,
      degrees,
      startOffset,
      ...dataEntry,
    };
  });
}
476746
def add(self, start, end, cut_point = None, skip_rate = None, extend_loop = None):
        ''''''
        self.data.append(self.parse_loop_line(['LOOP', start, end, cut_point, skip_rate, extend_loop]))
        assert(start <= end)
1241435
def add_data_set(self, data, series_type="line", name=None, **kwargs):
        """"""

        self.data_set_count += 1
        if not name:
            name = "Series %d" % self.data_set_count
        kwargs.update({'name':name})

        if series_type == 'treemap':
            self.add_JSsource('http://code.highcharts.com/modules/treemap.js')

        series_data = Series(data, series_type=series_type, **kwargs)
       
        series_data.__options__().update(SeriesOptions(series_type=series_type, **kwargs).__options__())
        self.data_temp.append(series_data)
372688
synchronized void addDataPoint(double value, int updated) {
        // 8/10/2012: Force the standard deviation to 1/3 of the first data point
        // 8/11:2012: Force it to 1/6th of the first data point (more accurate)
        if (ewmaVariance == Double.NEGATIVE_INFINITY) {
            reset(value, updated);
            return;
        }

        double delta = value - ewma;
        double increment = ALPHA * delta;

        ewma += increment;
        ewmaVariance = (1 - ALPHA) * (ewmaVariance + delta * increment);
        ewmaStddev = Math.sqrt(ewmaVariance);

        lastUpdate = updated;
    }
327872
def method_missing(name, *args, &block)
      result = @dataset.send(name, *args, &block)
      if result.kind_of?(Sequel::Dataset)
        new_object = clone
        new_object.send(:obj=, result)
        new_object
      else
        result
      end
    end
1356632
def update(self):
        """"""
        self.filename = self.parent.info.dataset.filename

        self.chan = self.parent.info.dataset.header['chan_name']
        for chan in self.chan:
            self.idx_chan.addItem(chan)
843574
def new_data(self, mem, addr, data):
        """"""
        if mem.id == self.id:
            if addr == LocoMemory2.ADR_ID_LIST:
                self._handle_id_list_data(data)
            elif addr == LocoMemory2.ADR_ACTIVE_ID_LIST:
                self._handle_active_id_list_data(data)
            else:
                id = int((addr - LocoMemory2.ADR_ANCHOR_BASE) /
                         LocoMemory2.ANCHOR_PAGE_SIZE)
                self._handle_anchor_data(id, data)
456993
public void addData(LofPoint addedPoint)
    {
        this.dataIdList.add(addedPoint.getDataId());
        this.dataMap.put(addedPoint.getDataId(), addedPoint);
    }
573106
def _update_data_out(self, data, dtype):
        """"""
        try:
            self.data_out.update({dtype: data})
        except AttributeError:
            self.data_out = {dtype: data}
462520
public void add(Datapoint dp)
	{
		synchronized (points) {
			if (points.containsKey(dp.getMainAddress()))
				throw new KNXIllegalArgumentException("duplicate datapoint "
					+ dp.getMainAddress());
			points.put(dp.getMainAddress(), dp);
		}
	}
977677
def add_data_point(self, x, y):
        """"""

        if not is_numeric(x):
            raise TypeError("x value must be numeric, not '%s'" % str(x))
        if not is_numeric(y):
            raise TypeError("y value must be numeric, not '%s'" % str(y))
        current_last_x = self._data[-1][0]
        self._data.append((x, y))
        if x < current_last_x:
            self._data = sorted(self._data, key=lambda k: k[0])
342144
def data(self, *args):
        ''''''
        data = self._data
        if not args:
            return data or {}
        result, adding = self._attrdata('data', *args)
        if adding:
            if data is None:
                self._extra['data'] = {}
            add = self._visitor.add_data
            for key, value in result.items():
                add(self, key, value)
            return self
        else:
            return result
192285
def addDataset(self, dataset):
        
        self._datasets.append(dataset)
        self._dataChanged = True
        self._addDatasetAction(dataset)
133981
def add_new_fields(data, data_to_add):
        
        for key, value in data_to_add.items():
            if not data.get(key):
                data[key] = value

        return data