def GetWithRetries(self, uri, extra_headers=None, redirects_remaining=4, 
      encoding='UTF-8', converter=None, num_retries=DEFAULT_NUM_RETRIES,
      delay=DEFAULT_DELAY, backoff=DEFAULT_BACKOFF, logger=None):
    # Moved import for time module inside this method since time is not a
    # default module in Python2.2. This method will not be usable in
    # Python2.2.
    import time
    if backoff <= 1:
      raise ValueError("backoff must be greater than 1")
    num_retries = int(num_retries)

    if num_retries < 0:
      raise ValueError("num_retries must be 0 or greater")

    if delay <= 0:
      raise ValueError("delay must be greater than 0")

    # Let's start
    mtries, mdelay = num_retries, delay
    while mtries > 0:
      if mtries != num_retries:
        if logger:
          logger.debug("Retrying: %s" % uri)
      try:
        rv = self.Get(uri, extra_headers=extra_headers,
                      redirects_remaining=redirects_remaining,
                      encoding=encoding, converter=converter)
      except SystemExit:
        # Allow this error
        raise
      except RequestError, e:
        # Error 500 is 'internal server error' and warrants a retry
        # Error 503 is 'service unavailable' and warrants a retry
        if e[0]['status'] not in [500, 503]:
          raise e
        # Else, fall through to the retry code...
      except Exception, e:
        if logger:
          logger.debug(e)
        # Fall through to the retry code...
      else:
        # This is the right path.
        return rv
      mtries -= 1
      time.sleep(mdelay)
      mdelay *= backoff
    raise RanOutOfTries('Ran out of tries.')

  # CRUD operations
This is a wrapper method for Get with retrying capability.
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/service.py/GDataService.GetWithRetries