def scan(self):
        found = []
        missing = []

        node = self.inputs[0]
        if not hasattr(self, "name"):
            module_name = f2py_modulename(node)
        else:
            module_name = self.name

        includes = include_pyf(node)
        if includes:
            real_pyf = node.parent.find_or_declare("%s.pyf" % module_name)
            # Guard against overwriting existing source code by accident. Did I
            # say I hate find_or_declare ?
            assert real_pyf.is_bld()

            for inc in includes:
                x = node.parent.find_resource(inc)
                if x:
                    found.append(x)
                else:
                    missing.append(x)
        user_routines = node.parent.find_resource("%s_user_routines.pyf" % module_name)
        if user_routines:
            found.append(user_routines)
        return (found, missing)
dataset/ETHPy150Open cournape/Bento/bento/backends/waf_tools/f2py.py/f2py_interface.scan/original