code: def test_rllib_integration(ray_start_regular):
      with ray_start_client_server():
          import ray.rllib.algorithms.dqn as dqn
  
          # Confirming the behavior of this context manager.
          # (Client mode hook not yet enabled.)
          assert not client_mode_should_convert()
          # Need to enable this for client APIs to be used.
          with enable_client_mode():
              # Confirming mode hook is enabled.
              assert client_mode_should_convert()
  
              config = dqn.SIMPLE_Q_DEFAULT_CONFIG.copy()
              # Run locally.
              config["num_workers"] = 0
              # Test with compression.
              config["compress_observations"] = True
              num_iterations = 2
              trainer = dqn.SimpleQ(config=config, env="CartPole-v1")
              rw = trainer.workers.local_worker()
              for i in range(num_iterations):
                  sb = rw.sample()
                  assert sb.count == config["rollout_fragment_length"]
                  trainer.train()
  
imports: import sys
  import pytest
  from ray import tune
  from ray.util.client.ray_client_helpers import ray_start_client_server
  from ray._private.client_mode_hook import enable_client_mode, client_mode_should_convert
label_desc: Use image node_id 1 for calling a global function with example usage: test_rllib_integration(ray_start_regular) without return types