code: def test_execution(self):
      self.start_tests(name="getting-started-execution")
  
      runner = Runner(
          agent="test/data/agent.json",
          environment=dict(environment="gym", level="CartPole"),
          max_episode_timesteps=10,
      )
      runner.run(num_episodes=10)
      runner.run(num_episodes=5, evaluation=True)
      runner.close()
      self.finished_test()
  
      runner = Runner(
          agent="test/data/agent.json",
          environment=dict(environment="gym", level="CartPole"),
          max_episode_timesteps=50,
          num_parallel=5,
          remote="multiprocessing",
      )
      runner.run(num_episodes=10)
      runner.close()
      self.finished_test()
  
      # Create agent and environment
      environment = Environment.create(
          environment="test/data/environment.json",
          max_episode_timesteps=10,
      )
      agent = Agent.create(
          agent="test/data/agent.json", environment=environment
      )
  
      # Train for 100 episodes
      for _ in range(10):
          states = environment.reset()
          terminal = False
          while not terminal:
              actions = agent.act(states=states)
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              agent.observe(terminal=terminal, reward=reward)
  
      # Train for 100 episodes
      for _ in range(10):
          episode_states = list()
          episode_internals = list()
          episode_actions = list()
          episode_terminal = list()
          episode_reward = list()
  
          states = environment.reset()
          internals = agent.initial_internals()
          terminal = False
          while not terminal:
              episode_states.append(states)
              episode_internals.append(internals)
              actions, internals = agent.act(
                  states=states, internals=internals, independent=True
              )
              episode_actions.append(actions)
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              episode_terminal.append(terminal)
              episode_reward.append(reward)
  
          agent.experience(
              states=episode_states,
              internals=episode_internals,
              actions=episode_actions,
              terminal=episode_terminal,
              reward=episode_reward,
          )
          agent.update()
  
      # Evaluate for 100 episodes
      sum_rewards = 0.0
      for _ in range(10):
          states = environment.reset()
          internals = agent.initial_internals()
          terminal = False
          while not terminal:
              actions, internals = agent.act(
                  states=states,
                  internals=internals,
                  deterministic=True,
                  independent=True,
              )
              states, terminal, reward = environment.execute(
                  actions=actions
              )
              sum_rewards += reward
  
      print("Mean episode reward:", sum_rewards / 100)
  
      # Close agent and environment
      agent.close()
      environment.close()
  
      self.finished_test()
  
file_path: tensorforce/test/test_documentation.py
imports: import unittest
  from tensorforce import Agent, Environment, Runner
  from test.unittest_base import UnittestBase
label_desc: Use image node_id 3 for calling the TestDocumentation obj's underlying member method code with example usage: obj.test_execution() without return types