def get_group_dict(user=None, include_default=True):
    if HAS_GRP is False or HAS_PWD is False:
        # We don't work on platforms that don't have grp and pwd
        # Just return an empty dict
        return {}
    group_dict = {}
    group_names = get_group_list(user, include_default=include_default)
    for group in group_names:
        group_dict.update({group: grp.getgrnam(group).gr_gid})
    return group_dict
Returns a dict of all of the system groups as keys, and group ids
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/get_group_dict