code: def test_multi_agent_sample_round_robin(self):
      ev = RolloutWorker(
          env_creator=lambda _: RoundRobinMultiAgent(
              5, increment_obs=True
          ),
          default_policy_class=MockPolicy,
          config=AlgorithmConfig()
          .rollouts(
              rollout_fragment_length=50,
              num_rollout_workers=0,
          )
          .multi_agent(
              policies={"p0"},
              policy_mapping_fn=lambda agent_id, episode, worker, **kwargs: "p0",
          ),
      )
      batch = ev.sample()
      self.assertEqual(batch.count, 50)
      # since we round robin introduce agents into the env, some of the env
      # steps don't count as proper transitions
      self.assertEqual(batch.policy_batches["p0"].count, 42)
      check(
          batch.policy_batches["p0"]["obs"][:10],
          one_hot(np.array([0, 1, 2, 3, 4] * 2), 10),
      )
      check(
          batch.policy_batches["p0"]["new_obs"][:10],
          one_hot(np.array([1, 2, 3, 4, 5] * 2), 10),
      )
      self.assertEqual(
          batch.policy_batches["p0"]["rewards"].tolist()[:10],
          [100, 100, 100, 100, 0] * 2,
      )
      self.assertEqual(
          batch.policy_batches["p0"]["terminateds"].tolist()[:10],
          [False, False, False, False, True] * 2,
      )
      self.assertEqual(
          batch.policy_batches["p0"]["truncateds"].tolist()[:10],
          [False, False, False, False, True] * 2,
      )
      self.assertEqual(
          batch.policy_batches["p0"]["t"].tolist()[:10],
          [4, 9, 14, 19, 24, 5, 10, 15, 20, 25],
      )
  
imports: import gymnasium
  import numpy
  import random
  import tree
  import unittest
  import ray
  from ray.tune.registry import register_env
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.algorithms.dqn.dqn import DQNConfig
  from ray.rllib.algorithms.dqn.dqn_tf_policy import DQNTFPolicy
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.env.multi_agent_env import make_multi_agent, MultiAgentEnvWrapper
  from ray.rllib.evaluation.episode import Episode
  from ray.rllib.evaluation.rollout_worker import get_global_worker, RolloutWorker
  from ray.rllib.evaluation.tests.test_rollout_worker import MockPolicy
  from ray.rllib.examples.policy.random_policy import RandomPolicy
  from ray.rllib.examples.env.multi_agent import MultiAgentCartPole, BasicMultiAgent, EarlyDoneMultiAgent, FlexAgentsMultiAgent, RoundRobinMultiAgent, SometimesZeroAgentsMultiAgent
  from ray.rllib.policy.policy import PolicySpec
  from ray.rllib.policy.sample_batch import convert_ma_batch_to_sample_batch
  from ray.rllib.tests.test_nested_observation_spaces import NestedMultiAgentEnv
  from ray.rllib.utils.numpy import one_hot
  from ray.rllib.utils.test_utils import check
label_desc: Use image node_id 14 for calling the TestMultiAgentEnv obj's underlying member method code with example usage: obj.test_multi_agent_sample_round_robin() without return types