'Sets the rate for the given key and path,
where limit is the maximum number of requests in the given time (e.g., 100/hour).'

def set(self, key, path='/', limit=100, time=HOUR):

    time = {'second': SECOND, 'minute': MINUTE, 'hour': HOUR, 'day': DAY}.get(time, time)
    p = ('/' + path.strip('/'))
    q1 = 'delete    from    `rate`    where    key=?    and    path=?;'
    q2 = 'insert    into    `rate`    values    (?,    ?,    ?,    ?);'
    self.execute(q1, (key, p), commit=False)
    self.execute(q2, (key, p, limit, time))
    with self.lock:
        self.cache[(key, p)] = (0, limit, time, _time.time())
        self._n += 1
    return (key, path, limit, time)
