code: def list2ragged() -> Model[InT, OutT]:
      """Transform sequences to ragged arrays if necessary and return the ragged
      array. If sequences are already ragged, do nothing. A ragged array is a
      tuple (data, lengths), where data is the concatenated data.
      """
      return Model("list2ragged", forward)
  
imports: from typing import Callable, List, Tuple, TypeVar, cast
  from ..config import registry
  from ..model import Model
  from ..types import ArrayXd, ListXd, Ragged
label_desc: Use image node_id 1 for calling a global function with example usage: list2ragged() and returns: Model