human
I wrote the below code

    def replace_entity(match):
        (hash, hex, name) = (match.group(1), match.group(2), match.group(3))
        if ((hash == '#') or name.isdigit()):
            if (hex == ''):
                return unichr(int(name))
            if (hex in ('x', 'X')):
                return unichr(int(('0x' + name), 16))
        else:
            cp = htmlentitydefs.name2codepoint.get(name)
            return ((cp and unichr(cp)) or match.group())
    if isinstance(string, (str, unicode)):
        return RE_UNICODE.subn(replace_entity, string)[0]
    return string

What's a good function header?

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

def decode_entities(string):