PyExpression (@NotNull PyExpression expression, @NotNull String key) { final PyExpression containedExpr = PyPsiUtils.flattenParens(expression); if (PsiTreeUtil.instanceOf(containedExpr, PyDictLiteralExpression.class)) { final Ref<PyExpression> resolvedRef = getElementFromDictLiteral((PyDictLiteralExpression)containedExpr, key); return resolvedRef != null ? resolvedRef.get() : containedExpr; } else if (PsiTreeUtil.instanceOf(containedExpr, PyLiteralExpression.class, PySetLiteralExpression.class, PyListLiteralExpression.class, PyTupleExpression.class)) { return null; } else if (containedExpr instanceof PyCallExpression) { if (myChunk.getMappingKey() != null) { Ref<PyExpression> elementRef = resolveDictCall((PyCallExpression)containedExpr, myChunk.getMappingKey(), true); if (elementRef != null) return elementRef.get(); } } return containedExpr; }