code: def test_typing_wrapper():
      #
      # == test if the wrapper correctly mimics isinstance() behaviour ==
      #
      env = _InnerEnv()
      env = gym.Wrapper(env)
      env = _WrapperWithInterface(env)
      env = Wrapper(env)
  
      assert (
          isinstance(env, _EnvInterfaceWrapper)
          and isinstance(env, _EnvInterfaceInner)
          and isinstance(env, _WrapperWithInterface)
      )
  
      # check if we can still call the inner method
      assert env.method_inner() == 41
  
      # check if the wrapper works correctly
      assert env.method_wrapper() == 42
  
      #
      # == test idempotency ==
      #
      env = Wrapper(env)
  
      assert (
          isinstance(env, _EnvInterfaceWrapper)
          and isinstance(env, _EnvInterfaceInner)
          and isinstance(env, _WrapperWithInterface)
      )
  
      # check if we can still call the inner method
      assert env.method_inner() == 41
  
      # check if the wrapper works correctly
      assert env.method_wrapper() == 42
  
imports: from abc import ABC
  from typing import Any
  import gym
  from maze.core.env.base_env import BaseEnv
  from maze.core.wrappers.wrapper import Wrapper
label_desc: Use image node_id 1 for calling a global function with example usage: test_typing_wrapper() without return types