Sets the time delta for this widget to the inputed delta.
        
        :param      delta | <datetime.timedelta>
975660
def setDelta(self, delta):
        
        days = int(delta.days)
        secs = int(delta.total_seconds())
        
        direction = 'from now'
        if secs < 0:
            direction = 'ago'
        
        if days and days % 365 == 0:
            number = days / 365
            unit = 'year(s)'
        elif days and days % 30 == 0:
            number = days / 30
            unit = 'month(s)'
        elif days and days % 7 == 0:
            number = days / 7
            unit = 'week(s)'
        elif days:
            number = days
            unit = 'day(s)'
        elif secs % 3600 == 0:
            number = secs / 3600
            unit = 'hour(s)'
        elif secs % 60 == 0:
            number = secs / 60
            unit = 'minute(s)'
        else:
            number = secs
            unit = 'second(s)'
        
        self._numberSpinner.setValue(abs(int(number)))
        self._unitCombo.setCurrentIndex(self._unitCombo.findText(unit))
        index = self._directionCombo.findText(direction)
        self._directionCombo.setCurrentIndex(index)
1338409
def advance_time_delta(timedelta):
    """"""
    assert(utcnow.override_time is not None)
    try:
        for dt in utcnow.override_time:
            dt += timedelta
    except TypeError:
        utcnow.override_time += timedelta
432717
public void plusNanoSeconds(long delta)
    {
        if (delta != 0)
        {
            long result = getNanoSecond() + delta;
            setNanoSecond((int) Math.floorMod(result, 1000000000));
            plusSeconds(Math.floorDiv(result, 1000000000));
        }
    }
110030
def _add_timedelta(self, delta):
        
        if isinstance(delta, pendulum.Duration):
            return self.add(
                years=delta.years,
                months=delta.months,
                weeks=delta.weeks,
                days=delta.remaining_days,
            )

        return self.add(days=delta.days)
1041897
def total_seconds(delta):
    
    try:
        return delta.total_seconds()
    except AttributeError:
        return ((delta.days * 24 * 3600) + delta.seconds +
                float(delta.microseconds) / (10 ** 6))
651450
def gen_time_intervals(start, end, delta):
    
    curr = start
    while curr < end:
        yield curr
        curr += delta
349150
def format_delta(__timedelta: datetime.timedelta) -> str:
    
    if __timedelta == datetime.timedelta(0):
        return ''
    days_s = '{}D'.format(__timedelta.days) if __timedelta.days else ''
    hours, minutes = divmod(__timedelta.seconds, 3600)
    minutes, seconds = divmod(minutes, 60)
    hours_s = '{:02d}H'.format(hours) if hours else ''
    minutes_s = '{:02d}M'.format(minutes) if minutes else ''
    seconds_s = '{:02d}S'.format(seconds) if seconds else ''
    return 'P{}{}{}{}{}'.format(days_s,
                                'T' if hours or minutes or seconds else '',
                                hours_s, minutes_s, seconds_s)
1260951
def update(self, time_delta):
        
        self.control.update(self, time_delta)
        for object in self.objects:
            object.update(time_delta)
            # object.sprite.last_position = object.sprite.position
            # object.sprite.last_velocity = object.sprite.velocity

        # for group in self:
        for controller in self.controllers:
            controller(time_delta, self)
818515
public void deltaTotalPoolTime(long delta)
   {
      if (enabled.get() && delta > 0)
      {
         totalPoolTime.addAndGet(delta);
         totalPoolTimeInvocations.incrementAndGet();

         if (delta > maxPoolTime.get())
            maxPoolTime.set(delta);
      }
   }
907868
def _add_timedeltalike_scalar(self, other):
        
        if isna(other):
            # i.e np.timedelta64("NaT"), not recognized by delta_to_nanoseconds
            new_values = np.empty(len(self), dtype='i8')
            new_values[:] = iNaT
            return new_values

        inc = delta_to_nanoseconds(other)
        new_values = checked_add_with_arr(self.asi8, inc,
                                          arr_mask=self._isnan).view('i8')
        new_values = self._maybe_mask_results(new_values)
        return new_values.view('i8')
143181
def parse_timedelta(__delta: str) -> datetime.timedelta:
    
    match = re.fullmatch(r"""
            ^(\d+(?:|\.\d+))  # value, possibly float
            \ *
            ([hdwmy])$  # units
         """, __delta, re.IGNORECASE | re.VERBOSE)
    if not match:
        raise ValueError('Invalid ‘frequency’ value')
    value, units = match.groups()
    units_i = 'hdwmy'.index(units.lower())
    # hours per hour/day/week/month/year
    multiplier = (1, 24, 168, 672, 8760)
    return datetime.timedelta(hours=float(value) * multiplier[units_i])
970342
def apply(self,vbase,deltas,utc=None):
    ""
    if vbase!=len(self.increments): raise BadBaseV(vbase,len(self.increments))
    if not all(isinstance(d,diff.Delta) for d in deltas): raise TypeError('not_delta')
    utc=utc or misc.utcnow()
    # note: intentionally *not* checking that utc is monotonic because I don't want clock drift to ruin life
    reduce(apply_splice,deltas,self.generate()) # i.e. if this fails we have a problem
    return VDList(self.increments+[Increment(utc,deltas)])
883766
def delta(self):
        """"""
        end_time = self.end_time if self.end_time else dt.datetime.now()
        return end_time - self.start_time
296430
def settime(self, time):
        
        if isinstance(time, datetime) or isinstance(time,
                                                             datetime.date):
            seconds = int(time.strftime("%s"))
        elif isinstance(time, int):
            seconds = time
        else:
            raise TypeError("datetime.date, datetime.datetime or integer " +
                            "is required as time argument")
        raise NotImplementedError
1179963
def set_datetime(self, section, option, value):
        
        self[section][option] = value.strftime(self.DATETIME_FMT)
400472
def _set_time(self, time):
        
        if len(self.time) == 0 :
            self.time = np.array(time)
            if self.h5 is not None:
                self.h5.create_dataset('time', self.time.shape, dtype=self.time.dtype, data=self.time, compression="gzip", shuffle=True, scaleoffset=3)
        else:
            if(len(time) != len(self.time)):
                raise AssertionError("\nTime or number of frame mismatch in input files.\n Exiting...\n")
998809
def fmt_delta(timestamp):
    
    try:
        return fmt.human_duration(float(timestamp), precision=2, short=True)
    except (ValueError, TypeError):
        return "N/A".rjust(len(fmt.human_duration(0, precision=2, short=True)))