human
I wrote the below code

    command = input.group(2)
    if (not command):
        return phenny.reply('Need    something    to    translate!')
    command = command.encode('utf-8')
    def langcode(p):
        return (p.startswith(':') and (2 < len(p) < 10) and p[1:].isalpha())
    args = ['auto', 'en']
    for i in xrange(2):
        if (not ('    ' in command)):
            break
        (prefix, cmd) = command.split('    ', 1)
        if langcode(prefix):
            args[i] = prefix[1:]
            command = cmd
    phrase = command
    (src, dest) = args
    if (src != dest):
        (msg, src) = translate(phrase, src, dest)
        if isinstance(msg, str):
            msg = msg.decode('utf-8')
        if msg:
            msg = web.decode(msg)
            if (len(msg) > 450):
                msg = (msg[:450] + '[...]')
            msg = ('"%s"    (%s    to    %s,    translate.google.com)' % (msg, src, dest))
        else:
            msg = ('The    %s    to    %s    translation    failed,    sorry!' % (src, dest))
        phenny.reply(msg)
    else:
        phenny.reply('Language    guessing    failed,    so    try    suggesting    one!')

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

def tr2(phenny, input):