code: def test_add_policy_connector_enabled(self):
      with tempfile.TemporaryDirectory() as tmpdir:
          config = (
              APPOConfig()
              .environment("CartPole-v1")
              .rollouts(enable_connectors=True)
          )
          algo = config.build()
          algo.train()
          result = algo.save(checkpoint_dir=tmpdir)
  
          path_to_checkpoint = os.path.join(
              result.checkpoint.path, "policies", "default_policy"
          )
  
          policy = Policy.from_checkpoint(path_to_checkpoint)
  
          self.assertIsNotNone(policy)
  
          # Add this policy to an Algorithm.
          algo = (
              APPOConfig()
              .framework(framework="torch")
              .build("CartPole-v0")
          )
  
          # Add the entire policy.
          self.assertIsNotNone(
              algo.add_policy("test_policy", policy=policy)
          )
  
          # Add the same policy, but using individual parameter API.
          self.assertIsNotNone(
              algo.add_policy(
                  "test_policy_2",
                  policy_cls=type(policy),
                  observation_space=policy.observation_space,
                  action_space=policy.action_space,
                  config=policy.config,
                  policy_state=policy.get_state(),
              )
          )
  
file_path: ray/python/ray/rllib/policy/tests/test_policy_checkpoint_restore.py
imports: import os
  import tempfile
  import unittest
  import gymnasium
  import ray
  from ray.rllib.algorithms.appo.appo import APPOConfig
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.policy import Policy
  from ray.rllib.utils.test_utils import framework_iterator
label_desc: Use image node_id 6 for calling the TestPolicyFromCheckpoint obj's underlying member method code with example usage: obj.test_add_policy_connector_enabled() without return types