def get_wrapper_by_cls(venv, cls):
    """ Fetch env wrapper class cls from current venv

    Args:
        venv (gym.Wrapper): current env
        cls (gym.Wrapper): target env wrapper class
    """
    if isinstance(venv, cls):
        return venv
    elif hasattr(venv, 'env'):
        return get_wrapper_by_cls(venv.env, cls)

    return None