Comparator<PyImportStatementBase> (@NotNull PsiFile settingsAnchor) { if (PythonCodeStyleService.getInstance().isOptimizeImportsSortedByTypeFirst(settingsAnchor)) { return IMPORT_TYPE_COMPARATOR.thenComparing(getImportStatementComparator(settingsAnchor)); } else { return getImportStatementComparator(settingsAnchor).thenComparing(IMPORT_TYPE_COMPARATOR); } }