GlobalSearchScope () { if (mySdk != null) { return StreamEx.of(mySdk.getRootProvider().getFiles(OrderRootType.CLASSES)) .filter(root -> PyTypeShed.INSTANCE.isInside(root) && PyTypeShed.INSTANCE.isInThirdPartyLibraries(root)) .map(dir -> GlobalSearchScopesCore.directoryScope(myProject, dir, true)) .reduce(GlobalSearchScope.EMPTY_SCOPE, GlobalSearchScope::union); } return GlobalSearchScope.EMPTY_SCOPE; }