docstr: :return: action
docstr_tok: [":","return",":","action"]
code: def best_action(self):
      """
      :return: action
      """
      child_score = self.child_Q() + self.mcts.c_puct * self.child_U()
      masked_child_score = child_score
      if self.mcts.exploit_child_value:
          masked_child_score[~self.valid_actions] = -1e22
          action = np.argmax(masked_child_score)
          assert self.valid_actions[action] == 1
          return action
      else:
          masked_child_score[~self.valid_actions] = 0
          masked_child_score[self.valid_actions] += 1 + abs(
              np.min(masked_child_score)
          )
          p = masked_child_score / np.sum(masked_child_score)
          action = np.random.choice(
              np.arange(len(masked_child_score)),
              p=p,
          )
          assert self.valid_actions[action] == 1
          return action
  
imports: import collections
  import copy
  import math
  import numpy
label_desc: Use image node_id 8 for calling the Node obj's underlying member method code with example usage: obj.best_action() and returns: action, action