code: def get_team_frame(game_frame, team, home, away):
      r"""Calculate statistics for each team.
  
      Parameters
      ----------
      game_frame : pandas.DataFrame
          The game frame for a given season.
      team : str
          The team abbreviation.
      home : str
          The label of the home team column.
      away : int
          The label of the away team column.
  
      Returns
      -------
      team_frame : pandas.DataFrame
          The extracted team frame.
  
      """
      team_frame = game_frame[
          (game_frame[home] == team) | (game_frame[away] == team)
      ]
      return team_frame
  
imports: import warnings
  from alphapy.__main__ import main_pipeline
  from alphapy.frame import read_frame
  from alphapy.frame import write_frame
  from alphapy.globals import ModelType
  from alphapy.globals import Partition, datasets
  from alphapy.globals import PSEP, SSEP, USEP
  from alphapy.globals import WILDCARD
  from alphapy.model import get_model_config
  from alphapy.model import Model
  from alphapy.space import Space
  from alphapy.utilities import valid_date
  import argparse
  import datetime
  from itertools import groupby
  import logging
  import math
  import numpy
  import os
  import pandas
  import sys
  import yaml
label_desc: Use image node_id 11 for calling a global function with example usage: get_team_frame(game_frame, team, home, away) and returns: team_frame