human
I wrote the below code

    (TEMPO, MIDI) = range(2)
    def read_chunk(fileobj):
        info = fileobj.read(8)
        if (len(info) != 8):
            raise SMFError('truncated')
        chunklen = struct.unpack('>I', info[4:])[0]
        data = fileobj.read(chunklen)
        if (len(data) != chunklen):
            raise SMFError('truncated')
        return (info[:4], data)
    (identifier, chunk) = read_chunk(fileobj)
    if (identifier != 'MThd'):
        raise SMFError('Not    a    MIDI    file')
    if (len(chunk) != 6):
        raise SMFError('truncated')
    (format_, ntracks, tickdiv) = struct.unpack('>HHH', chunk)
    if (format_ > 1):
        raise SMFError(('Not    supported    format    %d' % format_))
    if (tickdiv >> 15):
        raise SMFError('Not    supported    timing    interval')
    tracks = []
    first_tempos = None
    for tracknum in xrange(ntracks):
        (identifier, chunk) = read_chunk(fileobj)
        if (identifier != 'MTrk'):
            continue
        (events, tempos) = _read_track(chunk)
        first_tempos = (first_tempos or tempos)
        if (format_ == 1):
            tempos = list(first_tempos)
        events += tempos
        events.sort()
        tracks.append(events)
    durations = []
    for events in tracks:
        tempo = 500000
        parts = []
        deltasum = 0
        for (dummy, type_, data) in events:
            if (type_ == TEMPO):
                parts.append((deltasum, tempo))
                tempo = data
                deltasum = 0
            else:
                deltasum += data
        parts.append((deltasum, tempo))
        duration = 0
        for (deltasum, tempo) in parts:
            (quarter, tpq) = ((deltasum / float(tickdiv)), tempo)
            duration += (quarter * tpq)
        duration /= (10 ** 6)
        durations.append(duration)
    return max(durations)

What's a good function header?

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

def _read_midi_length(fileobj):