def METHOD_NAME(self) -> None:
    with tempfile.TemporaryDirectory() as td:
        self.make_file(td, "base/a/")
        self.make_file(td, "base/b.py")
        self.make_file(td, "base/c.pyi")
        self.make_file(td, "base/missing.txt")
        self.make_file(td, "typeshed/d.pyi")
        self.make_file(td, "typeshed/@python2/e")  # outdated
        self.make_file(td, "pkg1/f-stubs")
        self.make_file(td, "pkg2/g-python2-stubs")  # outdated
        self.make_file(td, "mpath/sub/long_name/")
        def makepath(p: str) -> str:
            return os.path.join(td, p)
        search = SearchPaths(
            python_path=(makepath("base"),),
            mypy_path=(makepath("mpath/sub"),),
            package_path=(makepath("pkg1"), makepath("pkg2")),
            typeshed_path=(makepath("typeshed"),),
        )
        fscache = FileSystemCache()
        res = filter_out_missing_top_level_packages(
            {"a", "b", "c", "d", "e", "f", "g", "long_name", "ff", "missing"}, search, fscache
        )
        assert res == {"a", "b", "c", "d", "f", "long_name"}