def check_dependencies(dependencies):
    def module_exists(dep):
        try:
            imp.find_module(dep)
            return True
        except ImportError:
            return False

    for dep in dependencies:
        if len(dep) == 1:
            import_name, pkg_name = dep[0], dep[0]
        elif len(dep) == 2:
            import_name, pkg_name = dep
        else:
            raise ValueError(dep)

        if not module_exists(import_name):
            lines = [
                '-' * 50,
                'Warning: This package requires %r. Try' % import_name,
                '',
                pkg_name % '  $ conda install %s',
                '',
                'or:',
                '',
                '  $ pip install %s' % pkg_name,
                '-' * 50,
            ]
            print(os.linesep.join(lines), file=sys.stderr)
dataset/ETHPy150Open msmbuilder/osprey/basesetup.py/check_dependencies/swapped operands of `%`