Object (@NotNull PyCallExpression expression) { final PyExpression[] args = expression.getArguments(); if (expression.isCalleeText(PyNames.REPLACE) && args.length == 2) { final PyExpression callee = expression.getCallee(); if (callee instanceof PyQualifiedExpression) { final Object evaluatedQualifier = evaluate(((PyQualifiedExpression)callee).getQualifier()); if (evaluatedQualifier instanceof String) { final Object oldSubstring = evaluate(args[0]); final Object newSubstring = evaluate(args[1]); if (oldSubstring instanceof String && newSubstring instanceof String) { return ((String)evaluatedQualifier).replace((String)oldSubstring, (String)newSubstring); } } } } // Support dict([("k", "v")]) syntax if (myEnableResolve && NameResolverTools.isCalleeShortCut(expression, PythonFQDNNames.DICT_CLASS)) { final Collection<PyTupleExpression> tuples = PsiTreeUtil.findChildrenOfType(expression, PyTupleExpression.class); if (!tuples.isEmpty()) { final Map<Object, Object> result = new HashMap<>(); for (final PyTupleExpression tuple : tuples) { final PsiElement[] tupleElements = tuple.getChildren(); if (tupleElements.length != 2) { return null; } final PyExpression key = PyUtil.as(tupleElements[0], PyExpression.class); final PyExpression value = PyUtil.as(tupleElements[1], PyExpression.class); if (key != null) { addRecordFromDict(result, key, value); } } return result; } final PyExpression[] arguments = expression.getArguments(); //dict(foo="spam") if (arguments.length > 0) { final Map<Object, Object> result = new HashMap<>(); for (final PyExpression argument : arguments) { if (!(argument instanceof PyKeywordArgument keywordArgument)) { continue; } final String keyword = keywordArgument.getKeyword(); if (keyword == null) { continue; } addRecordFromDict(result, keyword, keywordArgument.getValueExpression()); } return result; } } return null; }