code: def on_learn_on_batch(
      self,
      *,
      policy: Policy,
      train_batch: SampleBatch,
      result: dict,
      **kwargs,
  ) -> None:
      result["sum_actions_in_train_batch"] = train_batch[
          "actions"
      ].sum()
      # Log the sum of actions in the train batch.
      print(
          "policy.learn_on_batch() result: {} -> sum actions: {}".format(
              policy, result["sum_actions_in_train_batch"]
          )
      )
  
imports: from typing import Dict, Tuple
  import argparse
  import gymnasium
  import numpy
  import os
  import ray
  from ray import air, tune
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.env import BaseEnv
  from ray.rllib.evaluation import Episode, RolloutWorker
  from ray.rllib.policy import Policy
  from ray.rllib.policy.sample_batch import SampleBatch
label_desc: Use image node_id 6 for calling the MyCallbacks obj's underlying member method code with example usage: obj.on_learn_on_batch() without return types