(plays, away_id, home_id)
return away_goals, away_penalties, home_goals, home_penalties
Take a list of scoring plays and split them into their cooresponding team.
        return two list, one for each team.
Take a list of scoring plays and split them into their cooresponding team.
        return two list, one for each team.
Take a list of scoring plays and split them into their cooresponding team . return two list one for each team .
def filter_plays(plays, away_id, home_id):
    """
        Take a list of scoring plays and split them into their cooresponding team.
        return two list, one for each team.
    """
    all_plays = plays.allPlays
    scoring_plays = []
    penalty_plays = []
    away_goals = []
    away_penalties  = []
    home_goals = []
    home_penalties = []

    # Filter the scoring plays out of all the plays
    for i in plays.scoringPlays:
        scoring_plays.append(all_plays[i])
    
    # Filter the Penalty plays out of all the plays
    for i in plays.penaltyPlays:
        penalty_plays.append(all_plays[i])

    away_goals = [ x for x in scoring_plays if x['team']['id'] == away_id]
    home_goals = [ x for x in scoring_plays if x['team']['id'] == home_id]
    away_penalties = [ x for x in penalty_plays if x['team']['id'] == away_id]
    home_penalties = [ x for x in penalty_plays if x['team']['id'] == home_id]

    return away_goals, away_penalties, home_goals, home_penalties
def filter_plays ( plays , away_id , home_id ) : all_plays = plays . allPlays scoring_plays = [ ] penalty_plays = [ ] away_goals = [ ] away_penalties = [ ] home_goals = [ ] home_penalties = [ ] # Filter the scoring plays out of all the plays for i in plays . scoringPlays : scoring_plays . append ( all_plays [ i ] ) # Filter the Penalty plays out of all the plays for i in plays . penaltyPlays : penalty_plays . append ( all_plays [ i ] ) away_goals = [ x for x in scoring_plays if x [ 'team' ] [ 'id' ] == away_id ] home_goals = [ x for x in scoring_plays if x [ 'team' ] [ 'id' ] == home_id ] away_penalties = [ x for x in penalty_plays if x [ 'team' ] [ 'id' ] == away_id ] home_penalties = [ x for x in penalty_plays if x [ 'team' ] [ 'id' ] == home_id ] return away_goals , away_penalties , home_goals , home_penalties