code: def postprocess_trajectory(
      self, sample_batch, other_agent_batches=None, episode=None
  ):
      # add mcts policies to sample batch
      sample_batch["mcts_policies"] = np.array(
          episode.user_data["mcts_policies"]
      )[sample_batch["t"]]
      # final episode reward corresponds to the value (if not discounted)
      # for all transitions in episode
      final_reward = sample_batch["rewards"][-1]
      # if r2 is enabled, then add the reward to the buffer and normalize it
      if self.env.__class__.__name__ == "RankedRewardsEnvWrapper":
          self.env.r2_buffer.add_reward(final_reward)
          final_reward = self.env.r2_buffer.normalize(final_reward)
      sample_batch["value_label"] = final_reward * np.ones_like(
          sample_batch["t"]
      )
      return sample_batch
  
file_path: ray/rllib_contrib/alpha_zero/src/rllib_alpha_zero/alpha_zero/alpha_zero_policy.py
imports: import numpy
  from rllib_alpha_zero.alpha_zero.mcts import Node, RootParentNode
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.torch_policy import TorchPolicy
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.metrics.learner_info import LEARNER_STATS_KEY
label_desc: Use image node_id 4 for calling the AlphaZeroPolicy obj's underlying member method code with example usage: obj.postprocess_trajectory(sample_batch, other_agent_batches, episode) and returns: sample_batch