code: def ragged_input(ops, list_input):
      lengths = numpy.array([len(x) for x in list_input], dtype="i")
      if not list_input:
          return Ragged(ops.alloc2f(0, 0), lengths)
      else:
          return Ragged(ops.flatten(list_input), lengths)
  
imports: import numpy
  import numpy.testing
  import pytest
  from thinc.api import Linear, Model, NumpyOps, noop, with_array, with_array2d, with_getitem, with_list, with_padded, with_ragged
  from thinc.types import Padded, Ragged
  from ..util import get_data_checker
label_desc: Use image node_id 4 for calling a global function with example usage: ragged_input(ops, list_input) and returns: Ragged, Ragged