code: def get_service_account_token(request, service_account='default'):
      
      token_json = get(
          request,
          'instance/service-accounts/{0}/token'.format(service_account))
      token_expiry = _helpers.utcnow() + datetime.timedelta(
          seconds=token_json['expires_in'])
      return token_json['access_token'], token_expiry
docs: Get the OAuth 2.0 access token for a service account.
  
      Args:
          request (google.auth.transport.Request): A callable used to make
              HTTP requests.
          service_account (str): The string 'default' or a service account email
              address. The determines which service account for which to acquire
              an access token.
  
      Returns:
          Union[str, datetime]: The access token and its expiration.
  
      Raises:
          google.auth.exceptions.TransportError: if an error occurred while
              retrieving metadata.