def get_exclude_seg_ids(exclude_grp, all_segs):
    """
    get the segments to exclude
    :param exclude_grp: [dict] dictionary representing the exclude group from
    the exclude yml file
    :param all_segs: [array] all of the segments. this is needed if we are doing
    a reverse exclusion
    :return: [list like] the segments to exclude
    """
    # ex_segs are the sites to exclude
    if "seg_id_nats_ex" in exclude_grp.keys():
        ex_segs = exclude_grp["seg_id_nats_ex"]
    # exclude all *but* the "seg_id_nats_in"
    elif "seg_id_nats_in" in exclude_grp.keys():
        ex_mask = ~all_segs.isin(exclude_grp["seg_id_nats_in"])
        ex_segs = all_segs[ex_mask]
    else:
        ex_segs = all_segs
    return ex_segs