Ref<PyExpression> (@NotNull PyDictLiteralExpression expression, @NotNull String mappingKey, boolean isNumeric, boolean allKeysForSure) { final LanguageLevel languageLevel = LanguageLevel.forElement(expression); PyDoubleStarExpression[] starExpressions = PsiTreeUtil.getChildrenOfType(expression, PyDoubleStarExpression.class); if (languageLevel.isAtLeast(LanguageLevel.PYTHON35) && starExpressions != null) { for (PyDoubleStarExpression expr : starExpressions) { PyExpression underStarExpr = PyPsiUtils.flattenParens(expr.getExpression()); if (underStarExpr != null) { if (underStarExpr instanceof PyDictLiteralExpression) { Ref<PyExpression> element; if (isNumeric) { element = getElementFromDictLiteral((PyDictLiteralExpression)underStarExpr, Integer.valueOf(mappingKey)); } else { element = getElementFromDictLiteral((PyDictLiteralExpression)underStarExpr, mappingKey); } allKeysForSure = element != null; if (element != null && !element.isNull()) return element; } else if (underStarExpr instanceof PyCallExpression) { Ref<PyExpression> element = resolveDictCall((PyCallExpression)underStarExpr, mappingKey, true); allKeysForSure = element != null; if (element != null && !element.isNull()) return element; } else { allKeysForSure = false; } } } } return allKeysForSure ? Ref.create() : null; }