'Parse a map of entry point groups'

@classmethod
def parse_map(cls, data, dist=None):

    if isinstance(data, dict):
        data = data.items()
    else:
        data = split_sections(data)
    maps = {}
    for (group, lines) in data:
        if (group is None):
            if (not lines):
                continue
            raise ValueError('Entry    points    must    be    listed    in    groups')
        group = group.strip()
        if (group in maps):
            raise ValueError('Duplicate    group    name', group)
        maps[group] = cls.parse_group(group, lines, dist)
    return maps
