List<String> (@NotNull final Sdk sdk, @Nullable final String skeletonsPath) { final File skeletons = skeletonsPath != null ? new File(skeletonsPath) : null; final VirtualFile userSkeletonsDir = PyUserSkeletonsUtil.getUserSkeletonsDirectory(); final File userSkeletons = userSkeletonsDir != null ? new File(userSkeletonsDir.getPath()) : null; final VirtualFile remoteSourcesDir = PythonSdkUtil.findAnyRemoteLibrary(sdk); final File remoteSources = remoteSourcesDir != null ? new File(remoteSourcesDir.getPath()) : null; return ContainerUtil.mapNotNull(sdk.getRootProvider().getFiles(OrderRootType.CLASSES), file -> { if (file.isInLocalFileSystem()) { // We compare canonical files, not strings because "c:/some/folder" equals "c:\\some\\bin\\..\\folder\\" final File canonicalFile = new File(file.getPath()); if (canonicalFile.exists() && !FileUtil.filesEqual(canonicalFile, skeletons) && !FileUtil.filesEqual(canonicalFile, userSkeletons) && !PyTypeShed.INSTANCE.isInside(file) && !FileUtil.filesEqual(canonicalFile, remoteSources)) { return file.getPath(); } } return null; }); }