from typing import OrderedDict


def parse_etc_hosts_entries( hosts ):
    """
    >>> parse_etc_hosts_entries("").items()
    []
    >>> parse_etc_hosts_entries("foo:1.2.3.4").items()
    [('foo', '1.2.3.4')]
    >>> parse_etc_hosts_entries(" foo : 1.2.3.4 , bar : 2.3.4.5 ").items()
    [('foo', '1.2.3.4'), ('bar', '2.3.4.5')]
    """
    return OrderedDict( (ip.strip( ), name.strip( ))
        for ip, name in (entry.split( ':', 1 )
        for entry in hosts.split( ',' ) if entry) )