Record a status change with a current timestamp.
482569
def update_status(self, new_status):
        """"""
        timestamp = time.time()
        self.status_history[-1]["end"] = timestamp
        self.status_history.append(
            {"start": timestamp, "end": None, "status": new_status}
        )
1221682
def set_status(self, value):
        
        if not self._status == value:
            old = self._status
            self._status = value
            logger.info("{} changing status from {} to {}".format(self, old.name, value.name))
            self._statusChanged(old, value)
569376
def print_status(self):
        """"""
        tweets = self.received
        now = time.time()
        diff = now - self.since
        self.since = now
        self.received = 0
        if diff > 0:
            logger.info("Receiving tweets at %s tps", tweets / diff)
385349
def handleStatus(self, version, status, message):
        """"""

        self.status = status
        self.message = message
441073
def _process_status(self, status):
        
        self._screen_id = status.get(ATTR_SCREEN_ID)
        self.status_update_event.set()
1213956
def updateDeviceStatus(self, deviceName, state, reason=None):
        
        logger.info('Updating recording device state for ' + deviceName + ' to ' + state.name +
                    ('' if reason is None else '[reason: ' + reason + ']'))
        currentState = self.recordingDevices.get(deviceName)
        count = 0
        if currentState is not None:
            if currentState['state'] == MeasurementStatus.RECORDING.name:
                count = currentState['count']
        self.recordingDevices[deviceName] = {
            'state': state.name,
            'reason': reason,
            'time': datetime.datetime.utcnow().strftime(DATETIME_FORMAT),
            'count': count
        }
645390
def start_timestamp(self):
    """"""
    if self.event_timestamp:
      return self.event_timestamp - (
          self.duration * self._MICRO_SECONDS_PER_MINUTE)

    return None
273821
def set_status(self, status: Status, increment_try_count: bool=True,
                   filename: str=None):
        '''
        '''
        url = self.url_record.url
        assert not self._try_count_incremented, (url, status)

        if increment_try_count:
            self._try_count_incremented = True

        _logger.debug(__('Marking URL {0} status {1}.', url, status))

        url_result = URLResult()
        url_result.filename = filename

        self.app_session.factory['URLTable'].check_in(
            url,
            status,
            increment_try_count=increment_try_count,
            url_result=url_result,
        )

        self._processed = True
553738
function recordTiming (name, timing) {
  recorder[name] = parseInt(timing, 10) || Date.now()
  performanceEvent.trigger('update', getTiming())
}
660305
def _record_last_active(self, host):
        
        if host in self.hosts:  # this check is for when user passes a host at request time
            # Keep this thread safe: set hosts atomically and update it before the timestamp
            self.hosts = [host] + [h for h in self.hosts if h != host]
            self._last_time_recorded_active = time.time()
