code: def test_finite_subproc_vector_env():
      length = 100
      dataset = DummyDataset(length)
      envs = FiniteSubprocVectorEnv(
          MetricTracker(length),
          [_finite_env_factory(dataset, 5, i) for i in range(5)],
      )
      envs._collector_guarded = True
      policy = AnyPolicy()
      test_collector = Collector(policy, envs, exploration_noise=True)
  
      for _ in range(1):
          envs._logger = [MetricTracker(length)]
          try:
              test_collector.collect(n_step=10**18)
          except StopIteration:
              envs._logger[0].validate()
  
imports: from collections import Counter
  import gym
  import numpy
  from tianshou.data import Batch, Collector
  from tianshou.policy import BasePolicy
  from torch.utils.data import DataLoader, Dataset, DistributedSampler
  from qlib.rl.utils.finite_env import LogWriter, FiniteDummyVectorEnv, FiniteShmemVectorEnv, FiniteSubprocVectorEnv, check_nan_observation, generate_nan_observation
label_desc: Use image node_id 4 for calling a global function with example usage: test_finite_subproc_vector_env() without return types