def call(self, retries, function, *args):
    if retries <= 0:
      raise AppControllerException(
        "Ran out of retries calling the AppController. ")

    try:
      result = function(*args)

      if result == self.BAD_SECRET_MESSAGE:
        raise AppControllerException("Could not authenticate successfully" + \
          " to the AppController. You may need to change the keyname in use.")
      else:
        return result
    except (ssl.SSLError, socket.error):
      sys.stderr.write("Saw SSL exception when communicating with the " \
        "AppController, retrying momentarily.")
      return self.call(retries - 1, function, *args)
Runs the given function, retrying it if a transient error is seen.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/appcontroller_client.py/AppControllerClient.call