def METHOD_NAME(self, id='', name='', desc='', icon='',
                  funcs=None, mod=False):
    fd, fn = mkstemp(suffix='.py', text=True, dir=self.tempdir)
    file = os.fdopen(fd, 'w')
    if mod:
        indent = ''
    else:
        file.write(
            "from quodlibet.plugins.songsmenu import SongsMenuPlugin\n")
        file.write("class %s(SongsMenuPlugin):\n" % name)
        indent = '    '
        file.write("%spass\n" % indent)
    if name:
        file.write("%sPLUGIN_ID = %r\n" % (indent, name))
    if name:
        file.write("%sPLUGIN_NAME = %r\n" % (indent, name))
    if desc:
        file.write("%sPLUGIN_DESC = %r\n" % (indent, desc))
    if icon:
        file.write("%sPLUGIN_ICON = %r\n" % (indent, icon))
    for f in (funcs or []):
        if f in ["__init__"]:
            file.write("%sdef %s(self, *args): super().__init__("
                       "*args); raise Exception(\"as expected\")\n"
                       % (indent, f))
        else:
            file.write("%sdef %s(*args): return args\n" % (indent, f))
    file.flush()
    file.close()