def required_modules_error(name, docstring):
    modules = required_module_list(docstring)
    if not modules:
        return ''
    filename = os.path.basename(name).split('.')[0]
    msg = '\'{0}\' requires these python modules: {1}'
    return msg.format(filename, ', '.join(modules))
Pretty print error messages in critical salt modules which are
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/required_modules_error