void (final String name) { final PyElementGenerator pyElementGenerator = PyElementGenerator.getInstance(getProject()); add(pyElementGenerator.createComma().getPsi()); add(pyElementGenerator.createFromText(LanguageLevel.getDefault(), PyGlobalStatement.class, "global " + name).getGlobals()[0]); }