Check if data for a url has expired.

        Data is not fetched again if it has expired.

        Args:
            url: url to check expiration on

        Returns:
            value of the data, possibly None
420318
def check(self, url: str) -> Optional[dict]:
        
        data = self.data.get(url)
        if data:
            data = self._check_expiration(url, data)
        return data.data if data else None
990682
def is_expired(self, max_idle_seconds):
        

        now = current_time()
        return (self.expiration_time is not None and self.expiration_time < now) or \
               (max_idle_seconds is not None and self.last_access_time + max_idle_seconds < now)
1014749
def _get(self, url):
        
        return self.session.get(self.READ_URL_PRE + url).json()
573609
def _is_expired_response(self, response):
        
        if response.status_code != 401:
            return False
        challenge = response.headers.get('www-authenticate', '')
        return 'error="invalid_token"' in challenge
974756
def get(self, url, data=None):
        
        response = self.http.get(url,
                                 headers=self.headers,
                                 params=data,
                                 **self.requests_params)
        return self.process(response)
723632
def _is_valid_url(url):
        
        try:
            parsed = urlparse(url)
            mandatory_parts = [parsed.scheme, parsed.netloc]
            return all(mandatory_parts)
        except:
            return False
766160
def _zone_expired(self, zone):
        
        return (time.time() > self._zones[zone].timestamp + Zonetracker.EXPIRE) and self._zones[zone].expander is False
613893
async def is_expired(self):
        
        if asyncio.iscoroutinefunction(self.state):
            current_state = await self.state()
        else:
            current_state = self.state()
        if current_state:
            return current_state != "leased"
        return False
946497
def hasExpired(self):
        
        return (datetime.datetime.utcnow() - self.lastUpdateTime).total_seconds() > self.maxAgeSeconds
108634
def EXPIRING_TOKEN_LIFESPAN(self):
        
        try:
            val = settings.EXPIRING_TOKEN_LIFESPAN
        except AttributeError:
            val = timedelta(days=30)

        return val
615952
def is_valid(self, context, sid):
		
		
		record = self._Document.find_one(sid, project=('expires', ))
		
		if not record:
			return
		
		return not record._expired
631106
def waitForURL(url, max_seconds=None):
    

    startTime = datetime.now()
    while True:
        response = None
        try:
            response = urllib2.urlopen(HEADREQUEST(url))
        except urllib2.URLError:
            pass
        if response is not None and isinstance(response, urllib2.addinfourl):
            if response.getcode() == 200:
                # We're done, yay!
                return
        timeNow = datetime.now()
        timePassed = timeNow - startTime
        if max_seconds and max_seconds < timePassed.seconds:
            return
        print("Waiting on URL %s for %s so far" % (url, timePassed))
        time.sleep(30)
594626
def get(self, url, expiration):
        
        # Hash url to have a shorter key and add it expiration time to avoid clash for 
        # other url usage with different expiration
        cache_key = self.cache_key.format(**{
            'id': self._hash_url(url),
            'expire': str(expiration)
        })
        
        # Get feed from cache if any
        feed = cache.get(cache_key)
        # Else fetch it
        if feed is None:
            #print "No feed cache, have to fetch it"
            feed = self.fetch(url)
            cache.set(cache_key, feed, expiration)
            
        return self.parse(feed)
369619
def get(self, url):
        ''''''
        robots_url = Robots.robots_url(url)
        if robots_url not in self.cache:
            self.cache[robots_url] = ExpiringObject(partial(self.factory, robots_url))
        return self.cache[robots_url].get()
125529
def _parse_expiry(response_data):
    
    expires_in = response_data.get('expires_in', None)

    if expires_in is not None:
        return _helpers.utcnow() + datetime.timedelta(
            seconds=expires_in)
    else:
        return None
1025916
def expire(url)
      if url == :all
        if store.respond_to?(:keys)
          urls.each{ |u| expire(u) }
        else
          raise(NoMethodError, "The Geocoder cache store must implement `#keys` for `expire(:all)` to work")
        end
      else
        expire_single_url(url)
      end
    end
1281336
def expireat(self, key, when):
        """"""
        expire_time = datetime.fromtimestamp(when)
        key = self._encode(key)
        if key in self.redis:
            self.timeouts[key] = expire_time
            return True
        return False