boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof PyFile)) { return false; } PyCallExpression expression = PsiTreeUtil.getParentOfType(file.findElementAt(editor.getCaretModel().getOffset()), PyCallExpression.class); if (expression != null && expression.isCalleeText("dict")) { final TypeEvalContext context = TypeEvalContext.codeAnalysis(file.getProject(), file); PyType type = context.getType(expression); if (type != null && type.isBuiltin()) { PyExpression[] argumentList = expression.getArguments(); for (PyExpression argument : argumentList) { if (!(argument instanceof PyKeywordArgument)) return false; } return true; } } return false; }