code: def test_lstm_policy(request, model_class, policy):
      model_fname = "./test_model_{}.zip".format(request.node.name)
  
      try:
          # create and train
          if model_class == PPO2:
              model = model_class(
                  policy, "CartPole-v1", nminibatches=1, n_steps=4
              )
          else:
              model = model_class(policy, "CartPole-v1", n_steps=4)
          model.learn(total_timesteps=15)
  
          env = model.get_env()
          evaluate_policy(model, env, n_eval_episodes=10)
          # saving
          model.save(model_fname)
          del model, env
          # loading
          _ = model_class.load(model_fname, policy=policy)
  
      finally:
          if os.path.exists(model_fname):
              os.remove(model_fname)
  
imports: import os
  from gym.envs.classic_control import CartPoleEnv
  from gym.wrappers.time_limit import TimeLimit
  from gym import spaces
  import numpy
  import pytest
  from stable_baselines import A2C, ACER, ACKTR, PPO2, bench
  from stable_baselines.common.policies import MlpLstmPolicy, LstmPolicy
  from stable_baselines.common.vec_env import SubprocVecEnv
  from stable_baselines.common.vec_env.vec_normalize import VecNormalize
  from stable_baselines.common.math_util import safe_mean
  from stable_baselines.common.evaluation import evaluate_policy
label_desc: Use image node_id 1 for calling a global function with example usage: test_lstm_policy(request, model_class, policy) without return types