code: def test_reset_out_of_order_async_vector_env(shared_memory):
      env_fns = [make_env("CartPole-v1", i) for i in range(4)]
  
      env = AsyncVectorEnv(env_fns, shared_memory=shared_memory)
      with pytest.raises(
          NoAsyncCallError,
          match=re.escape(
              "Calling `reset_wait` without any prior call to `reset_async`."
          ),
      ):
          env.reset_wait()
  
      env.close(terminate=True)
  
      env = AsyncVectorEnv(env_fns, shared_memory=shared_memory)
      with pytest.raises(
          AlreadyPendingCallError,
          match=re.escape(
              "Calling `reset_async` while waiting for a pending call to `step` to complete"
          ),
      ):
          actions = env.action_space.sample()
          env.reset()
          env.step_async(actions)
          env.reset_async()
  
      with pytest.warns(
          UserWarning,
          match=re.escape(
              "Calling `close` while waiting for a pending call to `step` to complete."
          ),
      ):
          env.close(terminate=True)
  
imports: import re
  from multiprocessing import TimeoutError
  import numpy
  import pytest
  from gym.error import AlreadyPendingCallError, ClosedEnvironmentError, NoAsyncCallError
  from gym.spaces import Box, Discrete, MultiDiscrete, Tuple
  from gym.vector.async_vector_env import AsyncVectorEnv
  from tests.vector.utils import CustomSpace, make_custom_space_env, make_env, make_slow_env
label_desc: Use image node_id 10 for calling a global function with example usage: test_reset_out_of_order_async_vector_env(shared_memory) without return types