def get_current_user():
if not _is_auth_info_available():<EOL><INDENT>raise InvalidGetUserCall('<STR_LIT>')<EOL><DEDENT>if _ENDPOINTS_USER_INFO in os.environ:<EOL><INDENT>user_info = os.environ[_ENDPOINTS_USER_INFO]<EOL>return users.User(user_info.email)<EOL><DEDENT>if _ENV_USE_OAUTH_SCOPE in os.environ:<EOL><INDENT>return oauth.get_current_user(os.environ[_ENV_USE_OAUTH_SCOPE].split())<EOL><DEDENT>if (_ENV_AUTH_EMAIL in os.environ and<EOL>_ENV_AUTH_DOMAIN in os.environ):<EOL><INDENT>if not os.environ[_ENV_AUTH_EMAIL]:<EOL><INDENT>return None<EOL><DEDENT>return users.User(os.environ[_ENV_AUTH_EMAIL],<EOL>os.environ[_ENV_AUTH_DOMAIN] or None)<EOL><DEDENT>return None<EOL>
Get user information from the id_token or oauth token in the request.

    This should only be called from within an Endpoints request handler,
    decorated with an @endpoints.method decorator.  The decorator should include
    the https://www.googleapis.com/auth/userinfo.email scope.

    If `endpoints_management.control.wsgi.AuthenticationMiddleware` is enabled,
    this returns the user info decoded by the middleware. Otherwise, if the
    current request uses an id_token, this validates and parses the token against
    the info in the current request handler and returns the user.  Or, for an
    Oauth token, this call validates the token against the tokeninfo endpoint and
    oauth.get_current_user with the scopes provided in the method's decorator.

    Returns:
      None if there is no token or it's invalid.  If the token was valid, this
        returns a User.  Only the user's email field is guaranteed to be set.
        Other fields may be empty.

    Raises:
      InvalidGetUserCall: if the environment variables necessary to determine the
        endpoints user are not set. These are typically set when processing a
        request using an Endpoints handler. If they are not set, it likely
        indicates that this function was called from outside an Endpoints request
        handler.