code: def _get_token(
      request=None, allowed_auth_schemes=('OAuth', 'Bearer'),
      allowed_query_keys=('bearer_token', 'access_token')):
    
    allowed_auth_schemes = _listlike_guard(
        allowed_auth_schemes, 'allowed_auth_schemes', iterable_only=True)
    # Check if the token is in the Authorization header.
    auth_header = os.environ.get('HTTP_AUTHORIZATION')
    if auth_header:
      for auth_scheme in allowed_auth_schemes:
        if auth_header.startswith(auth_scheme):
          return auth_header[len(auth_scheme) + 1:]
      # If an auth header was specified, even if it's an invalid one, we won't
      # look for the token anywhere else.
      return None
  
    # Check if the token is in the query string.
    if request:
      allowed_query_keys = _listlike_guard(
          allowed_query_keys, 'allowed_query_keys', iterable_only=True)
      for key in allowed_query_keys:
        token, _ = request.get_unrecognized_field_info(key)
        if token:
          return token
docs: Get the auth token for this request.
  
    Auth token may be specified in either the Authorization header or
    as a query param (either access_token or bearer_token).  We'll check in
    this order:
      1. Authorization header.
      2. bearer_token query param.
      3. access_token query param.
  
    Args:
      request: The current request, or None.
  
    Returns:
      The token in the request or None.