code: def cem_cartpole(ctxt=None, seed=1):
      """Train CEM with Cartpole-v1 environment.
  
      Args:
          ctxt (garage.experiment.ExperimentContext): The experiment
              configuration used by Trainer to create the snapshotter.
          seed (int): Used to seed the random number generator to produce
              determinism.
  
      """
      set_seed(seed)
      with TFTrainer(snapshot_config=ctxt) as trainer:
          env = GymEnv("CartPole-v1")
  
          policy = CategoricalMLPPolicy(
              name="policy", env_spec=env.spec, hidden_sizes=(32, 32)
          )
  
          n_samples = 20
  
          sampler = LocalSampler(
              agents=policy,
              envs=env,
              max_episode_length=env.spec.max_episode_length,
              is_tf_worker=True,
          )
  
          algo = CEM(
              env_spec=env.spec,
              policy=policy,
              sampler=sampler,
              best_frac=0.05,
              n_samples=n_samples,
          )
  
          trainer.setup(algo, env)
          trainer.train(n_epochs=100, batch_size=1000)
  
imports: from garage import wrap_experiment
  from garage.envs import GymEnv
  from garage.experiment.deterministic import set_seed
  from garage.np.algos import CEM
  from garage.sampler import LocalSampler
  from garage.tf.policies import CategoricalMLPPolicy
  from garage.trainer import TFTrainer
label_desc: Use image node_id 1 for calling a global function with example usage: cem_cartpole(ctxt, seed) without return types