human
I wrote the below code

    if (not hostname):
        return False
    if isinstance(trusted_list, string_types):
        trusted_list = [trusted_list]
    def _normalize(hostname):
        if (':' in hostname):
            hostname = hostname.rsplit(':', 1)[0]
        return _encode_idna(hostname)
    try:
        hostname = _normalize(hostname)
    except UnicodeError:
        return False
    for ref in trusted_list:
        if ref.startswith('.'):
            ref = ref[1:]
            suffix_match = True
        else:
            suffix_match = False
        try:
            ref = _normalize(ref)
        except UnicodeError:
            return False
        if (ref == hostname):
            return True
        if (suffix_match and hostname.endswith(('.' + ref))):
            return True
    return False

What's a good function header?

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

def host_is_trusted(hostname, trusted_list):