code: def postprocess_fn_add_next_actions_for_sarsa(
      policy: Policy, batch: SampleBatch, other_agent=None, episode=None
  ) -> SampleBatch:
      """Add next_actions to SampleBatch for SARSA training"""
      if policy.config["slateq_strategy"] == "SARSA":
          if (
              not batch.is_terminated_or_truncated()
              and policy._no_tracing is False
          ):
              raise RuntimeError(
                  "Expected a complete episode in each sample batch. "
                  f"But this batch is not: {batch}."
              )
          batch["next_actions"] = np.roll(batch["actions"], -1, axis=0)
  
      return batch
  
imports: import logging
  from typing import Dict, Tuple, Type
  import gymnasium
  import numpy
  from rllib_slate_q.slate_q.slateq_torch_model import SlateQTorchModel
  from ray.rllib.models.modelv2 import ModelV2
  from ray.rllib.models.torch.torch_action_dist import TorchCategorical, TorchDistributionWrapper
  from ray.rllib.policy.policy import Policy
  from ray.rllib.policy.policy_template import build_policy_class
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.policy.torch_mixins import TargetNetworkMixin
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.torch_utils import apply_grad_clipping, concat_multi_gpu_td_errors, convert_to_torch_tensor, huber_loss
  from ray.rllib.utils.typing import AlgorithmConfigDict, TensorType
label_desc: Use image node_id 9 for calling a global function with example usage: postprocess_fn_add_next_actions_for_sarsa(policy, batch, other_agent, episode) and returns: batch