docs: def reprovision_and_retry(func):
    """
    Wraps the `errback` callback of the API functions, automatically trying to
    re-provision if the app ID can not be found during the operation. If that's
    unsuccessful, it will raise the UnknownAppID error.
    """
    @functools.wraps(func)
    def wrapper(*a, **kw):
      errback = kw.get('errback', None)
      if errback is None:
        def errback(e):
          raise e
      def errback_wrapper(e):
        if isinstance(e, UnknownAppID) and 'INITIAL' in OPTIONS:
          try:
            for initial in OPTIONS['INITIAL']:
              provision(*initial) # retry provisioning the initial setup
            func(*a, **kw) # and try the function once more
          except Exception, new_exc:
            errback(new_exc) # throwing the new exception
        else:
          errback(e) # not an instance of UnknownAppID - nothing we can do here
      kw['errback'] = errback_wrapper
      return func(*a, **kw)
    return wrapper