If @timestamp is true, try a default timestamp name
331235
def default_timestamp_name(obj, next_state)
      at_name = "#{next_state}_at"
      on_name = "#{next_state}_on"
      case
      when obj.respond_to?(at_name) then at_name
      when obj.respond_to?(on_name) then on_name
      else
        fail NoMethodError, "Couldn't find a suitable timestamp field for event: #{@name}.
          Please define #{at_name} or #{on_name} in #{obj.class}"
      end
    end
598718
def timestamp
      if File.exist?(name)
        File.mtime(name.to_s)
      else
        Rake::LATE
      end
    end
1081914
def timestamp(self, name, value):
        
        for counter in self._counters:
            counter.timestamp(name, value)
886852
def timestamp(self, name="<block>"):
        """"""
        # Make a fake function
        func = lambda x: x
        func.__module__ = ""
        func.__name__ = name
        self.add_function(func)
        timestamps = []
        self.functions[func].append(timestamps)
        # A new object is required each time, since there can be several
        # nested context managers.
        return _TimeStamperCM(timestamps)
1346348
def ts2dt(ts, milli=False, tz_aware=False):
    '''  '''
    # anything already a datetime will still be returned
    # tz_aware, if set to true
    is_true(HAS_DATEUTIL, "`pip install python_dateutil` required")
    if isinstance(ts, (datetime, date)):
        pass
    elif is_empty(ts, except_=False):
        return None  # its not a timestamp
    elif isinstance(ts, (int, float, long)) and ts < 0:
        return None
    elif isinstance(ts, basestring):
        try:
            ts = float(ts)
        except (TypeError, ValueError):
            # maybe we have a date like string already?
            try:
                ts = dt_parse(ts)
            except Exception:
                raise TypeError(
                    "unable to derive datetime from timestamp string: %s" % ts)
    elif milli:
        ts = float(ts) / 1000.  # convert milli to seconds
    else:
        ts = float(ts)  # already in seconds
    return _get_datetime(ts, tz_aware)
942893
def parse_timestamp(timestamp):
    """"""
    dt = dateutil.parser.parse(timestamp)
    return dt.astimezone(dateutil.tz.tzutc())
410884
def timestamp(self, name, value):
        
        counter = self.get(name, CounterType.Timestamp)
        counter.time = value if value != None else datetime.datetime.utcnow()
        self._update()
1228272
def _encode_timestamp(name, value, dummy0, dummy1):
    """"""
    return b"\x11" + name + _PACK_TIMESTAMP(value.inc, value.time)
1286636
def timestamps(self, use_current=True):
        
        if use_current:
            self.timestamp("created_at").use_current()
            self.timestamp("updated_at").use_current()
        else:
            self.timestamp("created_at")
            self.timestamp("updated_at")
387951
function validTimestamp(timestamp) {
    // ^year-month-day(Thour:min:secms?timezone)?$
    var year = /((?:[1-9][0-9]*)?[0-9]{4})/,
        month = /(1[0-2]|0[1-9])/,
        day = /(3[01]|0[1-9]|[12][0-9])/,
        hour = /(2[0-3]|[01][0-9])/,
        minute = /([0-5][0-9])/,
        second = /([0-5][0-9])/,
        ms = /(\.[0-9]+)/,
        timezone = /(Z|[+\-](?:2[0-3]|[01][0-9]):[0-5][0-9])/,
        date = [year.source, month.source, day.source].join('-'),
        time = [hour.source, minute.source, second.source].join(':'),
        timestampRegex,
        result;

    timestampRegex = new RegExp(
        '^' + date + '(T' + time + ms.source + '?' + timezone.source + ')?$'
    );

    result = timestampRegex.exec(timestamp);

    return result !== null;
}
234396
def timestamp_to_datetime(cls, time_stamp, localized=True):
        
        ret = datetime.datetime.utcfromtimestamp(time_stamp)
        if localized:
            ret = localize(ret, pytz.utc)
        return ret
448817
public static boolean isUnixTimeStamp(String timeStamp) {
    if (timeStamp.length() != ComplianceConfigurationKeys.TIME_STAMP_LENGTH) {
      return false;
    }
    try {
      Long.parseLong(timeStamp);
      return true;
    } catch (NumberFormatException e) {
      return false;
    }
  }
160400
function setTimestamp( $name, $value )
    {
        $this->Timestamps[$name] = $value;
        $this->IsModified = true;
    }
771477
def execute_cast_simple_literal_to_timestamp(op, data, type, **kwargs):
    """"""
    return pd.Timestamp(data, tz=type.timezone)
55363
def timestamp
      if File.exist?(name)
        File.mtime(name.to_s)
      else
        Rake::EARLY
      end
    end
870330
function getTimestamp(rawTx) {
  const timestamp = get(
    rawTx,
    ['meta', 'metronome', 'export', 'blockTimestamp'],
    null
  )
  return timestamp ? Number(timestamp) : null
}
1113120
def date_matches(self, timestamp):
        """"""
        if self.date is None:
            return False

        timestamp = datetime.fromtimestamp(float(timestamp), self.timezone)
        if self.date.date() == timestamp.date():
            return True

        return False