def handle_group_slice(
    state: fos.StateDescription, group_slice: t.Optional[str] = None
):
    """Handle a group slice.

    Args:
        state: the state description
        group_slice (None): an optional group slice

    Returns:
        True/False indicating if a state update event should be dispatched
    """
    collection = state.view if state.view is not None else state.dataset
    if state.group_slice != group_slice:
        if group_slice is not None and collection.group_slices:
            state.group_slice = group_slice
            return True

    return False
Handle a group slice.

    Args:
        state: the state description
        group_slice (None): an optional group slice

    Returns:
        True/False indicating if a state update event should be dispatched
    
fiftyone/server/events/initialize.py