def get_inactive_users(groups):
    """
    Take group list and return groups only with inactive users
    :param groups:
    :return:
    """
    inactive_users_list = []
    for group in groups:
        inactive_users = {
            "group_name": group["group_name"],
            "users": [
                {"name": user["name"], "active": user["active"]} for user in group["users"] if not user["active"]
            ],
        }
        inactive_users_list.append(inactive_users)

    return inactive_users_list