code: def to_stumpy_dataset(X):
      """Transform a tslearn-compatible dataset into a stumpy dataset.
  
      Parameters
      ----------
      X: array, shape = (n_ts, sz, d)
          tslearn-formatted dataset to be cast to stumpy format
  
      Returns
      -------
      list of arrays of shape=(d, sz_i) if d > 1 or (sz_i, ) otherwise
          stumpy-formatted dataset.
  
      Examples
      --------
      >>> tslearn_arr = numpy.random.randn(10, 16, 1)
      >>> stumpy_arr = to_stumpy_dataset(tslearn_arr)
      >>> len(stumpy_arr)
      10
      >>> stumpy_arr[0].shape
      (16,)
      >>> tslearn_arr = numpy.random.randn(10, 16, 2)
      >>> stumpy_arr = to_stumpy_dataset(tslearn_arr)
      >>> len(stumpy_arr)
      10
      >>> stumpy_arr[0].shape
      (2, 16)
      """
      X_ = check_dataset(X)
  
      def transpose_or_flatten(ts):
          if ts.shape[1] == 1:
              return ts.reshape((-1,))
          else:
              return ts.transpose()
  
      return [transpose_or_flatten(Xi[: ts_size(Xi)]) for Xi in X_]
  
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 6 for calling a global function with example usage: to_stumpy_dataset(X) and returns: unknown, ts, ts