def _get_labeled_order(state):
    """Get the order in which papers were labeled."""
    label_order = []
    n_initial = 0
    n_queries = state.n_queries()
    for query_i in range(n_queries):
        try:
            label_methods = state.get('label_methods', query_i)
        except KeyError:
            continue
        label_idx = state.get('label_idx', query_i)
        for i in range(len(label_idx)):
            if label_methods[i] == 'initial':
                n_initial += 1
        label_order.extend(label_idx)
    return label_order, n_initial
