delegate operations to the *samples* attribute, but in a time
        correct manner by considering the *timestamps*
344094
def __apply_func(self, other, func_name):
        

        if isinstance(other, Signal):
            if len(self) and len(other):
                start = max(self.timestamps[0], other.timestamps[0])
                stop = min(self.timestamps[-1], other.timestamps[-1])
                s1 = self.cut(start, stop)
                s2 = other.cut(start, stop)
            else:
                s1 = self
                s2 = other
            time = np.union1d(s1.timestamps, s2.timestamps)
            s = self.interp(time).samples
            o = other.interp(time).samples
            func = getattr(s, func_name)
            s = func(o)
        elif other is None:
            s = self.samples
            time = self.timestamps
        else:
            func = getattr(self.samples, func_name)
            s = func(other)
            time = self.timestamps
        return Signal(
            samples=s,
            timestamps=time,
            unit=self.unit,
            name=self.name,
            conversion=self.conversion,
            raw=self.raw,
            master_metadata=self.master_metadata,
            display_name=self.display_name,
            attachment=self.attachment,
            stream_sync=self.stream_sync,
            invalidation_bits=self.invalidation_bits,
            source=self.source,
            encoding=self.encoding,
        )
70699
private void sampleDateRange() {
        List<String> text = new ArrayList<String>();
        DateTime start = DateTime.now();
        DateTime end = start.plusMinutes(30).plusHours(2).plusDays(56);
        text.add("Range: " + DateUtils.formatDateRange(this, start, end, 0));
        text.add("Range (with year): " + DateUtils.formatDateRange(this, start, end, DateUtils.FORMAT_SHOW_YEAR));
        text.add("Range (abbreviated): " + DateUtils.formatDateRange(this, start, end, DateUtils.FORMAT_ABBREV_ALL));
        text.add("Range (with time): " + DateUtils.formatDateRange(this, start, end, DateUtils.FORMAT_SHOW_TIME));
        addSample("DateUtils.formatDateRange()", text);
    }
591276
@Override
    public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
        internalStmt.setTimestamp(parameterIndex, x);
    }
493865
def at_time(self, time, nearest_sample=False):
        
        if nearest_sample:
            time += self.delta_t / 2.0
        return self[int((time-self.start_time)*self.sample_rate)]
142075
def _AddAttributeToCache(self, attribute_name, value, cache):
    """"""
    # If there's another value in cache with the same timestamp, the last added
    # one takes precedence. This helps a lot in tests that use FakeTime.
    attribute_list = cache.setdefault(attribute_name, [])
    if attribute_list and attribute_list[-1].age == value.age:
      attribute_list.pop()

    attribute_list.append(value)
1338502
function(buttonInfo, pointerId, timeStamp) {
      if (!buttonInfo.pointerIds[pointerId]) {
        buttonInfo.pointerIds[pointerId] = timeStamp;
        ++buttonInfo.numPointerIds;
        buttonInfo.callback({pressed: true});
      }
    }
1248678
def set_timestamp(cls, filename: str, response: HTTPResponse):
        '''
        '''
        last_modified = response.fields.get('Last-Modified')

        if not last_modified:
            return

        try:
            last_modified = email.utils.parsedate(last_modified)
        except ValueError:
            _logger.exception('Failed to parse date.')
            return

        last_modified = time.mktime(last_modified)

        os.utime(filename, (time.time(), last_modified))
1192386
def set_preserver_info(self, sample):
        
        if sample.getPreserver() and sample.getDatePreserved():
            # Preserver and Date Preserved already set. This is correct
            return True
        preserver = self.get_form_value("Preserver", sample,
                                        sample.getPreserver())
        preserved = self.get_form_value("getDatePreserved",
                                        sample.getDatePreserved())
        if not all([preserver, preserved]):
            return False
        sample.setPreserver(preserver)
        sample.setDatePreserver(DateTime(preserved))
        return True
