mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-17 04:13:22 +00:00
12 lines
295 B
Python
12 lines
295 B
Python
from typing import Union
|
|
|
|
import gym
|
|
|
|
|
|
def has_wrapper(wrapped_env: Union[gym.Wrapper, gym.Env], wrapper_type: type):
|
|
while isinstance(wrapped_env, gym.Wrapper):
|
|
if isinstance(wrapped_env, wrapper_type):
|
|
return True
|
|
wrapped_env = wrapped_env.env
|
|
return False
|