text: import pandas as pd
  
  from .registry import ETL_FUNCS
  
  
  def _determine_game_winner(df: pd.DataFrame):
      winner = (
          df.loc[df["play_id"] == df["play_id"].max(), ["away_score", "home_score"]]
          .rename({"away_score": "away", "home_score": "home"}, axis=1)
          .max()
          .idxmax()
      )
      return winner
  
  
  def _row_determine_game_winner(df: pd.DataFrame):
      winner = _determine_game_winner(df)
      df["winner"] = winner
      return df
  
  
  # register functions
  # NOTE: the functions are registered here so that
  # cross-referencing does not have to go through the registry
  # and the dispatch must be defined THEN the registration
  ETL_FUNCS.register(tags=["game", "winner"])(_determine_game_winner)
  ETL_FUNCS.register(tags=["row", "winner"])(_row_determine_game_winner)
  