def _raiseUnavailableFor401(message):
def __raiseUnavailableFor401(fn):<EOL><INDENT>def wrapped(*args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>return fn(*args, **kwargs)<EOL><DEDENT>except requests.exceptions.HTTPError as e:<EOL><INDENT>if e.response.status_code == requests.codes.unauthorized:<EOL><INDENT>raise access_common.Unavailable(message)<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>return wrapped<EOL><DEDENT>return __raiseUnavailableFor401<EOL>
Returns a decorator to swallow a requests exception for modules that
        are not accessible without logging in, and turn it into an Unavailable
        exception.