human
I wrote the below code

    class DistinctList(list, ):
        "\n                                List,    which    allows    one    to    append    only    distinct    objects.\n                                Needs    to    work    on    Python    2.6,    because    of    collections.OrderedDict    only    since    2.7    version.\n                                Override    'filter()'    for    custom    filtering.\n                                "
        localhost_matchers = ['localhost.*', 'ip6-.*', '127[.]\\d', '0\\.0\\.0\\.0', '::1.*', 'ipv6-.*', 'fe00::.*', 'fe02::.*', '1.0.0.*.ip6.arpa']
        def append(self, p_object):
            if (p_object and (p_object not in self) and (not self.filter(p_object))):
                super(self.__class__, self).append(p_object)
            return self
        def extend(self, iterable):
            for obj in iterable:
                self.append(obj)
            return self
        def filter(self, element):
            'Returns    True    if    element    needs    to    be    filtered'
            for rgx in self.localhost_matchers:
                if re.match(rgx, element):
                    return True
        def first(self):
            return ((self and self[0]) or None)
    hosts = DistinctList().append(socket.getfqdn()).append(platform.node()).append(socket.gethostname())
    if (not hosts):
        try:
            for a_nfo in socket.getaddrinfo((hosts.first() or 'localhost'), None, socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP, socket.AI_CANONNAME):
                if (len(a_nfo) > 3):
                    hosts.append(a_nfo[3])
        except socket.gaierror:
            log.warning('Cannot    resolve    address    {addr}    info    via    socket:    {message}'.format(addr=(hosts.first() or 'localhost    (N/A)'), message=socket.gaierror))
    for f_name in ['/etc/hostname', '/etc/nodename', '/etc/hosts', '{win}\\system32\\drivers\\etc\\hosts'.format(win=os.getenv('WINDIR'))]:
        if (not os.path.exists(f_name)):
            continue
        with...

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

def _generate_minion_id():