def apply(dc, state, focus=False):

    ct = len(dc[0].subsets)

    sub = dc[0].edit_subset
    if isinstance(sub, list):
        sub = None if len(sub) == 0 else sub[0]

    old_state = None
    if sub is not None:
        old_state = sub.subset_state

    mode = EditSubsetMode()
    mode.mode = ReplaceMode
    mode.update(dc, state, dc[0] if focus else None)

    print(len(dc[0].subsets))
    did_add = len(dc[0].subsets) > ct
    did_apply = sub is not None and sub.subset_state is not old_state
    return did_add, did_apply
Update data collection, return did_add, did_apply for
dataset/ETHPy150Open glue-viz/glue/glue/core/tests/test_edit_subset_mode.py/apply