code: def simple_test(
      env_fn, learn_fn, min_reward_fraction, n_trials=N_TRIALS
  ):
      def seeded_env_fn():
          env = env_fn()
          env.seed(0)
          return env
  
      np.random.seed(0)
      env = DummyVecEnv([seeded_env_fn])
      with tf.Graph().as_default(), tf.Session(
          config=_sess_config
      ).as_default():
          tf.set_random_seed(0)
          model = learn_fn(env)
          sum_rew = 0
          done = True
          for i in range(n_trials):
              if done:
                  obs = env.reset()
                  state = model.initial_state
              if state is not None:
                  a, v, state, _ = model.step(obs, S=state, M=[False])
              else:
                  a, v, _, _ = model.step(obs)
              obs, rew, done, _ = env.step(a)
              sum_rew += float(rew)
          print("Reward in {} trials is {}".format(n_trials, sum_rew))
          assert (
              sum_rew > min_reward_fraction * n_trials
          ), "sum of rewards {} is less than {} of the total number of trials {}".format(
              sum_rew, min_reward_fraction, n_trials
          )
  
imports: import tensorflow
  import numpy
  from baselines.common.vec_env.dummy_vec_env import DummyVecEnv
label_desc: Use image node_id 1 for calling a global function with example usage: simple_test(env_fn, learn_fn, min_reward_fraction, n_trials) and returns: env