LanguageLevel (@NotNull Sdk sdk) { final String versionString = sdk.getVersionString(); if (versionString != null) { final Matcher matcher = VERSION_STRING_RE.matcher(versionString); if (matcher.matches()) { final String version = matcher.group(1); final String pythonVersion = matcher.group(3); if (pythonVersion != null) { return LanguageLevel.fromPythonVersion(pythonVersion); } else if (version != null) { return LanguageLevel.fromPythonVersion(getPythonVersion(version)); } } } return LanguageLevel.getDefault(); }