def METHOD_NAME(self):
    # check if we need to rate limit ourselves
    if self.num_requests >= self.max_requests_per_second:
        delta = time.time() - self.last_request_time
        if delta < 1:
            logger.info("Rate limiting REST API")
            time.sleep(1 - delta)
        self.num_requests = 0
    else:
        self.num_requests += 1
    self.last_request_time = time.time()