def stub_if_missing_deps(*deps):
    
    def _find_failed_imports():
        failed = []
        for dep in deps:
            parts = dep.split(':')
            modname = parts[0]
            attrname = parts[1] if len(parts)>1 else None
            
            try:
                __import__(modname)
            except ImportError as err:
                failed.append(str(err).split()[-1])
                continue
            
            if attrname and not hasattr(sys.modules[modname], attrname):
                failed.append('.'.join([modname, attrname]))
        return failed
    
    def _stub_if_missing(obj):
        failed = _find_failed_imports()        
        if failed:
            if isclass(obj):
                def _error(obj, *args, **kwargs):
                    msg = "The %s class depends on the following modules or attributes which were not found on your system: %s"
                    raise RuntimeError(msg % (obj.__name__, failed))
                obj.__new__ = staticmethod(_error)
            elif isfunction(obj):
                body = "raise RuntimeError(\"The %s function depends on the following modules or attributes which were not found on your system: %s\")" 
                return replace_funct(obj, body % (obj.__name__, failed))
        return obj
            
    return _stub_if_missing
A class decorator that will try to import the specified modules and in
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/decorators.py/stub_if_missing_deps