code: def main():
      # Record experience traces
      record_ppo_config(directory="ppo-traces")
      # Alternatively:
      # record_custom_act_function(directory='ppo-traces')
      # write_custom_recording_file(directory='ppo-traces')
  
      # Pretrain a new agent on the recorded traces: for 30 iterations, feed the
      # experience of one episode to the agent and subsequently perform one update
      environment = Environment.create(
          environment="benchmarks/configs/cartpole.json"
      )
      agent = Agent.create(
          agent="benchmarks/configs/ppo.json", environment=environment
      )
      agent.pretrain(
          directory="ppo-traces",
          num_iterations=30,
          num_traces=1,
          num_updates=1,
      )
  
      # Evaluate the pretrained agent
      runner = Runner(agent=agent, environment=environment)
      runner.run(num_episodes=100, evaluation=True)
      runner.close()
  
      # Close agent and environment
      agent.close()
      environment.close()
  
imports: import os
  import numpy
  from tensorforce import Agent, Environment, Runner
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types