def module_exists(module_name):
    try:
        __import__(module_name)
    except ImportError:
        return False
    else:
        return True
Checks if a module exists and can be imported
dataset/ETHPy150Open maebert/jrnl/jrnl/install.py/module_exists