human
I wrote the below code

    from itertools import islice
    from datetime import datetime
    import sys
    now = start = datetime.now()
    elapsed = (start - start)
    if (estimate is None):
        try:
            estimate = len(it)
        except:
            pass
    def timedelta_to_seconds(td):
        return (((td.days * ((24 * 60) * 60)) + td.seconds) + (float(td.microseconds) / 1000000))
    def format_timedelta(td, sep=''):
        ret = []
        s = timedelta_to_seconds(td)
        if (s < 0):
            neg = True
            s *= (-1)
        else:
            neg = False
        if (s >= ((24 * 60) * 60)):
            days = int((s // ((24 * 60) * 60)))
            ret.append(('%dd' % days))
            s -= (days * ((24 * 60) * 60))
        if (s >= (60 * 60)):
            hours = int((s // (60 * 60)))
            ret.append(('%dh' % hours))
            s -= (hours * (60 * 60))
        if (s >= 60):
            minutes = int((s // 60))
            ret.append(('%dm' % minutes))
            s -= (minutes * 60)
        if (s >= 1):
            seconds = int(s)
            ret.append(('%ds' % seconds))
            s -= seconds
        if (not ret):
            return '0s'
        return (('-' if neg else '') + sep.join(ret))
    def format_datetime(dt, show_date=False):
        if show_date:
            return dt.strftime('%Y-%m-%d    %H:%M')
        else:
            return dt.strftime('%H:%M:%S')
    def deq(dt1, dt2):
        "Indicates    whether    the    two    datetimes'    dates    describe    the    same    (day,month,year)"
        (d1, d2) = (dt1.date(), dt2.date())
        return ((d1.day == d2.day) and (d1.month == d2.month) and (d1.year == d2.year))
    sys.stderr.write(('Starting    at    %s\n' % (start,)))
    it = iter(it)
    seen = 0
    while True:
        this_chunk = 0
        thischunk_started = datetime.now()
        for item in islice(it, verbosity):
            this_chunk += 1
            seen += 1
            (yield item)
        if (this_chunk < verbosity):
            break
        now...

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

def progress(it, verbosity=100, key=repr, estimate=None, persec=True):