<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _list_hosts():
    '''
    Return the hosts found in the hosts file in as an OrderedDict
    '''
    try:
        return __context__['hosts._list_hosts']
    except KeyError:
        count = 0
        hfn = __get_hosts_filename()
        ret = odict.OrderedDict()
        try:
            with salt.utils.files.fopen(hfn) as ifile:
                for line in ifile:
                    line = salt.utils.stringutils.to_unicode(line).strip()
                    if not line:
                        continue
                    if line.startswith('#'):
                        ret.setdefault('comment-{0}'.format(count), []).append(line)
                        count += 1
                        continue
                    if '#' in line:
                        line = line[:line.index('#')].strip()
                    comps = line.split()
                    ip = comps.pop(0)
                    ret.setdefault(ip, []).extend(comps)
        except (IOError, OSError) as exc:
            salt.utils.files.process_read_exception(exc, hfn, ignore=errno.ENOENT)
            # Don't set __context__ since we weren't able to read from the
            # hosts file.
            return ret

        __context__['hosts._list_hosts'] = ret
        return ret