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

    import re
    if isinstance(escapes, basestring):
        if (escapes == 'eol'):
            escapes = {'\r\n': '\\r\\n\r\n', '\n': '\\n\n', '\r': '\\r\r'}
        elif (escapes == 'whitespace'):
            escapes = {'\r\n': '\\r\\n\r\n', '\n': '\\n\n', '\r': '\\r\r', ' DCTB ': '\\t', '    ': '.'}
        elif (escapes == 'eol-one-line'):
            escapes = {'\n': '\\n', '\r': '\\r'}
        elif (escapes == 'whitespace-one-line'):
            escapes = {'\n': '\\n', '\r': '\\r', ' DCTB ': '\\t', '    ': '.'}
        else:
            raise ValueError(('unknown    text    escape    style:    %r' % escapes))
    escapes_keys = escapes.keys()
    try:
        escapes_keys.sort(key=(lambda a: len(a)), reverse=True)
    except TypeError:
        escapes_keys.sort((lambda a, b: cmp(len(a), len(b))))
        escapes_keys.reverse()
    def repl(match):
        val = escapes[match.group(0)]
        return val
    escaped = re.sub(('(%s)' % '|'.join([re.escape(k) for k in escapes_keys])), repl, text)
    return escaped

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

def _escaped_text_from_text(text, escapes='eol'):