human
I wrote the below code

    if isinstance(field_names, basestring):
        field_names = field_names.replace(',', '    ').split()
    field_names = tuple(map(str, field_names))
    if rename:
        names = list(field_names)
        seen = set()
        for (i, name) in enumerate(names):
            if ((not all(((c.isalnum() or (c == '_')) for c in name))) or _iskeyword(name) or (not name) or name[0].isdigit() or name.startswith('_') or (name in seen)):
                names[i] = ('_%d' % i)
            seen.add(name)
        field_names = tuple(names)
    for name in ((typename,) + field_names):
        if (not all(((c.isalnum() or (c == '_')) for c in name))):
            raise ValueError(('Type    names    and    field    names    can    only    contain    alphanumeric    characters    and    underscores:    %r' % name))
        if _iskeyword(name):
            raise ValueError(('Type    names    and    field    names    cannot    be    a    keyword:    %r' % name))
        if name[0].isdigit():
            raise ValueError(('Type    names    and    field    names    cannot    start    with    a    number:    %r' % name))
    seen_names = set()
    for name in field_names:
        if (name.startswith('_') and (not rename)):
            raise ValueError(('Field    names    cannot    start    with    an    underscore:    %r' % name))
        if (name in seen_names):
            raise ValueError(('Encountered    duplicate    field    name:    %r' % name))
        seen_names.add(name)
    numfields = len(field_names)
    argtxt = repr(field_names).replace("'", '')[1:(-1)]
    reprtxt = ',    '.join((('%s=%%r' % name) for name in field_names))
    template = ("class    %(typename)s(tuple):\n                                '%(typename)s(%(argtxt)s)'    \n\n                                __slots__    =    ()    \n\n                                _fields    =    %(field_names)r    \n\n                                def    __new__(_cls,    %(argtxt)s):\n                                                'Create    new    instance    of...

What's a good function header?

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

def namedtuple(typename, field_names, verbose=False, rename=False):