Extends expiration time of the lock.

        :param expire:
            New expiration time. If ``None`` - `expire` provided during
            lock initialization will be taken.
171552
def extend(self, expire=None):
        
        if expire is None:
            if self._expire is not None:
                expire = self._expire
            else:
                raise TypeError(
                    "To extend a lock 'expire' must be provided as an "
                    "argument to extend() method or at initialization time."
                )
        error = _eval_script(self._client, EXTEND, self._name, args=(expire, self._id))
        if error == 1:
            raise NotAcquired("Lock %s is not acquired or it already expired." % self._name)
        elif error == 2:
            raise NotExpirable("Lock %s has no assigned expiration time" %
                               self._name)
        elif error:
            raise RuntimeError("Unsupported error code %s from EXTEND script" % error)
1306730
def expiration_time(self):
        
        logging_forgotten_time = configuration.behavior.login_forgotten_seconds

        if logging_forgotten_time <= 0:
            return None

        now = timezone.now()
        delta = now - self.modified
        time_remaining = logging_forgotten_time - delta.seconds

        return time_remaining
824766
def _expire_data(self):
        
        expire_time_stamp = time.time() - self.expire_time
        self.timed_data   = {d: t for d, t in self.timed_data.items()
                             if t > expire_time_stamp}
201222
def do_expire(self):
        
        # Deep copy to avoid RuntimeError: dictionary changed size during iteration
        _timeouts = deepcopy(self.timeouts)
        for key, value in _timeouts.items():
            if value - self.clock.now() < timedelta(0):
                del self.timeouts[key]
                # removing the expired key
                if key in self.redis:
                    self.redis.pop(key, None)
1191788
async def expire(self, name, time):
        
        if isinstance(time, datetime.timedelta):
            time = time.seconds + time.days * 24 * 3600
        return await self.execute_command('EXPIRE', name, time)
504253
public void setExpirationTime(long expirationTime) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  expirationTimeFlag = SET;
	  this.expirationTime = expirationTime;
	  this.timeLimit = (int) ((expirationTime - System.currentTimeMillis()) / 1000L);
   }
310300
public void deleteExpired(Date expiration, Class entityType, String entityKey)
            throws LockingException {
        Connection conn = null;
        try {
            conn = RDBMServices.getConnection();
            primDeleteExpired(expiration, entityType, entityKey, conn);
        } catch (SQLException sqle) {
            throw new LockingException("Problem deleting expired locks", sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }
    }
974508
public ColumnPrefixDistributedRowLock<K> expireLockAfter(long timeout, TimeUnit unit) {
        this.timeout      = timeout;
        this.timeoutUnits = unit;
        return this;
    }
629641
@GuardedBy("evictionLock")
  void expireAfterAccessEntries(AccessOrderDeque<Node<K, V>> accessOrderDeque, long now) {
    long duration = expiresAfterAccessNanos();
    for (;;) {
      Node<K, V> node = accessOrderDeque.peekFirst();
      if ((node == null) || ((now - node.getAccessTime()) < duration)) {
        return;
      }
      evictEntry(node, RemovalCause.EXPIRED, now);
    }
  }
611187
def expire_at(self, _time):
        
        return self._client.expireat(self.key_prefix, round(_time))
1072484
def get_expiration(self):
        
        exp = self._get_int('expiration')
        if exp is not None:
            return datetime.datetime.fromtimestamp(
                exp
            )
        return None
1350593
def expires_in(self):
        
        time_left = self.expires_at - int(time.time())

        if time_left > 0:
            return time_left
        return 0
1374621
def Expire(self):
    """"""
    while len(self._age) > self._limit:
      node = self._age.PopLeft()
      self._hash.pop(node.key, None)
      self.KillObject(node.data)
561275
public void setExpiration(String expiration) {
        if (expiration == null) {
            _properties.remove(AMQP_PROP_EXPIRATION);
            return;
        }
        
        _properties.put(AMQP_PROP_EXPIRATION, expiration);
    }
396490
def __checkExpiration(self, mtime=None):
        '''
            
        '''
        if not self.maxLockAge:
            return False

        if mtime is None:
            try:
                mtime = os.stat(self.lockPath).st_mtime
            except FileNotFoundError as e:
                return False

        if mtime < time.time() - self.maxLockAge:
            return True

        return False
466428
def _update_session_expiration(self):
        

        session_time = oz.settings["session_time"]

        if session_time:
            self.redis().expire(self._session_key, session_time)
713471
def expired(self):
    """"""
    expiry_time = self.expiry_time
    if expiry_time is not None:
      return expiry_time < rdfvalue.RDFDatetime.Now()
    else:
      return False