original_docstring: 
          Update the node statistics on the path from the passed node to root to reflect
          the outcome of a randomly simulated playout.
          
docstring: Update the node statistics on the path from the passed node to root to reflect
  the outcome of a randomly simulated playout.
docstring_tokens: Update the node statistics on the path from the passed node to root to reflect the outcome of a randomly simulated playout .
code: def backup(self, node: RaveNode, turn: int, outcome: int, black_rave_pts: list, white_rave_pts: list) -> None:
          """
          Update the node statistics on the path from the passed node to root to reflect
          the outcome of a randomly simulated playout.
          """
          # note that reward is calculated for player who just played
          # at the node and not the next player to play
          reward = -1 if outcome == turn else 1
  
          while node is not None:
              if turn == GameMeta.PLAYERS["white"]:
                  for point in white_rave_pts:
                      if point in node.children:
                          node.children[point].Q_RAVE += -reward
                          node.children[point].N_RAVE += 1
              else:
                  for point in black_rave_pts:
                      if point in node.children:
                          node.children[point].Q_RAVE += -reward
                          node.children[point].N_RAVE += 1
  
              node.N += 1
              node.Q += reward
              turn = GameMeta.PLAYERS['white'] if turn == GameMeta.PLAYERS['black'] else GameMeta.PLAYERS['black']
              reward = -reward
              node = node.parent
code_tokens: def backup ( self , node : RaveNode , turn : int , outcome : int , black_rave_pts : list , white_rave_pts : list ) -> None : reward = - 1 if outcome == turn else 1 while node is not None : if turn == GameMeta . PLAYERS [ "white" ] : for point in white_rave_pts : if point in node . children : node . children [ point ] . Q_RAVE += - reward node . children [ point ] . N_RAVE += 1 else : for point in black_rave_pts : if point in node . children : node . children [ point ] . Q_RAVE += - reward node . children [ point ] . N_RAVE += 1 node . N += 1 node . Q += reward turn = GameMeta . PLAYERS [ 'white' ] if turn == GameMeta . PLAYERS [ 'black' ] else GameMeta . PLAYERS [ 'black' ] reward = - reward node = node . parent
short_docstring: Update the node statistics on the path from the passed node to root to reflect
  the outcome of a randomly simulated playout.
short_docstring_tokens: Update the node statistics on the path from the passed node to root to reflect the outcome of a randomly simulated playout .
comment: """
          Update the node statistics on the path from the passed node to root to reflect
          the outcome of a randomly simulated playout.
          """$SEP$# note that reward is calculated for player who just played$SEP$# at the node and not the next player to play