code: def ttl(self, steps, relative_time=None):
      '''
      Return the ttl given the number of steps, None if steps is not defined
      or we're otherwise unable to calculate one. If relative_time is defined,
      then return a ttl that is the number of seconds from now that the
      record should be expired.
      '''
      if steps:
        if relative_time:
          rtime = self.to_bucket(relative_time)
          ntime = self.to_bucket(time.time())
          # The relative time is beyond our TTL cutoff
          if (ntime - rtime) > steps:
            return 0
          # The relative time is in "recent" past or future
          else:
            return (steps + rtime - ntime) * self._step
        return steps * self._step
  
      return Nonf ttl(self, steps, relative_time=None):
      '''
      Return the ttl given the number of steps, None if steps is not defined
      or we're otherwise unable to calculate one. If relative_time is defined,
      then return a ttl that is the number of seconds from now that the
      record should be expired.
      '''
      if steps:
        if relative_time:
          rtime = self.to_bucket(relative_time)
          ntime = self.to_bucket(time.time())
          # The relative time is beyond our TTL cutoff
          if (ntime - rtime) > steps:
            return 0
          # The relative time is in "recent" past or future
          else:
            return (steps + rtime - ntime) * self._step
        return steps * self._step
  
      return None
docs: Return the ttl given the number of steps, None if steps is not defined
      or we're otherwise unable to calculate one. If relative_time is defined,
      then return a ttl that is the number of seconds from now that the
      record should be expired.