'Returns a valid OAuth2 access token when running in Cloud Shell.'

def _MaybeGetDevshellOAuth2AccessToken(self):

    try:
        creds = devshell.DevshellCredentials()
        return creds.access_token
    except devshell.NoDevshellServer:
        return None
