def __coerce_to_generator_func(self, func):
        if inspect.isgeneratorfunction(func):
            return func

        @functools.wraps(func)
        def generator_func(*args, **kwargs):
            func(*args, **kwargs)
            yield
        return generator_func
Ensures that given function is a generator function,
dataset/ETHPy150Open Xion/pyqcy/pyqcy/properties.py/Property.__coerce_to_generator_func