original_docstring: 
          increments the counter for a given rate limit key
  
          :param str key: the key to increment
          :param int expiry: amount in seconds for the key to expire in
          :param bool elastic_expiry: whether to keep extending the rate limit
           window every hit.
          
docstring: increments the counter for a given rate limit key
docstring_tokens: increments the counter for a given rate limit key
code: def incr(self, key, expiry, elastic_expiry=False):
          """
          increments the counter for a given rate limit key
  
          :param str key: the key to increment
          :param int expiry: amount in seconds for the key to expire in
          :param bool elastic_expiry: whether to keep extending the rate limit
           window every hit.
          """
          if not self.storage.add(key, 1, expiry, noreply=False):
              if elastic_expiry:
                  value, cas = self.storage.gets(key)
                  retry = 0
                  while (
                          not self.storage.cas(key, int(value or 0)+1, cas, expiry)
                          and retry < self.MAX_CAS_RETRIES
                  ):
                      value, cas = self.storage.gets(key)
                      retry += 1
                  self.storage.set(key + "/expires", expiry + time.time(), expire=expiry, noreply=False)
                  return int(value or 0) + 1
              else:
                  return self.storage.incr(key, 1)
          self.storage.set(key + "/expires", expiry + time.time(), expire=expiry, noreply=False)
          return 1
code_tokens: def incr ( self , key , expiry , elastic_expiry = False ) : if not self . storage . add ( key , 1 , expiry , noreply = False ) : if elastic_expiry : value , cas = self . storage . gets ( key ) retry = 0 while ( not self . storage . cas ( key , int ( value or 0 ) + 1 , cas , expiry ) and retry < self . MAX_CAS_RETRIES ) : value , cas = self . storage . gets ( key ) retry += 1 self . storage . set ( key + "/expires" , expiry + time . time ( ) , expire = expiry , noreply = False ) return int ( value or 0 ) + 1 else : return self . storage . incr ( key , 1 ) self . storage . set ( key + "/expires" , expiry + time . time ( ) , expire = expiry , noreply = False ) return 1
short_docstring: increments the counter for a given rate limit key
short_docstring_tokens: increments the counter for a given rate limit key
comment: """
          increments the counter for a given rate limit key
  
          :param str key: the key to increment
          :param int expiry: amount in seconds for the key to expire in
          :param bool elastic_expiry: whether to keep extending the rate limit
           window every hit.
          """