def get_rate_limit(self):
    if (self._access_key_id in cached_rate_limits):
        return cached_rate_limits[self._access_key_id]
    new_conn_created = self.open()
    if (not self.connection):
        raise Exception('No connection is available to check current SES rate limit.')
    try:
        quota_dict = self.connection.get_send_quota()
        max_per_second = quota_dict['MaxSendRate']
        ret = float(max_per_second)
        cached_rate_limits[self._access_key_id] = ret
        return ret
    finally:
        if new_conn_created:
            self.close()
def get_rate_limit(self):
    if (self._access_key_id in cached_rate_limits):
        return cached_rate_limits[self._access_key_id]
    new_conn_created = self.open()
    if (not self.connection):
        raise Exception('No connection is available to check current SES rate limit.')
    try:
        quota_dict = self.connection.get_send_quota()
        max_per_second = quota_dict['MaxSendRate']
        ret = float(max_per_second)
        cached_rate_limits[self._access_key_id] = ret
        return ret
    finally:
        if new_conn_created:
            self.close()