class_docstr: This class handles the MCTS tree.
code: def applyDirNoise(self, s, valids):
      dir_values = np.random.dirichlet(
          [self.args.dirichletAlpha] * np.count_nonzero(valids)
      )
      dir_idx = 0
      for idx in range(len(self.Ps[s])):
          if self.Ps[s][idx]:
              self.Ps[s][idx] = (0.75 * self.Ps[s][idx]) + (
                  0.25 * dir_values[dir_idx]
              )
              dir_idx += 1
  
file_path: PARL/benchmark/torch/AlphaZero/MCTS.py
imports: import math
  import time
  import numpy
label_desc: Use image node_id 4 for calling the MCTS obj's underlying member method code with example usage: obj.applyDirNoise(s, valids) without return types