code: def maintenance_sleeper(api, response, sleep=300):
      
      while response.status_code == 503:
          logger.info('Service unavailable: Response=[%s]',
                      six.text_type(response.__dict__))
          response_body = response.json()
          if 'code' in response_body:
              if response_body['code'] == 0:
                  logger.warning('API Maintenance in progress!'
                                 ' Waiting for [%s]s', sleep)
                  time.sleep(sleep)
                  response = api.session.send(response.request)
              else:
                  return response
          else:
              return response
      return response
docs: Pauses the execution if sevenbridges api is under maintenance.
      :param api: Api instance.
      :param response: requests.Response object.
      :param sleep: Time to sleep in between the requests.