code: def test_sample_batch_rollout_multi_agent_env(self):
      config = (
          PPOConfig()
          .environment("basic_multiagent")
          .framework("torch")
          .training(
              # Specifically ask for a batch of 200 samples.
              train_batch_size=200,
          )
          .rollouts(
              num_envs_per_worker=1,
              num_rollout_workers=0,
              # Enable EnvRunnerV2.
              enable_connectors=True,
          )
      )
  
      algo = PPO(config)
  
      rollout_worker = algo.workers.local_worker()
      sample_batch = rollout_worker.sample()
  
      # 2 agents. So the multi-agent SampleBatch should have
      # 200 env steps, and 400 agent steps.
      self.assertEqual(sample_batch.env_steps(), 200)
      self.assertEqual(sample_batch.agent_steps(), 400)
  
imports: import unittest
  import numpy
  import ray
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  from ray.rllib.algorithms.ppo import PPO, PPOConfig
  from ray.rllib.connectors.connector import ActionConnector, ConnectorContext
  from ray.rllib.evaluation.metrics import RolloutMetrics
  from ray.rllib.examples.env.debug_counter_env import DebugCounterEnv
  from ray.rllib.examples.env.multi_agent import BasicMultiAgent, GuessTheNumberGame
  from ray.rllib.examples.policy.random_policy import RandomPolicy
  from ray.rllib.policy.policy import PolicySpec
  from ray.tune import register_env
  from ray.rllib.policy.sample_batch import convert_ma_batch_to_sample_batch
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModuleSpec
  from ray.rllib.examples.rl_module.random_rl_module import RandomRLModule
  from ray.rllib.utils.test_utils import check
label_desc: Use image node_id 4 for calling the TestEnvRunnerV2 obj's underlying member method code with example usage: obj.test_sample_batch_rollout_multi_agent_env() without return types