import copy


def _find_groups_with_no_members(group_list: list, user_list: list):
    """
    Identify groups with no members by going through the
    :param group_list: List of the groups in the account
    :param user_list:  List of the active IAM users in the account
    :return: List of groups which have no active IAM users as members
    """
    empty_groups = copy.deepcopy(group_list)
    for user in user_list:
        for group in user['GroupList']:
            try:
                group_obj = next(g for g in empty_groups if g['GroupName'] == group)
                empty_groups.remove(group_obj)
            except StopIteration:
                pass

    return empty_groups