code: def fetch_token(token_url: str, scopes: str, credentials_dir: str) -> str:
      
  
      with Action('Fetching authentication token..') as action:
          try:
              access_token = get_token(token_url, scopes, credentials_dir)
              action.progress()
          except InvalidCredentialsError as e:
              action.fatal_error(e)
      return access_token
docs: Common function to fetch token
      :return: