PyFunction () { PyElementGenerator generator = PyElementGenerator.getInstance(mySettingAnchor.getProject()); return generator.createFromText(LanguageLevel.forElement(mySettingAnchor), PyFunction.class, buildText(generator)); }