class_docstr: An Arena class where any 2 agents can be pit against each other.
class_docstr_tok: ["An","Arena","class","where","any","2","agents","can","be","pit","against","each","other","."]
docstr: Executes one episode of a game.
  
  Returns:
      either
          winner: player who won the game (1 if player1, -1 if player2)
      or
          draw result returned from the game that is neither 1, -1, nor 0.
docstr_tok: ["Executes","one","episode","of","a","game",".","Returns",":","either","winner",":","player","who","won","the","game","(","1","if","player1",",","-1","if","player2",")","or","draw","result","returned","from","the","game","that","is","neither","1",",","-1",",","nor","0","."]
code: def playGame(self, verbose=True):
      """
      Executes one episode of a game.
  
      Returns:
          either
              winner: player who won the game (1 if player1, -1 if player2)
          or
              draw result returned from the game that is neither 1, -1, nor 0.
      """
      players = [self.player2, None, self.player1]
      curPlayer = 1
      board = self.game.getInitBoard()
      it = 0
      while self.game.getGameEnded(board, curPlayer) == 0:
          it += 1
          if verbose:
              # assert self.display
              print("Turn ", str(it), "Player ", str(curPlayer))
              # self.display(board)
              self.game.display(board)
          action = players[curPlayer + 1](
              self.game.getCanonicalForm(board, curPlayer)
          )
  
          valids = self.game.getValidMoves(
              self.game.getCanonicalForm(board, curPlayer), 1
          )
  
          if valids[action] == 0:
              logger.error("Action {} is not valid!".format(action))
              logger.debug("valids = {}".format(valids))
              assert valids[action] > 0
          board, curPlayer = self.game.getNextState(
              board, curPlayer, action
          )
      if verbose:
          # assert self.display
          print(
              "Game over: Turn ",
              str(it),
              "Result ",
              str(self.game.getGameEnded(board, 1)),
          )
          # self.display(board)
          self.game.display(board)
      return curPlayer * self.game.getGameEnded(board, curPlayer)
  
imports: from tqdm import tqdm
  from parl.utils import logger
label_desc: Use image node_id 2 for calling the Arena obj's underlying member method code with example usage: obj.playGame(verbose) and returns: unknown