428157
def record(self, timestamp, *args, **kwargs):
        
        if self.output_file is None:
            return

        data = {'datetime': timestamp}

        # append all data
        if len(args) == 1:
            if isinstance(args[0], dict):
                data.update(dict(args[0]))
            elif isinstance(args[0], pd.DataFrame):
                data.update(args[0][-1:].to_dict(orient='records')[0])

        # add kwargs
        if kwargs:
            data.update(dict(kwargs))

        data['datetime'] = timestamp
        # self.rows.append(pd.DataFrame(data=data, index=[timestamp]))

        new_data = {}
        if "symbol" not in data.keys():
            new_data = dict(data)
        else:
            sym = data["symbol"]
            new_data["symbol"] = data["symbol"]
            for key in data.keys():
                if key not in ['datetime', 'symbol_group', 'asset_class']:
                    new_data[sym + '_' + str(key).upper()] = data[key]

        new_data['datetime'] = timestamp

        # append to rows
        self.rows.append(pd.DataFrame(data=new_data, index=[timestamp]))

        # create dataframe
        recorded = pd.concat(self.rows, sort=True)

        if "symbol" not in recorded.columns:
            return


        # group by symbol
        recorded['datetime'] = recorded.index
        data = recorded.groupby(['symbol', 'datetime'], as_index=False).sum()
        data.set_index('datetime', inplace=True)

        symbols = data['symbol'].unique().tolist()
        data.drop(columns=['symbol'], inplace=True)


        # cleanup:

        # remove symbols
        recorded.drop(['symbol'] + [sym + '_SYMBOL' for sym in symbols],
                      axis=1, inplace=True)

        # remove non-option data if not working with options
        for sym in symbols:
            try:
                opt_cols = recorded.columns[
                    recorded.columns.str.startswith(sym + '_OPT_')].tolist()
                if len(opt_cols) == len(recorded[opt_cols].isnull().all()):
                    recorded.drop(opt_cols, axis=1, inplace=True)
            except Exception as e:
                pass

        # group df
        recorded = recorded.groupby(recorded['datetime']).first()

        # shift position
        for sym in symbols:
            recorded[sym + '_POSITION'] = recorded[sym + '_POSITION'
                                                   ].shift(1).fillna(0)

        # make this public
        self.recorded = recorded.copy()

        # cleanup columns names before saving...
        recorded.columns = [col.replace('_FUT_', '_').replace(
                            '_OPT_OPT_', '_OPT_') for col in recorded.columns]

        # save
        if ".csv" in self.output_file:
            recorded.to_csv(self.output_file)
        elif ".h5" in self.output_file:
            recorded.to_hdf(self.output_file, 0)
        elif (".pickle" in self.output_file) | (".pkl" in self.output_file):
            recorded.to_pickle(self.output_file)

        chmod(self.output_file)
1056752
def OnTableChanged(self, event):
        """"""

        if hasattr(event, 'updated_cell'):
            # Event posted by cell edit widget.  Even more up to date
            #  than the current cell's contents
            self.ignore_changes = True
            try:
                self.SetValue(event.updated_cell)

            except TypeError:
                # None instead of string present
                pass
            self.ignore_changes = False

        else:
            current_cell = self.main_window.grid.actions.cursor
            current_cell_code = self.main_window.grid.code_array(current_cell)

            if current_cell_code is None:
                self.SetValue(u"")
            else:
                self.SetValue(current_cell_code)

        event.Skip()
511690
function(evt) {
    if (evt !== 'change' && evt !== 'rename') {
      return;
    }
    fs.stat(file, function(err, current) {
      if (err) {
        self.logger_.error(err.message);
        self.emit('error.watch', err.message);
        return;
      }
      if (current.size !== prev.size || +current.mtime > +prev.mtime) {
        prev = current; // save new stats
        self.logger_.debug(util.format('%s has been modified', file));
        self.emit('watch');
      }
    });
  }
95827
def update_status(self, header, message):
        """"""
        with self._lock:
            if self.message_box:
                self.message_box.erase()
                self.message_box.move(0, 0)
                for n, field in enumerate(header):
                    if n == 0:
                        self.message_box.addstr(field + ":", curses.color_pair(1))
                    else:
                        self.message_box.addstr(
                            ", " + field + ":", curses.color_pair(1)
                        )
                    self.message_box.addstr(header[field])
                self.message_box.addstr(": ", curses.color_pair(1))
                self.message_box.addstr(
                    str(message), curses.color_pair(2) + curses.A_BOLD
                )
                self.message_box.refresh()
            if (
                message["host"] not in self._node_status
                or int(header["timestamp"])
                >= self._node_status[message["host"]]["last_seen"]
            ):
                self._node_status[message["host"]] = message
                self._node_status[message["host"]]["last_seen"] = int(
                    header["timestamp"]
                )
622297
def record(self, custom_changeset_id: uuid.UUID = None) -> uuid.UUID:
        
        return self.journal.record_changeset(custom_changeset_id)
940719
def _write_status_to_log(self, return_code, stream=sys.stdout):
        """"""
        stream.write("Timestamp: %i\n" % get_timestamp())
        if return_code == 0:
            stream.write("%s\n" % self._interface.string_successful)
        else:
            stream.write("%s %i\n" %
                         (self._interface.string_exited, return_code))
1134916
def set_status(self, status):
        
        if status is not self.status:
            logger.debug("Setting %s state to %s.", self.stack.name,
                         status.name)
            self.status = status
            self.last_updated = time.time()
            if self.stack.logging:
                log_step(self)