code: def rl2_ppo_halfcheetah(
      ctxt,
      seed,
      max_episode_length,
      meta_batch_size,
      n_epochs,
      episode_per_task,
  ):
      """Train PPO with HalfCheetah environment.
  
      Args:
          ctxt (ExperimentContext): The experiment configuration used by
              :class:`~Trainer` to create the snapshotter.
          seed (int): Used to seed the random number generator to produce
              determinism.
          max_episode_length (int): Maximum length of a single episode.
          meta_batch_size (int): Meta batch size.
          n_epochs (int): Total number of epochs for training.
          episode_per_task (int): Number of training episode per task.
  
      """
      set_seed(seed)
      with TFTrainer(snapshot_config=ctxt) as trainer:
          tasks = task_sampler.SetTaskSampler(
              HalfCheetahVelEnv,
              wrapper=lambda env, _: RL2Env(
                  GymEnv(env, max_episode_length=max_episode_length)
              ),
          )
  
          env_spec = RL2Env(
              GymEnv(
                  HalfCheetahVelEnv(),
                  max_episode_length=max_episode_length,
              )
          ).spec
          policy = GaussianGRUPolicy(
              name="policy",
              hidden_dim=64,
              env_spec=env_spec,
              state_include_action=False,
          )
  
          baseline = LinearFeatureBaseline(env_spec=env_spec)
  
          envs = tasks.sample(meta_batch_size)
          sampler = LocalSampler(
              agents=policy,
              envs=envs,
              max_episode_length=env_spec.max_episode_length,
              is_tf_worker=True,
              n_workers=meta_batch_size,
              worker_class=RL2Worker,
              worker_args=dict(n_episodes_per_trial=episode_per_task),
          )
  
          algo = RL2PPO(
              meta_batch_size=meta_batch_size,
              task_sampler=tasks,
              env_spec=env_spec,
              policy=policy,
              baseline=baseline,
              sampler=sampler,
              episodes_per_trial=episode_per_task,
              discount=0.99,
              gae_lambda=0.95,
              lr_clip_range=0.2,
              optimizer_args=dict(
                  batch_size=32,
                  max_optimization_epochs=10,
              ),
              stop_entropy_gradient=True,
              entropy_method="max",
              policy_ent_coeff=0.02,
              center_adv=False,
          )
  
          trainer.setup(algo, envs)
  
          trainer.train(
              n_epochs=n_epochs,
              batch_size=episode_per_task
              * max_episode_length
              * meta_batch_size,
          )
  
file_path: garage/src/garage/examples/tf/rl2_ppo_halfcheetah.py
imports: import click
  from garage import wrap_experiment
  from garage.envs import GymEnv
  from garage.envs.mujoco.half_cheetah_vel_env import HalfCheetahVelEnv
  from garage.experiment import task_sampler
  from garage.experiment.deterministic import set_seed
  from garage.np.baselines import LinearFeatureBaseline
  from garage.sampler import LocalSampler
  from garage.tf.algos import RL2PPO
  from garage.tf.algos.rl2 import RL2Env, RL2Worker
  from garage.tf.policies import GaussianGRUPolicy
  from garage.trainer import TFTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: rl2_ppo_halfcheetah(ctxt, seed, max_episode_length, meta_batch_size, n_epochs, episode_per_task) without return types