human
I wrote the below code

    class _WcsValidateWcsResult(list, ):
        def __init__(self, key):
            self._key = key
        def __repr__(self):
            result = [u"        WCS    key    '{0}':".format((self._key or u'    '))]
            if len(self):
                for entry in self:
                    for (i, line) in enumerate(entry.splitlines()):
                        if (i == 0):
                            initial_indent = u'                -    '
                        else:
                            initial_indent = u'                        '
                        result.extend(textwrap.wrap(line, initial_indent=initial_indent, subsequent_indent=u'                        '))
            else:
                result.append(u'                No    issues.')
            return u'\n'.join(result)
    class _WcsValidateHduResult(list, ):
        def __init__(self, hdu_index, hdu_name):
            self._hdu_index = hdu_index
            self._hdu_name = hdu_name
            list.__init__(self)
        def __repr__(self):
            if len(self):
                if self._hdu_name:
                    hdu_name = u'    ({0})'.format(self._hdu_name)
                else:
                    hdu_name = u''
                result = [u'HDU    {0}{1}:'.format(self._hdu_index, hdu_name)]
                for wcs in self:
                    result.append(repr(wcs))
                return u'\n'.join(result)
            return u''
    class _WcsValidateResults(list, ):
        def __repr__(self):
            result = []
            for hdu in self:
                content = repr(hdu)
                if len(content):
                    result.append(content)
            return u'\n\n'.join(result)
    global __warningregistry__
    if isinstance(source, fits.HDUList):
        hdulist = source
    else:
        hdulist = fits.open(source)
    results = _WcsValidateResults()
    for (i, hdu) in enumerate(hdulist):
        hdu_results = _WcsValidateHduResult(i, hdu.name)
        results.append(hdu_results)
        with...

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

def validate(source):