Add information about a new step to the dict of steps
        The value 'ptime' is the output from '_ptime()' containing
        both the formatted and unformatted time for the start of the
        step.
179763
def addStep(self,key):
        
        ptime = _ptime()
        print('==== Processing Step ',key,' started at ',ptime[0])
        self.steps[key] = {'start':ptime}
        self.order.append(key)
1309422
def psetex(self, key, time, value):
        
        return self.set(key, value, px=time)
988310
def add_step(self, step, step_id):
        
        assert step_id not in self._steps
        assert step_id not in self._order
        assert isinstance(step, Step)

        self._steps[step_id] = step
        self._order.append(step_id)
100226
def _trigger(self):
        
        if len(self._stat_now):
            self._stat_now['epoch_num'] = self.epoch_num
            self._stat_now['global_step'] = self.global_step

            self._stats.append(self._stat_now)
            self._stat_now = {}
            self._write_stat()
1223539
def T(t, step=30):
    
    if hasattr(t, 'timestamp'):
        timestamp = t.timestamp()
    else:
        # python 2
        if t.tzinfo is None:
            timestamp = time.mktime(t.timetuple())
        else:
            utc_naive  = t.replace(tzinfo=None) - t.utcoffset()
            timestamp = (utc_naive - datetime.datetime(1970, 1, 1)).total_seconds()

    return int(timestamp) // step
21399
public void add(Object pObject, long pTime) {
        values.addFirst(new ValueEntry(pObject,pTime));
        trim();
    }
48160
private synchronized void add(long pTime,String message) {
        debugEntries.addFirst(new Entry(pTime,message));
        trim();
    }
303361
def step(self, step, total, label='STEP', speed_label='STEPS/S', size=1):
        

        self.lock.acquire()
        try:
            time_diff = time.time() - self.last_step_time

            if self.last_step > step:
                # it restarted
                self.last_step = 0

            made_steps_since_last_call = step - self.last_step
            self.last_step = step

            self.made_steps_since_last_sync += made_steps_since_last_call
            self.made_steps_size_since_last_sync += made_steps_since_last_call * size

            if time_diff >= 1 or step == total:  # only each second or last batch
                self.set_system_info('step', step, True)
                self.set_system_info('steps', total, True)

                steps_per_second = self.made_steps_since_last_sync / time_diff
                samples_per_second = self.made_steps_size_since_last_sync / time_diff
                self.last_step_time = time.time()

                if size:
                    self.report_speed(samples_per_second)

                epochs_per_second = steps_per_second / total  # all batches
                self.set_system_info('epochsPerSecond', epochs_per_second, True)

                current_epochs = self.current_epoch if self.current_epoch else 1
                total_epochs = self.total_epochs if self.total_epochs else 1

                self.made_steps_since_last_sync = 0
                self.made_steps_size_since_last_sync = 0

                eta = 0
                if step < total:
                    # time to end this epoch
                    if steps_per_second != 0:
                        eta = (total - step) / steps_per_second

                # time until all epochs are done
                if total_epochs - current_epochs > 0:
                    if epochs_per_second != 0:
                        eta += (total_epochs - (current_epochs)) / epochs_per_second

                self.git.store_file('aetros/job/times/eta.json', simplejson.dumps(eta))

            if label and self.step_label != label:
                self.set_system_info('stepLabel', label, True)
                self.step_label = label

            if speed_label and self.step_speed_label != speed_label:
                self.set_system_info('stepSpeedLabel', speed_label, True)
                self.step_speed_label = speed_label
        finally:
            self.lock.release()
848112
def extend(self, step):
        
        self.timesteps.extend(step.timesteps)
        self.masks.extend(step.masks)
        self.x.extend(step.x)
        self.y.extend(step.y)
        self.i.extend(step.i)
        self.j.extend(step.j)
        self.end_time = step.end_time
        self.times = np.arange(self.start_time, self.end_time + self.step, self.step)
        self.u = np.concatenate((self.u, step.u))
        self.v = np.concatenate((self.v, step.v))
        for attr in self.attributes.keys():
            if attr in step.attributes.keys():
                self.attributes[attr].extend(step.attributes[attr])
1364304
def add_data(self, path, time_info, data, exprs):
        
        # Dont add if empty
        if not nonempty(data):
            for d in self.data[path]:
                if nonempty(d['values']):
                    return

        # Add data to path
        for expr in exprs:
            self.paths[expr].add(path)
        self.data[path].append({
            'time_info': time_info,
            'values': data
        })
949797
def _add_result(self, dict_entry, entry, dt, start_time):
    
    time_entry = {}
    time_entry['dt'] = dt
    time_entry['start_time'] = start_time
    dict_entry[entry] = time_entry
765783
def add_interval(self, precision=0):
        
        precision = precision or self.precision
        interval = round((self._stop - self._start), precision)
        self.intervals.append(interval)
        self._intervals_len += 1
        self._start = time.perf_counter()
        return self.format_time(interval)
105769
def add_date_time_original(self, date_time, time_format='%Y:%m:%d %H:%M:%S.%f'):
        """"""
        try:
            DateTimeOriginal = date_time.strftime(time_format)[:-3]
            self._ef['Exif'][piexif.ExifIFD.DateTimeOriginal] = DateTimeOriginal
        except Exception as e:
            print_error("Error writing DateTimeOriginal, due to " + str(e))
1044842
def format_step(step, zero_prefix=False):
    """"""
    if isinstance(step, int):
        return "{:06}".format(step) if zero_prefix else "{}".format(step)
    elif isinstance(step, tuple):
        return "{:04}:{:06}".format(*step) if zero_prefix else "{}:{}".format(*step)
938480
def add_fast_step(self, fastsim):
        
        for wire_name in self.trace:
            self.trace[wire_name].append(fastsim.context[wire_name])
431796
function _stepdate( &$date, &$timestamp, $step=array( 'day' => 1 )) {
    foreach( $step as $stepix => $stepvalue )
      $date[$stepix] += $stepvalue;
    $timestamp  = $this->_date2timestamp( $date );
    $date       = $this->_date_time_string( date('Y-m-d H:i:s', $timestamp ), 6);
    foreach( $date as $k => $v ) {
      if( ctype_digit( $v ))
        $date[$k] = (int) $v;
    }
  }
1078472
def add_time(self, extra_time):
        """"""
        window_start = self.parent.value('window_start') + extra_time
        self.parent.overview.update_position(window_start)