Extend expiration date a number of given years
778916
def extend_expiration_date(self, days=KEY_EXPIRATION_DELTA):
        
        delta = timedelta_days(days)
        self.expiration_date = self.expiration_date + delta
        self.save()
205427
def new_expiry(days=DEFAULT_PASTE_LIFETIME_DAYS):
    """"""
    now = delorean.Delorean()
    return now + datetime.timedelta(days=days)
1367456
def extend(self):
        """"""
        graph = GraphAPI()

        response = graph.get('oauth/access_token',
            client_id = FACEBOOK_APPLICATION_ID,
            client_secret = FACEBOOK_APPLICATION_SECRET_KEY,
            grant_type = 'fb_exchange_token',
            fb_exchange_token = self.token
        )

        components = parse_qs(response)

        self.token = components['access_token'][0]
        self.expires_at = now() + timedelta(seconds = int(components['expires'][0]))

        self.save()
551102
def ExpirePrefix(self, prefix):
    """"""
    for key in list(self._hash):
      if key.startswith(prefix):
        self.ExpireObject(key)
905088
def expire(self, time=None):
        """"""
        if time is None:
            time = self.__timer()
        root = self.__root
        curr = root.next
        links = self.__links
        cache_delitem = Cache.__delitem__
        while curr is not root and curr.expire < time:
            cache_delitem(self, curr.key)
            del links[curr.key]
            next = curr.next
            curr.unlink()
            curr = next
457729
def extended(self):
        """"""
        if self.expires_at:
            return self.expires_at - self.issued_at > timedelta(days=30)
        else:
            return False
1242536
function extend ( fromObj, toObj ) {
        for ( var key in toObj ) {
            fromObj[key] = toObj[key];
        }
    
        return fromObj;
    }
471624
public static void putExpirationDate(Bundle bundle, Date value) {
        Validate.notNull(bundle, "bundle");
        Validate.notNull(value, "value");
        putDate(bundle, EXPIRATION_DATE_KEY, value);
    }
579625
def extend(self, item):
        """"""
        if not isinstance(item, list):
            raise TypeError(
                'You can only extend lists with lists. '
                'You supplied \"%s\"' % type(item))
        for entry in item:
            if not isinstance(entry, str):
                raise TypeError(
                    'Members of this object must be strings. '
                    'You supplied \"%s\"' % type(entry))
            list.append(self, entry)
65244
public void setExpiredEnd(Date expiredEnd) throws InvalidArgumentException {
        if (expiredEnd == null) {
            throw new InvalidArgumentException("Date can't be null");
        }
        queryParms.put("expired_end", Util.dateToString(expiredEnd));
    }
436467
def replace(self, year=None, month=None, day=None):
        

        if year is None:
            year = self.year
        if month is None:
            month = self.month
        if day is None:
            day = self.day

        if year > 0:
            cls = date
        else:
            cls = extended_date

        return cls(
            year,
            month,
            day
        )
31967
function expire() {
  var dbs = this._store.databases, i;
  for(i in dbs) {
    dbs[i].delExpiredKeys();
  }
}
713471
def expired(self):
    """"""
    expiry_time = self.expiry_time
    if expiry_time is not None:
      return expiry_time < rdfvalue.RDFDatetime.Now()
    else:
      return False
508275
private long calculateExpiryTime(K key, PutOperation<K, V> existing, Operation<K, V> operation, Result<K, V> newValue) {
    if (operation.isExpiryAvailable()) {
      return operation.expirationTime();
    } else {
      try {
        Duration duration;
        if (existing == null) {
          duration = requireNonNull(expiry.getExpiryForCreation(key, newValue.getValue()));
        } else {
          duration = expiry.getExpiryForUpdate(key, existing::getValue, newValue.getValue());
          if (duration == null) {
            return existing.expirationTime();
          }
        }
        if (duration.isNegative()) {
          duration = Duration.ZERO;
        } else if (isExpiryDurationInfinite(duration)) {
          return Long.MAX_VALUE;
        }
        return ExpiryUtils.getExpirationMillis(operation.timeStamp(), duration);
      } catch (Exception ex) {
        LOG.error("Expiry computation caused an exception - Expiry duration will be 0 ", ex);
        return Long.MIN_VALUE;
      }
    }
  }
611187
def expire_at(self, _time):
        
        return self._client.expireat(self.key_prefix, round(_time))
788368
function migrateExpiration (store) {
  const request = store.openCursor()
  request.onsuccess = (event) => {
    const cursor = event.target.result
    if (!cursor) {
      return
    }
    const entry = cursor.value
    entry.expires = Date.now() + DEFAULT_EXPIRY
    cursor.update(entry)
  }
}
709424
public void setExpiryTime(long pExpiryTime) {
        long oldEexpiryTime = expiryTime;

        expiryTime = pExpiryTime;

        if (expiryTime < oldEexpiryTime) {
            // Expire now
            nextExpiryTime = 0;
            removeExpiredEntries();
        }
    }