'Parse a line from a host file.
Args:
line: The bytes object to parse.
Returns:
True if parsing succeeded, False otherwise.'

def _parse_line(self, line):

    if line.startswith('#'):
        return True
    try:
        line = line.decode('utf-8')
    except UnicodeDecodeError:
        log.misc.error('Failed    to    decode:    {!r}'.format(line))
        return False
    try:
        hash_idx = line.index('#')
        line = line[:hash_idx]
    except ValueError:
        pass
    line = line.strip()
    if (not line):
        return True
    parts = line.split()
    if (len(parts) == 1):
        host = parts[0]
    elif (len(parts) == 2):
        host = parts[1]
    else:
        log.misc.error('Failed    to    parse:    {!r}'.format(line))
        return False
    if (host not in self.WHITELISTED):
        self._blocked_hosts.add(host)
    return True
