code: def test_offset_alignment(words, offset_mapping, alignment):
      spans = get_spans([words])
      result = get_span2wp_from_offset_mapping(spans[0], offset_mapping)
      assert all(sorted(r) == a for r, a in zip(result, alignment))
  
file_path: spacy-transformers/spacy_transformers/tests/test_alignment.py
imports: import pytest
  from typing import List
  import numpy
  from spacy.tokens import Doc
  from spacy.vocab import Vocab
  from thinc.api import NumpyOps
  from thinc.types import Ragged
  from ..align import get_alignment, apply_alignment
  from ..align import get_span2wp_from_offset_mapping
label_desc: Use image node_id 6 for calling a global function with example usage: test_offset_alignment(words, offset_mapping, alignment) without return types