LanguageLevel (@NotNull Collection<? extends @NotNull Sdk> pythonModuleSdks) { PythonRuntimeService pythonRuntimeService = PythonRuntimeService.getInstance(); return pythonModuleSdks.stream() .distinct() .map(sdk -> pythonRuntimeService.getLanguageLevelForSdk(sdk)) .max(LanguageLevel.VERSION_COMPARATOR) .orElse(LanguageLevel.getDefault()); }