code: def check_equal_size(dataset, be=None):
      """Check if all time series in the dataset have the same size.
  
      Parameters
      ----------
      dataset: array-like
          The dataset to check.
  
      Returns
      -------
      bool
          Whether all time series in the dataset have the same size.
  
      Examples
      --------
      >>> check_equal_size([[1, 2, 3], [4, 5, 6], [5, 3, 2]])
      True
      >>> check_equal_size([[1, 2, 3, 4], [4, 5, 6], [5, 3, 2]])
      False
      >>> check_equal_size([])
      True
      """
      be = instantiate_backend(be, dataset)
  
      dataset_ = to_time_series_dataset(dataset, be=be)
      if len(dataset_) == 0:
          return True
  
      size = ts_size(dataset[0], be=be)
      return all(ts_size(ds) == size for ds in dataset_[1:])
  
imports: import warnings
  from io import StringIO
  import numpy
  from sklearn.base import TransformerMixin
  from sklearn.utils import column_or_1d
  from sklearn.utils.validation import check_is_fitted
  from tslearn.backend import instantiate_backend
  from tslearn.bases import TimeSeriesBaseEstimator
label_desc: Use image node_id 8 for calling a global function with example usage: check_equal_size(dataset, be) and returns: all, True