docs: def delay(self, params, now=None):
          """Determine delay until next request."""
  
          if now is None:
              now = time.time()
  
          # Initialize last...
          if not self.last:
              self.last = now
          elif now < self.last:
              now = self.last
  
          # How much has leaked out?
          leaked = now - self.last
  
          # Update the last message time
          self.last = now
  
          # Update the water level
          self.level = max(self.level - leaked, 0)
  
          # Are we too full?
          difference = self.level + self.limit.cost - self.limit.unit_value
          if difference >= self.eps:
              self.next = now + difference
              return difference
  
          # OK, raise the water level and set next to an appropriate
          # value
          self.level += self.limit.cost
          self.next = now
  
          return None