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

    def _course_info_content(html_parsed):
        '\n                                Constructs    the    HTML    for    the    course    info    update,    not    including    the    header.\n                                '
        if (len(html_parsed) == 1):
            content = html_parsed[0].tail
        else:
            content = (html_parsed[0].tail if (html_parsed[0].tail is not None) else '')
            content += '\n'.join([html.tostring(ele) for ele in html_parsed[1:]])
        return content
    if (course_updates and getattr(course_updates, 'items', None)):
        if (provided_index and (0 < provided_index <= len(course_updates.items))):
            return course_updates.items[(provided_index - 1)]
        else:
            return list(reversed(course_updates.items))
    course_update_items = []
    if course_updates:
        try:
            course_html_parsed = html.fromstring(course_updates.data)
        except (etree.XMLSyntaxError, etree.ParserError):
            log.error(('Cannot    parse:    ' + course_updates.data))
            escaped = escape(course_updates.data)
            course_html_parsed = html.fromstring((('<ol><li>' + escaped) + '</li></ol>'))
        if (course_html_parsed.tag == 'ol'):
            for (index, update) in enumerate(course_html_parsed):
                if (len(update) > 0):
                    content = _course_info_content(update)
                    computed_id = (len(course_html_parsed) - index)
                    payload = {'id': computed_id, 'date': update.findtext('h2'), 'content': content}
                    if (provided_index == 0):
                        course_update_items.append(payload)
                    elif (provided_index == computed_id):
                        return payload
    return course_update_items

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

def get_course_update_items(course_updates, provided_index=0):