code: def sigma_gak(dataset, n_samples=100, random_state=None, be=None):
      r"""Compute sigma value to be used for GAK.
  
      This method was originally presented in [1]_.
  
      Parameters
      ----------
      dataset : array-like, shape=(n_ts, sz, d) or (n_ts, sz1) or (sz,)
          A dataset of time series.
          If shape is (n_ts, sz), the dataset is composed of univariate time series.
          If shape is (sz,), the dataset is composed of a unique univariate time series.
      n_samples : int (default: 100)
          Number of samples on which median distance should be estimated.
      random_state : integer or numpy.RandomState or None (default: None)
          The generator used to draw the samples. If an integer is given, it
          fixes the seed. Defaults to the global numpy random number generator.
      be : Backend object or string or None
          Backend. If `be` is an instance of the class `NumPyBackend` or the string `"numpy"`,
          the NumPy backend is used.
          If `be` is an instance of the class `PyTorchBackend` or the string `"pytorch"`,
          the PyTorch backend is used.
          If `be` is `None`, the backend is determined by the input arrays.
          See our :ref:`dedicated user-guide page <backend>` for more information.
  
      Returns
      -------
      float
          Suggested bandwidth (:math:`\sigma`) for the Global Alignment kernel.
  
      Examples
      --------
      >>> dataset = [[1, 2, 2, 3], [1., 2., 3., 4.]]
      >>> sigma_gak(dataset=dataset,
      ...           n_samples=200,
      ...           random_state=0)  # doctest: +ELLIPSIS
      2.0...
  
      See Also
      --------
      gak : Compute Global Alignment kernel
      cdist_gak : Compute cross-similarity matrix using Global Alignment kernel
  
      References
      ----------
      .. [1] M. Cuturi, "Fast global alignment kernels," ICML 2011.
      """
      be = instantiate_backend(be, dataset)
  
      random_state = check_random_state(random_state)
      dataset = to_time_series_dataset(dataset, be=be)
      n_ts, sz, d = be.shape(dataset)
      if not check_equal_size(dataset, be=be):
          sz = be.min([ts_size(ts) for ts in dataset])
      if n_ts * sz < n_samples:
          replace = True
      else:
          replace = False
      sample_indices = random_state.choice(
          n_ts * sz, size=n_samples, replace=replace
      )
      dists = be.pdist(
          dataset[:, :sz, :].reshape((-1, d))[sample_indices],
          metric="euclidean",
      )
      return be.median(dists) * be.sqrt(sz)
  
imports: import numpy
  from joblib import Parallel, delayed
  from numba import njit
  from sklearn.utils import check_random_state
  from tslearn.backend import instantiate_backend
  from tslearn.utils import check_equal_size, to_time_series, to_time_series_dataset, ts_size
  from .dtw_variants import dtw, dtw_path
  from .soft_dtw_fast import _jacobian_product_sq_euc, _njit_jacobian_product_sq_euc, _njit_soft_dtw, _njit_soft_dtw_grad, _soft_dtw, _soft_dtw_grad
  from .utils import _cdist_generic
label_desc: Use image node_id 7 for calling a global function with example usage: sigma_gak(dataset, n_samples, random_state, be) and returns: unknown