def _json_play_players(play, data):
 players = OrderedDict()
 for (playerid, statcats) in data.iteritems():
  if (playerid == '0'):
   continue
  for info in statcats:
   if (info['statId'] not in nflgame.statmap.idmap):
    continue
   if (playerid not in players):
    home = play.drive.game.is_home(info['clubcode'])
    if home:
     team_name = play.drive.game.home
    else:
     team_name = play.drive.game.away
    stats = nflgame.player.PlayPlayerStats(playerid, info['playerName'], home, team_name)
    players[playerid] = stats
   statvals = nflgame.statmap.values(info['statId'], info['yards'])
   players[playerid]._add_stats(statvals)
 return players

def _json_play_players ( play , data ) : players = OrderedDict ( ) for ( playerid , statcats ) in data . iteritems ( ) : if ( playerid == '0' ) : continue for info in statcats : if ( info [ 'statId' ] not in nflgame . statmap . idmap ) : continue if ( playerid not in players ) : home = play . drive . game . is_home ( info [ 'clubcode' ] ) if home : team_name = play . drive . game . home else : team_name = play . drive . game . away stats = nflgame . player . PlayPlayerStats ( playerid , info [ 'playerName' ] , home , team_name ) players [ playerid ] = stats statvals = nflgame . statmap . values ( info [ 'statId' ] , info [ 'yards' ] ) players [ playerid ] . _add_stats ( statvals ) return players
takes a single json play entry and converts it to an ordereddict of player statistics .