def _find_inclusions(state, labels, remove_initial=True):
    """Find the number of inclusions found at each step."""
    inclusions = []
    n_initial_inc = 0
    cur_inclusions = 0
    n_initial = 0
    n_queries = state.n_queries()
    for query_i in range(n_queries):
        try:
            label_methods = state.get('label_methods', query_i)
            label_idx = state.get('label_idx', query_i)
        except KeyError:
            continue
        for i in range(len(label_idx)):
            if label_methods[i] == 'initial' and remove_initial:
                n_initial_inc += labels[label_idx[i]]
                n_initial += 1
            else:
                cur_inclusions += labels[label_idx[i]]
                inclusions.append(cur_inclusions)
    inclusions_after_init = sum(labels)
    if remove_initial:
        inclusions_after_init -= n_initial_inc
    return inclusions, inclusions_after_init, n_initial
