text: import gym
  
  from stable_baselines.common.policies import MlpPolicy
  from stable_baselines.common.vec_env import SubprocVecEnv
  from stable_baselines import PPO2
  
  # multiprocess environment
  n_cpu = 4
  env = SubprocVecEnv([lambda: gym.make('CartPole-v1') for i in range(n_cpu)])
  
  model = PPO2(MlpPolicy, env, verbose=1)
  model.learn(total_timesteps=25000)
  model.save("ppo2_cartpole")
  
  del model # remove to demonstrate saving and loading
  
  model = PPO2.load("ppo2_cartpole")
  
  print( "Press enter to test trained model" )
  input()
  
  # Enjoy trained agent
  obs = env.reset()
  while True:
      action, _states = model.predict(obs)
      obs, rewards, dones, info = env.step(action)
      env.render()
  