human
I wrote the below code

    def gen_notification_entry(data_item, default, text):
        e = XML.SubElement(nm, 'entry')
        XML.SubElement(e, 'com.flowdock.jenkins.BuildResult').text = text
        XML.SubElement(e, 'boolean').text = str(data.get(data_item, default)).lower()
    def gen_setting(item, default):
        XML.SubElement(parent, ('notify%s' % item)).text = str(data.get(('notify-%s' % item.lower()), default)).lower()
    if ('token' not in data):
        raise MissingAttributeError('token')
    parent = XML.SubElement(xml_parent, 'com.flowdock.jenkins.FlowdockNotifier')
    XML.SubElement(parent, 'flowToken').text = data['token']
    XML.SubElement(parent, 'notificationTags').text = data.get('tags', '')
    XML.SubElement(parent, 'chatNotification').text = str(data.get('chat-notification', True)).lower()
    nm = XML.SubElement(parent, 'notifyMap')
    gen_notification_entry('notify-success', True, 'SUCCESS')
    gen_notification_entry('notify-failure', True, 'FAILURE')
    gen_notification_entry('notify-fixed', True, 'FIXED')
    gen_notification_entry('notify-unstable', False, 'UNSTABLE')
    gen_notification_entry('notify-aborted', False, 'ABORTED')
    gen_notification_entry('notify-notbuilt', False, 'NOT_BUILT')
    gen_setting('Success', True)
    gen_setting('Failure', True)
    gen_setting('Fixed', True)
    gen_setting('Unstable', False)
    gen_setting('Aborted', False)
    gen_setting('NotBuilt', False)

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def flowdock(registry, xml_parent, data):