parameters: (opts, teams, team_queue, score_queue)
return_statement: return scoreboard
docstring: Given a set of teams, run a round-robin (all-pairs) tournament.
  
      Returns a map from team name to total score.
docstring_summary: Given a set of teams, run a round-robin (all-pairs) tournament.
docstring_tokens: Given a set of teams run a round - robin ( all - pairs ) tournament .
function: def round_robin(opts, teams, team_queue, score_queue):
      """Given a set of teams, run a round-robin (all-pairs) tournament.
  
      Returns a map from team name to total score.
      """
      waiting = 0
      for i, team1 in enumerate(teams):
          for j, team2 in enumerate(teams):
              for _ in range(opts.round_robin):
                  if team1 != team2:
                      team_queue.put((team1, team2, opts.duration))
                      waiting += 1
      scoreboard = collections.defaultdict(int)
      while waiting > 0:
          waiting -= 1
          (team1, score1), (team2, score2) = score_queue.get()
          scoreboard[team1] += score1
          scoreboard[team2] += score2
      return scoreboard
function_tokens: def round_robin ( opts , teams , team_queue , score_queue ) : waiting = 0 for i , team1 in enumerate ( teams ) : for j , team2 in enumerate ( teams ) : for _ in range ( opts . round_robin ) : if team1 != team2 : team_queue . put ( ( team1 , team2 , opts . duration ) ) waiting += 1 scoreboard = collections . defaultdict ( int ) while waiting > 0 : waiting -= 1 ( team1 , score1 ) , ( team2 , score2 ) = score_queue . get ( ) scoreboard [ team1 ] += score1 scoreboard [ team2 ] += score2 return scoreboard