'Given the request rate string, return a two tuple of:
<allowed number of requests>, <period of time in seconds>'

def parse_rate(self, rate):

    if (rate is None):
        return (None, None)
    (num, period) = rate.split(u'/')
    num_requests = int(num)
    duration = {u's': 1, u'm': 60, u'h': 3600, u'd': 86400}[period[0]]
    return (num_requests, duration)
