code: def unwrap_env(env) -> Generator[gym.Wrapper, None, None]:
      """Unwraps an environment yielding all wrappers around environment."""
      while isinstance(env, gym.Wrapper):
          yield type(env)
          env = env.env
  
file_path: gym/tests/wrappers/test_autoreset.py
imports: from typing import Generator, Optional
  from unittest.mock import MagicMock
  import numpy
  import pytest
  import gym
  from gym.wrappers import AutoResetWrapper
  from tests.envs.utils import all_testing_env_specs
label_desc: Use image node_id 1 for calling a global function with example usage: unwrap_env(env) without return types