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

    if (format == 'SHORT_DATE'):
        format = '%x'
    elif (format == 'LONG_DATE'):
        format = ugettext('LONG_DATE_FORMAT')
        if (format == 'LONG_DATE_FORMAT'):
            format = DEFAULT_LONG_DATE_FORMAT
    elif (format == 'DATE_TIME'):
        format = ugettext('DATE_TIME_FORMAT')
        if (format == 'DATE_TIME_FORMAT'):
            format = DEFAULT_DATE_TIME_FORMAT
    elif (format == 'DAY_AND_TIME'):
        format = DEFAULT_DAY_AND_TIME_FORMAT
    elif (format == 'TIME'):
        format = '%X'
    def process_percent_code(match):
        '\n                                Convert    one    percent-prefixed    code    in    the    format    string.\n\n                                Called    by    re.sub    just    below.\n\n                                '
        code = match.group()
        if (code == '%'):
            raise ValueError('strftime    format    ends    with    raw    %')
        if (code == '%a'):
            part = pgettext('abbreviated    weekday    name', WEEKDAYS_ABBREVIATED[dtime.weekday()])
        elif (code == '%A'):
            part = pgettext('weekday    name', WEEKDAYS[dtime.weekday()])
        elif (code == '%b'):
            part = pgettext('abbreviated    month    name', MONTHS_ABBREVIATED[dtime.month])
        elif (code == '%B'):
            part = pgettext('month    name', MONTHS[dtime.month])
        elif (code == '%p'):
            part = pgettext('am/pm    indicator', AM_PM[(dtime.hour // 12)])
        elif (code == '%x'):
            actual_format = ugettext('SHORT_DATE_FORMAT')
            if (actual_format == 'SHORT_DATE_FORMAT'):
                actual_format = DEFAULT_SHORT_DATE_FORMAT
            if ('%x' in actual_format):
                actual_format = DEFAULT_SHORT_DATE_FORMAT
            part = strftime_localized(dtime, actual_format)
        elif (code == '%X'):
            actual_format = ugettext('TIME_FORMAT')
            if (actual_format == 'TIME_FORMAT'):
                actual_format = DEFAULT_TIME_FORMAT
            if ('%X'...

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

def strftime_localized(dtime, format):