@NotNull
  public static PsiElement appendToMethod(PyFunction init, Function<? super String, ? extends PyStatement> callback) {
    // add this field as the last stmt of the constructor
    final PyStatementList statementList = init.getStatementList();
    // name of 'self' may be different for fancier styles
    String selfName = PyNames.CANONICAL_SELF;
    final PyParameter[] params = init.getParameterList().getParameters();
    if (params.length > 0) {
      selfName = params[0].getName();
    }
    final PyStatement newStmt = callback.apply(selfName);
    final PsiElement result = PyPsiRefactoringUtil.addElementToStatementList(newStmt, statementList, true);
    PyPsiUtils.removeRedundantPass(statementList);
    return result;
  }
@NotNull
  public static PsiElement appendToMethod(PyFunction init, Function<? super String, ? extends PyStatement> callback)