code: def local_training_helper(self, fw, scaling_mode) -> None:
      if fw == "torch":
          import torch
  
          torch.manual_seed(0)
      elif fw == "tf2":
          import tensorflow as tf
  
          # this is done by rllib already inside of the policy class, but we need to
          # do it here for testing purposes
          tf.compat.v1.enable_eager_execution()
          tf.random.set_seed(0)
  
      env = gym.make("CartPole-v1")
      config_overrides = LOCAL_CONFIGS[scaling_mode]
      config = BaseTestingAlgorithmConfig().update_from_dict(
          config_overrides
      )
      learner_group = config.build_learner_group(env=env)
      local_learner = config.build_learner(env=env)
  
      # make the state of the learner and the local learner_group identical
      local_learner.set_state(
          learner_group.get_state()["learner_state"]
      )
      check(
          local_learner.get_state(),
          learner_group.get_state()["learner_state"],
      )
      reader = get_cartpole_dataset_reader(batch_size=500)
      batch = reader.next()
      batch = batch.as_multi_agent()
      learner_update = local_learner.update_from_batch(batch=batch)
      learner_group_update = learner_group.update_from_batch(
          batch=batch
      )
      check(learner_update, learner_group_update)
  
      new_module_id = "test_module"
  
      add_module_to_learner_or_learner_group(
          config, env, new_module_id, learner_group
      )
      add_module_to_learner_or_learner_group(
          config, env, new_module_id, local_learner
      )
  
      # make the state of the learner and the local learner_group identical
      local_learner.set_state(
          learner_group.get_state()["learner_state"]
      )
      check(
          local_learner.get_state(),
          learner_group.get_state()["learner_state"],
      )
  
      # do another update
      batch = reader.next()
      ma_batch = MultiAgentBatch(
          {new_module_id: batch, DEFAULT_POLICY_ID: batch},
          env_steps=batch.count,
      )
      # the optimizer state is not initialized fully until the first time that
      # training is completed. A call to get state before that won't contain the
      # optimizer state. So we do a dummy update here to initialize the optimizer
      local_learner.update_from_batch(batch=ma_batch)
      learner_group.update_from_batch(batch=ma_batch)
  
      check(
          local_learner.get_state(),
          learner_group.get_state()["learner_state"],
      )
      local_learner_results = local_learner.update_from_batch(
          batch=ma_batch
      )
      learner_group_results = learner_group.update_from_batch(
          batch=ma_batch
      )
  
      check(local_learner_results, learner_group_results)
  
      check(
          local_learner.get_state(),
          learner_group.get_state()["learner_state"],
      )
  
imports: import gymnasium
  import itertools
  import numpy
  from typing import Any, Dict, List
  import tempfile
  import unittest
  import ray
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.algorithms.ppo.tests.test_ppo_learner import FAKE_BATCH
  from ray.rllib.core.learner.learner import Learner
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModule
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.core.testing.tf.bc_learner import BCTfLearner
  from ray.rllib.core.testing.tf.bc_module import DiscreteBCTFModule
  from ray.rllib.core.testing.utils import add_module_to_learner_or_learner_group
  from ray.rllib.core.testing.testing_learner import BaseTestingAlgorithmConfig
  from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, SampleBatch, MultiAgentBatch
  from ray.rllib.utils.test_utils import check, get_cartpole_dataset_reader
  from ray.rllib.utils.metrics import ALL_MODULES
  from ray.util.timer import _Timer
label_desc: Use image node_id 1 for calling the RemoteTrainingHelper obj's underlying member method code with example usage: obj.local_training_helper(fw, scaling_mode) without return types