code: def get_ragged(ops, nested: List[List[int]]):
      nested = [ops.asarray(x) for x in nested]
      return Ragged(
          ops.flatten(nested), ops.asarray([len(x) for x in nested])
      )
  
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 1 for calling a global function with example usage: get_ragged(ops, nested) and returns: Ragged