code: def test_pettingzoo_pistonball_v6_policies_are_dict_env(self):
      def env_creator(config):
          env = pistonball_v6.env()
          env = dtype_v0(env, dtype=float32)
          env = color_reduction_v0(env, mode="R")
          env = normalize_obs_v0(env)
          # add a wrapper to convert the observation space to a 3d array
          env = observation_lambda_v0(
              env, change_observation, change_obs_space
          )
          # resize the observation space to 84x84 so that RLlib defauls CNN can
          # process it
          env = resize_v1(env, x_size=84, y_size=84, linear_interp=True)
          return env
  
      # Register env
      register_env(
          "pistonball",
          lambda config: PettingZooEnv(env_creator(config)),
      )
  
      config = (
          PPOConfig()
          .environment("pistonball", env_config={"local_ratio": 0.5})
          .multi_agent(
              # Set of policy IDs (by default, will use Algorithms's
              # default policy class, the env's/agent's obs/act spaces and config={}).
              policies={"av"},
              # Map all agents to that policy.
              policy_mapping_fn=lambda agent_id, episode, worker, **kwargs: "av",
          )
          .debugging(log_level="DEBUG")
          .rollouts(
              num_rollout_workers=1,
              # Fragment length, collected at once from each worker
              # and for each agent!
              rollout_fragment_length=30,
          )
          # Training batch size -> Fragments are concatenated up to this point.
          .training(train_batch_size=200)
      )
  
      algo = config.build()
      algo.train()
      algo.stop()
  
file_path: ray/rllib/tests/test_pettingzoo_env.py
imports: from numpy import float32
  from pettingzoo.butterfly import pistonball_v6
  from pettingzoo.mpe import simple_spread_v3
  from supersuit import color_reduction_v0, dtype_v0, normalize_obs_v0, observation_lambda_v0, resize_v1
  from supersuit.utils.convert_box import convert_box
  import unittest
  import ray
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.env import PettingZooEnv
  from ray.tune.registry import register_env
label_desc: Use image node_id 3 for calling the TestPettingZooEnv obj's underlying member method code with example usage: obj.test_pettingzoo_pistonball_v6_policies_are_dict_env() and returns: env