def test_label_merging():
    aligned_predictions = [{'target_labels': ['O', 'O'], 'extractor_labels': {'A': ['O', 'O']}}, {'target_labels': ['LOC', 'O', 'O'], 'extractor_labels': {'A': ['O', 'O', 'O']}}]
    assert all((merge_labels(aligned_predictions) == ['O', 'O', 'LOC', 'O', 'O']))
    assert all((merge_labels(aligned_predictions, 'A') == ['O', 'O', 'O', 'O', 'O']))
def test_label_merging():
    aligned_predictions = [{'target_labels': ['O', 'O'], 'extractor_labels': {'A': ['O', 'O']}}, {'target_labels': ['LOC', 'O', 'O'], 'extractor_labels': {'A': ['O', 'O', 'O']}}]
    assert all((merge_labels(aligned_predictions) == ['O', 'O', 'LOC', 'O', 'O']))
    assert all((merge_labels(aligned_predictions, 'A') == ['O', 'O', 'O', 'O', 'O']))