human
I wrote the below code

    if (not rows):
        return
    if hasattr(rows[0], u'_fields'):
        headers = rows[0]._fields
    else:
        headers = [u'col{}'.format(i) for i in range(len(rows[0]))]
    lens = [len(s) for s in headers]
    for row in rows:
        for i in range(len(rows[0])):
            slenght = len(u'{}'.format(row[i]))
            if (slenght > lens[i]):
                lens[i] = slenght
    formats = []
    hformats = []
    for i in range(len(rows[0])):
        if isinstance(rows[0][i], int):
            formats.append((u'%%%dd' % lens[i]))
        else:
            formats.append((u'%%-%ds' % lens[i]))
        hformats.append((u'%%-%ds' % lens[i]))
    pattern = u'    |    '.join(formats)
    hpattern = u'    |    '.join(hformats)
    separator = u'-+-'.join([(u'-' * n) for n in lens])
    s = u''
    s += (separator + u'\n')
    s += ((hpattern % tuple(headers)) + u'\n')
    s += (separator + u'\n')
    def f(t):
        return (u'{}'.format(t) if isinstance(t, basestring) else t)
    for line in rows:
        s += ((pattern % tuple((f(t) for t in line))) + u'\n')
    s += (separator + u'\n')
    return s

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

def pprinttable(rows):