<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def purge_all(self, rate_limit_delay=60):
        '''Purge all pending URLs, waiting for API rate-limits if necessary!'''

        for batch, response in self.purge():
            if response.status_code == 507:
                details = response.json().get('detail', '<response did not contain "detail">')
                logger.info('Will retry request in %d seconds due to API rate-limit: %s',
                            rate_limit_delay, details)
                time.sleep(rate_limit_delay)