def METHOD_NAME(self, module_name, source_code):
    # Avoid regular expression match if possible.
    if "_delvewheel_" not in source_code:
        return None
    match = re.search(
        r"(def _delvewheel_(?:init_)?patch_(.*?)\(\):\n.*?_delvewheel_(?:init_)?patch_\2\(\))",
        source_code,
        re.S,
    )
    if not match:
        return None
    delvewheel_version = match.group(2).replace("_", ".")
    code = match.group(1)
    code = code.replace("os.add_dll_directory", "add_dll_directory")
    code = code.replace("sys.version_info[:2] >= (3, 8)", "True")
    code = code.replace("sys.version_info[:2] >= (3, 10)", "True")
    self.dll_directory = None
    # Fake the "__file__" to the proper value to the exec.
    exec_globals = {
        "__file__": self.locateModule(module_name) + "\\__init__.py",
        "add_dll_directory": self._add_dll_directory,
    }
    self.dll_directory = None
    # We believe this should be the easiest, pylint: disable=exec-used
    exec(code, exec_globals)
    # Copy it over. For Anaconda we allow exceptions, when it's not an
    # Anaconda package, but a PyPI package, those mixes are acting strange.
    if not isAnacondaPython():
        assert self.dll_directory is not None, module_name
    # At least the "scs" package puts the top level package folder there
    # even with there being no DLLs anywhere, maybe a wrong usage of
    # delvewheel SCS, maybe only on Windows.
    if self.dll_directory is not None:
        self.dll_directory = os.path.normpath(self.dll_directory)
        if os.path.basename(self.dll_directory) in (
            "site-packages",
            "dist-packages",
            "vendor-packages",
        ):
            self.dll_directory = None
    self.dll_directories[module_name] = self.dll_directory
    if self.dll_directories[module_name]:
        self.info(
            "Detected usage of 'delvewheel' version '%s' in module '%s'."
            % (delvewheel_version, module_name.asString())
        )