code: def tutorial_cem(ctxt=None):
      """Train CEM with Cartpole-v1 environment.
  
      Args:
          ctxt (ExperimentContext): The experiment configuration used by
              :class:`~Trainer` to create the :class:`~Snapshotter`.
  
      """
      set_seed(100)
      with TFTrainer(ctxt) as trainer:
          env = GymEnv("CartPole-v1")
          policy = CategoricalMLPPolicy(env.spec)
          sampler = LocalSampler(
              agents=policy,
              envs=env,
              max_episode_length=env.spec.max_episode_length,
              is_tf_worker=True,
          )
          algo = SimpleCEM(env.spec, policy, sampler)
          trainer.setup(algo, env)
          trainer.train(n_epochs=100, batch_size=1000)
  
file_path: garage/src/garage/examples/np/tutorial_cem.py
imports: import numpy
  from garage import EpisodeBatch, log_performance, wrap_experiment
  from garage.envs import GymEnv
  from garage.experiment.deterministic import set_seed
  from garage.np import discount_cumsum
  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: tutorial_cem(ctxt) without return types