def _json_drives(game, home_team, data):
 drive_nums = []
 for drive_num in data:
  try:
   drive_nums.append(int(drive_num))
  except:
   pass
 drives = []
 for (i, drive_num) in enumerate(sorted(drive_nums), 1):
  d = Drive(game, i, home_team, data[str(drive_num)])
  if (not hasattr(d, 'game')):
   continue
  drives.append(d)
 return drives

def _json_drives ( game , home_team , data ) : drive_nums = [ ] for drive_num in data : try : drive_nums . append ( int ( drive_num ) ) except : pass drives = [ ] for ( i , drive_num ) in enumerate ( sorted ( drive_nums ) , 1 ) : d = Drive ( game , i , home_team , data [ str ( drive_num ) ] ) if ( not hasattr ( d , 'game' ) ) : continue drives . append ( d ) return drives
takes a home or away json entry and converts it to a list of drive objects .