code: def get_cli_args():
      """Create CLI parser and return parsed arguments"""
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--algo",
          choices=["PPO", "APPO"],
          default="PPO",
          help="The algorithm to use (only 'PPO' and 'APPO' allowed thus far).",
      )
      parser.add_argument(
          "--framework",
          choices=["tf", "tf2", "torch"],
          default="torch",
          help="The DL framework specifier.",
      )
      parser.add_argument(
          "--enable-new-api-stack",
          action="store_true",
          help="Whether to activate RLlib's new API stack (RLModule, Learner APIs).",
      )
      parser.add_argument("--num-cpus", type=int, default=0)
      parser.add_argument("--num-workers", type=int, default=2)
      parser.add_argument(
          "--from-checkpoint",
          type=str,
          default=None,
          help="Full path to a checkpoint file for restoring a previously saved "
          "Algorithm state.",
      )
      parser.add_argument(
          "--env",
          type=str,
          default="connect_four",
          choices=["markov_soccer", "connect_four"],
      )
      parser.add_argument(
          "--stop-iters",
          type=int,
          default=200,
          help="Number of iterations to train.",
      )
      parser.add_argument(
          "--stop-timesteps",
          type=int,
          default=10000000,
          help="Number of timesteps to train.",
      )
      parser.add_argument(
          "--win-rate-threshold",
          type=float,
          default=0.95,
          help="Win-rate at which we setup another opponent by freezing the "
          "current main policy and playing against a uniform distribution "
          "of previously frozen 'main's from here on.",
      )
      parser.add_argument(
          "--num-episodes-human-play",
          type=int,
          default=10,
          help="How many episodes to play against the user on the command "
          "line after training has finished.",
      )
  
      parser.add_argument(
          "--as-test",
          action="store_true",
          help="Whether this script should be run as a test: --stop-reward must "
          "be achieved within --stop-timesteps AND --stop-iters.",
      )
  
      parser.add_argument(
          "--min-league-size",
          type=float,
          default=3,
          help="Minimum number of policies/RLModules to consider the test passed. "
          "The initial league size is 2: `main` and `random`. "
          "`--min-league-size=3` thus means that one new policy/RLModule has been "
          "added so far (b/c the `main` one has reached the `--win-rate-threshold "
          "against the `random` Policy/RLModule).",
      )
      parser.add_argument(
          "--local-mode",
          action="store_true",
          help="Init Ray in local mode for easier debugging.",
      )
  
      args = parser.parse_args()
      print(f"Running with following CLI args: {args}")
      return args
  
imports: import argparse
  import os
  import sys
  import numpy
  import ray
  from ray import air, tune
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  from ray.rllib.env.utils import try_import_pyspiel, try_import_open_spiel
  from ray.rllib.env.wrappers.open_spiel import OpenSpielEnv
  from ray.rllib.examples.policy.random_policy import RandomPolicy
  from ray.rllib.policy.policy import PolicySpec
  from ray.rllib.utils.test_utils import check_learning_achieved
  from ray.tune import CLIReporter, register_env
  from ray.tune.registry import get_trainable_cls
  from ray.rllib.core.rl_module.rl_module import SingleAgentRLModuleSpec
  from ray.rllib.core.rl_module.marl_module import MultiAgentRLModuleSpec
  from ray.rllib.examples.rl_module.random_rl_module import RandomRLModule
  from open_spiel.python.rl_environment import Environment
label_desc: Use image node_id 1 for calling a global function with example usage: get_cli_args() and returns: args