void (PyFunction method, @NotNull final PsiFile file) { method = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(method); final TemplateBuilder builder = TemplateBuilderFactory.getInstance().createTemplateBuilder(method); ParamHelper.walkDownParamArray( method.getParameterList().getParameters(), new ParamHelper.ParamVisitor() { @Override public void visitNamedParameter(PyNamedParameter param, boolean first, boolean last) { builder.replaceElement(param, param.getName()); } } ); // TODO: detect expected return type from call site context: PY-1863 builder.replaceElement(method.getStatementList(), "return None"); PythonTemplateRunner.runTemplate(file, builder); }