code: def to_cesium_dataset(X):
      """Transform a tslearn-compatible dataset into a cesium dataset.
  
      Parameters
      ----------
      X: array, shape = (n_ts, sz, d), where n_ts=1
          tslearn-formatted dataset to be cast to cesium format
  
      Returns
      -------
      list of cesium TimeSeries
          cesium-formatted dataset (cf.
          `link <http://cesium-ml.org/docs/api/cesium.time_series.html#cesium.time_series.TimeSeries>`_)
  
      Examples
      --------
      >>> tslearn_arr = numpy.random.randn(3, 16, 1)
      >>> cesium_ds = to_cesium_dataset(tslearn_arr)
      >>> len(cesium_ds)
      3
      >>> cesium_ds[0].measurement.shape
      (16,)
      >>> tslearn_arr = numpy.random.randn(3, 16, 2)
      >>> cesium_ds = to_cesium_dataset(tslearn_arr)
      >>> len(cesium_ds)
      3
      >>> cesium_ds[0].measurement.shape
      (2, 16)
      >>> tslearn_arr = [[1, 2, 3], [1, 2, 3, 4]]
      >>> cesium_ds = to_cesium_dataset(tslearn_arr)
      >>> len(cesium_ds)
      2
      >>> cesium_ds[0].measurement.shape
      (3,)
  
      Notes
      -----
      Conversion from/to cesium format requires cesium to be installed.
      """  # noqa: E501
      try:
          from cesium.time_series import TimeSeries
      except ImportError:
          raise ImportError(
              "Conversion from/to cesium cannot be performed "
              "if cesium is not installed."
          )
  
      def transpose_or_flatten(ts):
          ts_ = ts[: ts_size(ts)]
          if ts.shape[1] == 1:
              return ts_.reshape((-1,))
          else:
              return ts_.transpose()
  
      X_ = check_dataset(X)
      return [TimeSeries(m=transpose_or_flatten(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 14 for calling a global function with example usage: to_cesium_dataset(X) and returns: unknown, ts_, ts_