human
I wrote the below code

    if (bytes is str):
        kw = dict(default=objectSaveHook, encoding='charmap', skipkeys=True)
    else:
        def default(unencodable):
            '\n                                                Serialize    an    object    not    otherwise    serializable    by    L{dumps}.\n\n                                                @param    unencodable:    An    unencodable    object.\n                                                @return:    C{unencodable},    serialized\n                                                '
            if isinstance(unencodable, bytes):
                return unencodable.decode('charmap')
            return objectSaveHook(unencodable)
        kw = dict(default=default, skipkeys=True)
    flattenEvent(event)
    result = dumps(event, **kw)
    if (not isinstance(result, unicode)):
        return unicode(result, 'utf-8', 'replace')
    return result

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

def eventAsJSON(event):