102095
def interpolate_timestamp(capture_times):
    '''
    
    '''
    timestamps = []
    num_file = len(capture_times)

    time_dict = OrderedDict()

    if num_file < 2:
        return capture_times

    # trace identical timestamps (always assume capture_times is sorted)
    time_dict = OrderedDict()
    for i, t in enumerate(capture_times):
        if t not in time_dict:
            time_dict[t] = {
                "count": 0,
                "pointer": 0
            }

            interval = 0
            if i != 0:
                interval = (t - capture_times[i - 1]).total_seconds()
                time_dict[capture_times[i - 1]]["interval"] = interval

        time_dict[t]["count"] += 1

    if len(time_dict) >= 2:
        # set time interval as the last available time interval
        time_dict[time_dict.keys()[-1]
                  ]["interval"] = time_dict[time_dict.keys()[-2]]["interval"]
    else:
        # set time interval assuming capture interval is 1 second
        time_dict[time_dict.keys()[0]]["interval"] = time_dict[time_dict.keys()[
            0]]["count"] * 1.

    # interpolate timestamps
    for t in capture_times:
        d = time_dict[t]
        s = datetime.timedelta(
            seconds=d["pointer"] * d["interval"] / float(d["count"]))
        updated_time = t + s
        time_dict[t]["pointer"] += 1
        timestamps.append(updated_time)

    return timestamps
878142
function getTimestamps() {
					try {
						var trans = db.transaction(['save'], "read"),
						store = trans.objectStore('save'),
						request = store.getAll();
						request.onsuccess = function (e) {
							var i = 0, a = event.target.result, l = a.length;
							for (; i < l; i++) {
								timestamps[a[i].key] = a[i].timestamp;
							}
						};
					}
					catch (e) {
					}
				}
700276
def set_printed_time(self, sample):
        
        if api.get_workflow_status_of(sample) != "published":
            return False
        reports = sample.objectValues("ARReport")
        reports = sorted(reports, key=lambda report: report.getDatePublished())
        last_report = reports[-1]
        if not last_report.getDatePrinted():
            last_report.setDatePrinted(DateTime())
            sample.reindexObject(idxs=["getPrinted"])
        return True
88754
void addSample(StopwatchSample sample) {
		total += sample.getTotal();
		counter += sample.getCounter();

		if (min > sample.getMin()) {
			min = sample.getMin();
			minTimestamp = sample.getMinTimestamp();
		}

		if (max < sample.getMax()) {
			max = sample.getMax();
			maxTimestamp = sample.getMaxTimestamp();
		}

		active += sample.getActive();

		if (maxActive < sample.getMaxActive()) {
			maxActive = sample.getMaxActive();
			maxActiveTimestamp = sample.getMaxActiveTimestamp();
		}
	}
1005273
@SuppressWarnings("HiddenField")
  public BaseWindowedBolt withTimestampExtractor(TimestampExtractor timestampExtractor) {
    if (this.timestampExtractor != null) {
      throw new IllegalArgumentException(
          "Window is already configured with a timestamp extractor: " + timestampExtractor);
    }

    this.timestampExtractor = new org.apache.heron.api.windowing.TimestampExtractor() {

      @Override
      public long extractTimestamp(Tuple tuple) {
        return timestampExtractor.extractTimestamp(new TupleImpl(tuple));
      }
    };
    return this;
  }
688846
function TimeStamp(timestamp) {
    tr.b.u.Scalar.call(this, timestamp, tr.b.u.Units.timeStampInMs);
  }
538532
def set_timestamp(self,timestamp=None):
        
        if timestamp is None:
            import time
            timestamp = time.strftime('%Y-%m-%dT%H:%M:%S%Z')
        self.node.set('timestamp',timestamp)
399039
def _set_timestamps_on_attach(self, record, exists=False):
        
        fresh = self._parent.fresh_timestamp()

        if not exists and self._has_pivot_column(self.created_at()):
            record[self.created_at()] = fresh

        if self._has_pivot_column(self.updated_at()):
            record[self.updated_at()] = fresh

        return record
851350
def apply_persistence_timestamps
      self.updated_at   = Time.now if self.class.attribute_names.include?(:updated_at)
      self.created_at ||= Time.now if self.class.attribute_names.include?(:created_at)
    end