def _handleAuth(fn):
@functools.wraps(fn)<EOL>def wrapped(*args, **kwargs):<EOL><INDENT>interactive = globalconf.get('<STR_LIT>')<EOL>def retryWithAuthOrRaise(original_exception):<EOL><INDENT>auth.authorizeUser(provider='<STR_LIT>', interactive=interactive)<EOL>if not interactive:<EOL><INDENT>raise original_exception<EOL><DEDENT>else:<EOL><INDENT>logger.debug('<STR_LIT>', settings.getProperty('<STR_LIT>', '<STR_LIT>'))<EOL>return fn(*args, **kwargs)<EOL><DEDENT><DEDENT>def handleRateLimitExceeded(original_exception):<EOL><INDENT>if not _userAuthedWithGithub():<EOL><INDENT>logger.warning('<STR_LIT>')<EOL>return retryWithAuthOrRaise(original_exception)<EOL><DEDENT>else:<EOL><INDENT>raise original_exception<EOL><DEDENT><DEDENT>try:<EOL><INDENT>return fn(*args, **kwargs)<EOL><DEDENT>except requests.exceptions.HTTPError as e:<EOL><INDENT>if e.response.status_code == <NUM_LIT>:<EOL><INDENT>return handleRateLimitExceeded(e)<EOL><DEDENT>if e.response.status_code == <NUM_LIT>:<EOL><INDENT>return retryWithAuthOrRaise(e)<EOL><DEDENT>raise<EOL><DEDENT>except github.BadCredentialsException as e:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>return retryWithAuthOrRaise(e)<EOL><DEDENT>except github.UnknownObjectException as e:<EOL><INDENT>logger.debug("<STR_LIT>")<EOL>if not _userAuthedWithGithub():<EOL><INDENT>logger.info('<STR_LIT>')<EOL>return retryWithAuthOrRaise(e)<EOL><DEDENT>raise<EOL><DEDENT>except github.RateLimitExceededException as e:<EOL><INDENT>return handleRateLimitExceeded(e)<EOL><DEDENT>except github.GithubException as e:<EOL><INDENT>if e.status == <NUM_LIT>:<EOL><INDENT>return handleRateLimitExceeded(e)<EOL><DEDENT>raise<EOL><DEDENT><DEDENT>return wrapped<EOL>
Decorator to re-try API calls after asking the user for authentication.