nodes: 0, module; 1, function_definition; 2, function_name:alphabeta; 3, parameters; 4, block; 5, identifier:game; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, comment:# base case - game is over; 10, if_statement; 11, if_statement; 12, comment:# recursive case - game is not over; 13, for_statement; 14, return_statement; 15, identifier:alpha_beta; 16, tuple; 17, identifier:player; 18, attribute; 19, string; 20, comparison_operator:game.result is not None; 21, block; 22, binary_operator:game.turn % 2; 23, comment:# minimizing player; 24, block; 25, else_clause; 26, pattern_list; 27, call; 28, block; 29, expression_list; 30, unary_operator; 31, call; 32, attribute; 33, identifier:identity; 34, string_content:Runs minimax search with alpha-beta pruning on the provided game.
  
      :param Game game: game to search
      :param tuple alpha_beta: a tuple of two floats that indicate
                               the initial values of alpha and beta,
                               respectively. The default is (-inf, inf).
      :param callable player: player used to sort moves to be explored.
                              Ordering better moves first may significantly
                              reduce the amount of moves that need to be
                              explored. The identity player is the default.; 35, attribute; 36, None; 37, return_statement; 38, attribute; 39, integer:2; 40, expression_statement; 41, expression_statement; 42, expression_statement; 43, comment:# maximizing player; 44, block; 45, identifier:move; 46, identifier:new_game; 47, identifier:make_moves; 48, argument_list; 49, expression_statement; 50, if_statement; 51, identifier:best_moves; 52, identifier:best_value; 53, call; 54, identifier:float; 55, argument_list; 56, identifier:dominoes; 57, identifier:players; 58, identifier:game; 59, identifier:result; 60, expression_list; 61, identifier:game; 62, identifier:turn; 63, assignment; 64, assignment; 65, assignment; 66, expression_statement; 67, expression_statement; 68, expression_statement; 69, identifier:game; 70, identifier:player; 71, assignment; 72, call; 73, block; 74, identifier:float; 75, argument_list; 76, string; 77, list; 78, attribute; 79, identifier:best_value; 80, call; 81, identifier:op; 82, attribute; 83, identifier:update; 84, lambda; 85, assignment; 86, assignment; 87, assignment; 88, pattern_list; 89, call; 90, identifier:op; 91, argument_list; 92, expression_statement; 93, expression_statement; 94, expression_statement; 95, expression_statement; 96, if_statement; 97, string; 98, string_content:inf; 99, attribute; 100, identifier:points; 101, identifier:float; 102, argument_list; 103, identifier:operator; 104, identifier:lt; 105, lambda_parameters; 106, tuple; 107, identifier:best_value; 108, unary_operator; 109, identifier:op; 110, attribute; 111, identifier:update; 112, lambda; 113, identifier:moves; 114, identifier:value; 115, identifier:alphabeta; 116, argument_list; 117, identifier:value; 118, identifier:best_value; 119, assignment; 120, assignment; 121, call; 122, assignment; 123, comparison_operator:alpha_beta[1] <= alpha_beta[0]; 124, comment:# alpha-beta cutoff; 125, block; 126, string_content:inf; 127, identifier:game; 128, identifier:result; 129, string; 130, identifier:ab; 131, identifier:v; 132, subscript; 133, call; 134, call; 135, identifier:operator; 136, identifier:gt; 137, lambda_parameters; 138, tuple; 139, identifier:new_game; 140, identifier:alpha_beta; 141, identifier:player; 142, identifier:best_value; 143, identifier:value; 144, identifier:best_moves; 145, identifier:moves; 146, attribute; 147, argument_list; 148, identifier:alpha_beta; 149, call; 150, subscript; 151, subscript; 152, break_statement; 153, string_content:inf; 154, identifier:ab; 155, integer:0; 156, identifier:min; 157, argument_list; 158, identifier:float; 159, argument_list; 160, identifier:ab; 161, identifier:v; 162, call; 163, subscript; 164, identifier:best_moves; 165, identifier:insert; 166, integer:0; 167, identifier:move; 168, identifier:update; 169, argument_list; 170, identifier:alpha_beta; 171, integer:1; 172, identifier:alpha_beta; 173, integer:0; 174, subscript; 175, identifier:v; 176, string; 177, identifier:max; 178, argument_list; 179, identifier:ab; 180, integer:1; 181, identifier:alpha_beta; 182, identifier:best_value; 183, identifier:ab; 184, integer:1; 185, string_content:inf; 186, subscript; 187, identifier:v; 188, identifier:ab; 189, integer:0
code: def alphabeta(game, alpha_beta=(-float('inf'), float('inf')),
                player=dominoes.players.identity):
      '''
      Runs minimax search with alpha-beta pruning on the provided game.
  
      :param Game game: game to search
      :param tuple alpha_beta: a tuple of two floats that indicate
                               the initial values of alpha and beta,
                               respectively. The default is (-inf, inf).
      :param callable player: player used to sort moves to be explored.
                              Ordering better moves first may significantly
                              reduce the amount of moves that need to be
                              explored. The identity player is the default.
      '''
      # base case - game is over
      if game.result is not None:
          return [], game.result.points
  
      if game.turn % 2:
          # minimizing player
          best_value = float('inf')
          op = operator.lt
          update = lambda ab, v: (ab[0], min(ab[1], v))
      else:
          # maximizing player
          best_value = -float('inf')
          op = operator.gt
          update = lambda ab, v: (max(ab[0], v), ab[1])
  
      # recursive case - game is not over
      for move, new_game in make_moves(game, player):
          moves, value = alphabeta(new_game, alpha_beta, player)
          if op(value, best_value):
              best_value = value
              best_moves = moves
              best_moves.insert(0, move)
              alpha_beta = update(alpha_beta, best_value)
              if alpha_beta[1] <= alpha_beta[0]:
                  # alpha-beta cutoff
                  break
  
      return best_moves, best_value