def METHOD_NAME(path: Path | str, names: list[str]) -> set[str]:
    filtered_files = {
        (root / f).resolve() for f in REMOVED_FILES + UNVENDORED_FILES
    }
    # We have JS implementations of these modules, so we don't need to
    # include the Python ones. Checking the name of the root directory
    # is a bit of a hack, but it works...
    if root.name.startswith("python3"):
        filtered_files.update({root / f for f in JS_STUB_FILES})
    path = Path(path).resolve()
    if _should_skip(path):
        return set(names)
    _names = []
    for name in names:
        fullpath = path / name
        if _should_skip(fullpath) or fullpath in filtered_files:
            if verbose:
                print(f"Skipping {fullpath}")
            _names.append(name)
    return set(_names)