def METHOD_NAME(func):
    func_obj = getattr(func, "__self__", None)
    @functools.wraps(func)
    def decorated(*args, **kwargs):
        if func_obj is not None:
            _obj = func_obj
        else:
            _obj = args[0]
        if not _obj.is_installed():
            if _obj.auto_install:
                _obj.install()
            else:
                raise IOError(
                    "'{}.{}()' requires to run install() first".format(
                        _obj.__class__.__name__, func.__name__
                    )
                )
        return func(*args, **kwargs)
    return decorated