parameters: (self, subgame_solution)
return_statement: return best_response, best_response_utility
docstring: Computes the best responses.
  
      Args:
        subgame_solution: List of subgame solution policies.
  
      Returns:
        best_response: For both players from the original set of pure strategies.
        best_response_utility: Corresponding utility for both players.
docstring_summary: Computes the best responses.
docstring_tokens: Computes the best responses .
function: def oracle(self, subgame_solution):
      """Computes the best responses.
  
      Args:
        subgame_solution: List of subgame solution policies.
  
      Returns:
        best_response: For both players from the original set of pure strategies.
        best_response_utility: Corresponding utility for both players.
      """
      assert lens(subgame_solution) == lens(self.subgame_strategies), (
          f"{lens(subgame_solution)} != {lens(self.subgame_strategies)}")
      best_response = [None, None]
      best_response_utility = [None, None]
      n_best_responders = 1 if self.enforce_symmetry else 2
      for player in range(n_best_responders):
        opponent = 1 - player
        # collect relevant payoff entries
        payoffs = np.take(
            self.payoffs[player],
            self.subgame_strategies[opponent],
            axis=opponent)
        # transpose to move player to leading dimension
        payoffs = np.transpose(payoffs, [player, opponent])
        avg_payoffs = (payoffs @ subgame_solution[opponent]).squeeze()
        best_response[player] = np.argmax(avg_payoffs)
        best_response_utility[player] = avg_payoffs[best_response[player]]
  
      if self.enforce_symmetry:
        best_response[1] = best_response[0]
        best_response_utility[1] = best_response_utility[0]
  
      return best_response, best_response_utility
function_tokens: def oracle ( self , subgame_solution ) : assert lens ( subgame_solution ) == lens ( self . subgame_strategies ) , ( f"{lens(subgame_solution)} != {lens(self.subgame_strategies)}" ) best_response = [ None , None ] best_response_utility = [ None , None ] n_best_responders = 1 if self . enforce_symmetry else 2 for player in range ( n_best_responders ) : opponent = 1 - player # collect relevant payoff entries payoffs = np . take ( self . payoffs [ player ] , self . subgame_strategies [ opponent ] , axis = opponent ) # transpose to move player to leading dimension payoffs = np . transpose ( payoffs , [ player , opponent ] ) avg_payoffs = ( payoffs @ subgame_solution [ opponent ] ) . squeeze ( ) best_response [ player ] = np . argmax ( avg_payoffs ) best_response_utility [ player ] = avg_payoffs [ best_response [ player ] ] if self . enforce_symmetry : best_response [ 1 ] = best_response [ 0 ] best_response_utility [ 1 ] = best_response_utility [ 0 ] return best_response , best_response_utility