code: def to_seglearn_dataset(X):
      """Transform a tslearn-compatible dataset into a seglearn dataset.
  
      Parameters
      ----------
      X: array, shape = (n_ts, sz, d)
          tslearn-formatted dataset to be cast to seglearn format
  
      Returns
      -------
      array of arrays, shape=(n_ts, )
          seglearn-formatted dataset. i-th sub-array in the list has shape
          (sz_i, d)
  
      Examples
      --------
      >>> tslearn_arr = numpy.random.randn(10, 16, 1)
      >>> seglearn_arr = to_seglearn_dataset(tslearn_arr)
      >>> seglearn_arr.shape
      (10, 16, 1)
      >>> tslearn_arr = numpy.random.randn(10, 16, 2)
      >>> seglearn_arr = to_seglearn_dataset(tslearn_arr)
      >>> seglearn_arr.shape
      (10, 16, 2)
      >>> tslearn_arr = [numpy.random.randn(16, 2), numpy.random.randn(10, 2)]
      >>> seglearn_arr = to_seglearn_dataset(tslearn_arr)
      >>> seglearn_arr.shape
      (2,)
      >>> seglearn_arr[0].shape
      (16, 2)
      >>> seglearn_arr[1].shape
      (10, 2)
      """
      X_ = check_dataset(X)
      return numpy.array([Xi[: ts_size(Xi)] for Xi in X_], dtype=object)
  
file_path: tslearn/tslearn/utils/cast.py
imports: import warnings
  import numpy
  from sklearn.utils import check_array
  from .utils import check_dataset, ts_size, to_time_series_dataset
label_desc: Use image node_id 4 for calling a global function with example usage: to_seglearn_dataset(X) and returns: numpy