Get actual ttl in seconds.

        :return: actual ttl.
        :rtype: float
346682
def ttl(self):
        

        # result is self ts
        result = getattr(self, Annotation.__TS, None)
        # if result is not None
        if result is not None:
            # result is now - result
            now = time()
            result = result - now

        return result
977587
def utcoffset(self):
        

        if self.tzinfo is None:
            return None
        return self.tzinfo.utcoffset(self.replace(year=2000))
138046
def to_timestamp(dt):
    
    if isinstance(dt, int):
        return dt
    return int(total_seconds(dt.replace(tzinfo=None) -
               datetime.datetime(1970, 1, 1)))
47835
def check_ttl_max_tries(tries, enqueued_at, max_tries, ttl):
    ''''''
    if max_tries > 0 and tries >= max_tries:
        raise FSQMaxTriesError(errno.EINTR, u'Max tries exceded:'\
                               u' {0} ({1})'.format(max_tries, tries))
    if ttl > 0 and datetime.datetime.now() < enqueued_at + datetime.timedelta(
            seconds=ttl):
        raise FSQTTLExpiredError(errno.EINTR, u'TTL Expired:'\
                                 u' {0}'.format(ttl))
906375
def GetPlasoTimestamp(self):
    
    normalized_timestamp = self._GetNormalizedTimestamp()
    if normalized_timestamp is None:
      return None

    normalized_timestamp *= definitions.MICROSECONDS_PER_SECOND
    normalized_timestamp = normalized_timestamp.quantize(
        1, rounding=decimal.ROUND_HALF_UP)
    return int(normalized_timestamp)
920409
def _timedelta_total_seconds(td):
    
    if hasattr(timedelta, "total_seconds"):
        return getattr(td, "total_seconds")()

    # Python 2.6 backward compatibility
    return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / float(10**6)
906369
def _get_earliest_valid_timestamp(self, symbol, interval):
        
        kline = self.get_klines(
            symbol=symbol,
            interval=interval,
            limit=1,
            startTime=0,
            endTime=None
        )
        return kline[0][0]
400092
public long
getTTL() throws IOException {
	String next = _getIdentifier("a TTL value");
	try {
		return TTL.parseTTL(next);
	}
	catch (NumberFormatException e) {
		throw exception("expected a TTL value");
	}
}
1359667
def timestamp(self):
        ""
        if self._tzinfo is None:
            return _time.mktime((self.year, self.month, self.day,
                                 self.hour, self.minute, self.second,
                                 -1, -1, -1)) + self.microsecond / 1e6
        else:
            return (self - _EPOCH).total_seconds()
1331689
def seconds(self):
        
        seconds = self.elapsed().seconds
        if self.limit() and self.countdown():
            seconds = (self.limit() - self.elapsed().seconds)
        return (seconds % 3600) % 60
699013
def ToMilliseconds(self):
    """"""
    millis = _RoundTowardZero(self.nanos, _NANOS_PER_MILLISECOND)
    return self.seconds * _MILLIS_PER_SECOND + millis
1245322
def tau0_from_mtotal_eta(mtotal, eta, f_lower):
    
    """
    # convert to seconds
    mtotal = mtotal * lal.MTSUN_SI
    # formulae from arxiv.org:0706.4437
    return _a0(f_lower) / (mtotal**(5./3.) * eta)
717027
def get_seconds_until_next_quarter(now=None):
    
    if now is None:
        now = arrow.utcnow()
    return 899 - (now - now.replace(minute=(now.minute // 15) * 15, second=0, microsecond=0)).seconds
1041897
def total_seconds(delta):
    
    try:
        return delta.total_seconds()
    except AttributeError:
        return ((delta.days * 24 * 3600) + delta.seconds +
                float(delta.microseconds) / (10 ** 6))
112460
def setTraceTimeToLive(self, trace_id, ttl_seconds):
    
    self.send_setTraceTimeToLive(trace_id, ttl_seconds)
    self.recv_setTraceTimeToLive()
147973
def getUTC(self, utcoffset):
        
        newTime = (self.value - utcoffset.value) % 24
        return Time(newTime)
387211
def set_pttl(self, key, ttl):
        
        return self._client.pexpire(self.get_key(key), ttl)