code: def main():
      env = gym.make(
          "FrozenLake-v0", is_slippery=False
      )  # 0 left, 1 down, 2 right, 3 up
      env = FrozenLakeWapper(env)
  
      agent = QLearningAgent(
          obs_n=env.observation_space.n,
          act_n=env.action_space.n,
          learning_rate=0.1,
          gamma=0.9,
          e_greed=0.1,
      )
  
      for episode in range(500):
          ep_reward, ep_steps = run_episode(env, agent)
          print(
              "Episode %s: steps = %s , reward = %.1f"
              % (episode, ep_steps, ep_reward)
          )
  
      # 训练结束，查看算法效果
      test_episode(env, agent)
  
imports: import gym
  from gridworld import CliffWalkingWapper, FrozenLakeWapper
  from agent import QLearningAgent
  import time
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types