code: def test_trainer():
      set_log_with_config(C.logging_config)
      trainer = Trainer(max_iters=10, finite_env_type="subproc")
      policy = _ppo_policy()
  
      vessel = TrainingVessel(
          simulator_fn=lambda init: ZeroSimulator(init),
          state_interpreter=NoopStateInterpreter(),
          action_interpreter=NoopActionInterpreter(),
          policy=policy,
          train_initial_states=list(range(100)),
          val_initial_states=list(range(10)),
          test_initial_states=list(range(10)),
          reward=AccReward(),
          episode_per_iter=500,
          update_kwargs=dict(repeat=10, batch_size=64),
      )
      trainer.fit(vessel)
      assert trainer.current_iter == 10
      assert trainer.current_episode == 5000
      assert (
          abs(trainer.metrics["acc"] - trainer.metrics["reward"] * 100)
          < 1e-4
      )
      assert trainer.metrics["acc"] > 80
      trainer.test(vessel)
      assert trainer.metrics["acc"] > 60
  
imports: import os
  import random
  import sys
  from pathlib import Path
  import pytest
  import torch
  import torch.nn
  from gym import spaces
  from tianshou.policy import PPOPolicy
  from qlib.config import C
  from qlib.log import set_log_with_config
  from qlib.rl.interpreter import StateInterpreter, ActionInterpreter
  from qlib.rl.simulator import Simulator
  from qlib.rl.reward import Reward
  from qlib.rl.trainer import Trainer, TrainingVessel, EarlyStopping, Checkpoint
label_desc: Use image node_id 2 for calling a global function with example usage: test_trainer() without return types