code: def _do_checkpoint_twice_test(framework):
      # Checks if we can load a policy from a checkpoint (at least) twice
      config = (
          PPOConfig()
          .rollouts(num_rollout_workers=0)
          .evaluation(evaluation_num_workers=0)
      )
      for fw in framework_iterator(config, frameworks=[framework]):
          algo1 = config.build(env="CartPole-v1")
          algo2 = config.build(env="Pendulum-v1")
  
          algo1.train()
          algo2.train()
  
          policy1 = algo1.get_policy()
          policy1.export_checkpoint(
              "/tmp/test_policy_from_checkpoint_twice_p_1"
          )
  
          policy2 = algo2.get_policy()
          policy2.export_checkpoint(
              "/tmp/test_policy_from_checkpoint_twice_p_2"
          )
  
          algo1.stop()
          algo2.stop()
  
          # Create two policies from different checkpoints
          Policy.from_checkpoint(
              "/tmp/test_policy_from_checkpoint_twice_p_1"
          )
          Policy.from_checkpoint(
              "/tmp/test_policy_from_checkpoint_twice_p_2"
          )
  
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 1 for calling a global function with example usage: _do_checkpoint_twice_test(framework) without return types