human
Here's a good function header given the following:
I wrote the below code

    def as_escaped_unicode(thing, escape_chars=escape_chars):
        try:
            result = compat.text_type(thing)
        except UnicodeDecodeError:
            result = str(thing).decode('utf-8', 'replace')
        translate = {' DCTB ': '\\t', '\n': '\\n', '\r': '\\r'}
        if isinstance(escape_chars, dict):
            if default_escapes:
                translate.update(escape_chars)
            else:
                translate = escape_chars
            escape_chars = list(escape_chars.keys())
        else:
            escape_chars = (escape_chars or tuple())
        for c in escape_chars:
            result = result.replace(c, translate[c])
        return compat.text_type(result)
    if ((compat.PY3 and hasattr(thing, '__next__')) or hasattr(thing, 'next')):
        return compat.text_type(thing)
    elif (isinstance(thing, dict) and (_nest_lvl < get_option('display.pprint_nest_depth'))):
        result = _pprint_dict(thing, _nest_lvl, quote_strings=True, max_seq_items=max_seq_items)
    elif (is_sequence(thing) and (_nest_lvl < get_option('display.pprint_nest_depth'))):
        result = _pprint_seq(thing, _nest_lvl, escape_chars=escape_chars, quote_strings=quote_strings, max_seq_items=max_seq_items)
    elif (isinstance(thing, compat.string_types) and quote_strings):
        if compat.PY3:
            fmt = "'%s'"
        else:
            fmt = "u'%s'"
        result = (fmt % as_escaped_unicode(thing))
    else:
        result = as_escaped_unicode(thing)
    return compat.text_type(result)

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

def pprint_thing(thing, _nest_lvl=0, escape_chars=None, default_escapes=False, quote_strings=False, max_seq_items=None):