human
I wrote the below code

    (etype, evalue, etb) = sys.exc_info()
    if isinstance(etype, types.ClassType):
        etype = etype.__name__
    s = {u'pyver': u'Python    {version:s}:    {executable:s}    (prefix:    {prefix:s})'.format(version=sys.version.split()[0], executable=sys.executable, prefix=sys.prefix), u'timestamp': cstr(datetime.datetime.now()), u'traceback': traceback.format_exc(), u'frames': [], u'etype': cstr(etype), u'evalue': cstr(`evalue`), u'exception': {}, u'locals': {}}
    records = inspect.getinnerframes(etb, 5)
    for (frame, file, lnum, func, lines, index) in records:
        file = ((file and os.path.abspath(file)) or u'?')
        (args, varargs, varkw, locals) = inspect.getargvalues(frame)
        call = u''
        if (func != u'?'):
            call = inspect.formatargvalues(args, varargs, varkw, locals, formatvalue=(lambda value: u'={}'.format(pydoc.text.repr(value))))
        f = {u'file': file, u'func': func, u'call': call, u'lines': {}, u'lnum': lnum}
        def reader(lnum=[lnum]):
            try:
                return linecache.getline(file, lnum[0])
            finally:
                lnum[0] += 1
        vars = cgitb.scanvars(reader, frame, locals)
        if (index is not None):
            i = (lnum - index)
            for line in lines:
                f[u'lines'][i] = line.rstrip()
                i += 1
        f[u'dump'] = {}
        for (name, where, value) in vars:
            if (name in f[u'dump']):
                continue
            if (value is not cgitb.__UNDEF__):
                if (where == u'global'):
                    name = u'global    {name:s}'.format(name=name)
                elif (where != u'local'):
                    name = ((where + u'    ') + name.split(u'.')[(-1)])
                f[u'dump'][name] = pydoc.text.repr(value)
            else:
                f[u'dump'][name] = u'undefined'
        s[u'frames'].append(f)
    if isinstance(evalue, BaseException):
        for name in dir(evalue):
            if (((name != u'messages') or (sys.version_info <...

What's a good function header?

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

def get_snapshot(exception, context=10):