def _run_active(callback, games):
 global _last
 if (len(games) == 0):
  return False
 (active, completed) = ([], [])
 for info in games:
  game = nflgame.game.Game(info['eid'])
  if (game is None):
   continue
  if game.game_over():
   completed.append(game)
   _completed.append(info['eid'])
  else:
   active.append(game)
 diffs = []
 for game in (active + completed):
  for last_game in (_last or []):
   if (game.eid != last_game.eid):
    continue
   diffs.append((game - last_game))
 _last = active
 callback(active, completed, diffs)
 return True

def _run_active ( callback , games ) : global _last if ( len ( games ) == 0 ) : return False ( active , completed ) = ( [ ] , [ ] ) for info in games : game = nflgame . game . Game ( info [ 'eid' ] ) if ( game is None ) : continue if game . game_over ( ) : completed . append ( game ) _completed . append ( info [ 'eid' ] ) else : active . append ( game ) diffs = [ ] for game in ( active + completed ) : for last_game in ( _last or [ ] ) : if ( game . eid != last_game . eid ) : continue diffs . append ( ( game - last_game ) ) _last = active callback ( active , completed , diffs ) return True
the active mode traverses each of the active games and fetches info for each from nfl .