human
Here's a good function header given the following:
I wrote the below code

    def _add_xml(elem, name, value):
        XML.SubElement(elem, name).text = value
    gitlab = XML.SubElement(xml_parent, 'com.dabsquared.gitlabjenkins.GitLabPushTrigger')
    plugin_info = registry.get_plugin_info('GitLab    Plugin')
    plugin_ver = pkg_resources.parse_version(plugin_info.get('version', '0'))
    valid_merge_request = ['never', 'source', 'both']
    if (plugin_ver >= pkg_resources.parse_version('1.1.26')):
        mapping = [('trigger-open-merge-request-push', 'triggerOpenMergeRequestOnPush', 'never', valid_merge_request)]
        convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
    else:
        mapping = [('trigger-open-merge-request-push', 'triggerOpenMergeRequestOnPush', True)]
        convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
    if (plugin_ver < pkg_resources.parse_version('1.2.0')):
        if (data.get('branch-filter-type', '') == 'All'):
            data['branch-filter-type'] = ''
        valid_filters = ['', 'NameBasedFilter', 'RegexBasedFilter']
        mapping = [('branch-filter-type', 'branchFilterName', '', valid_filters)]
        convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
    else:
        valid_filters = ['All', 'NameBasedFilter', 'RegexBasedFilter']
        mapping = [('branch-filter-type', 'branchFilterType', 'All', valid_filters)]
        convert_mapping_to_xml(gitlab, data, mapping, fail_required=True)
    XML.SubElement(gitlab, 'spec').text = ''
    mapping = [('trigger-push', 'triggerOnPush', True), ('trigger-merge-request', 'triggerOnMergeRequest', True), ('trigger-note', 'triggerOnNoteRequest', True), ('note-regex', 'noteRegex', 'Jenkins    please    retry    a    build'), ('ci-skip', 'ciSkip', True), ('wip-skip', 'skipWorkInProgressMergeRequest', True), ('set-build-description', 'setBuildDescription', True), ('add-note-merge-request', 'addNoteOnMergeRequest', True), ('add-vote-merge-request', 'addVoteOnMergeRequest', True), ('accept-merge-request-on-success', 'acceptMergeRequestOnSuccess', False),...

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

def gitlab(registry, xml_parent, data):