code: def gamma_soft_dtw(
      dataset, n_samples=100, random_state=None, be=None
  ):
      r"""Compute gamma value to be used for GAK/Soft-DTW.
  
      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 :math:`\gamma` parameter for the Soft-DTW.
  
      Examples
      --------
      >>> dataset = [[1, 2, 2, 3], [1., 2., 3., 4.]]
      >>> gamma_soft_dtw(dataset=dataset,
      ...                n_samples=200,
      ...                random_state=0)  # doctest: +ELLIPSIS
      8.0...
  
      See Also
      --------
      sigma_gak : Compute sigma parameter for Global Alignment kernel
  
      References
      ----------
      .. [1] M. Cuturi, "Fast global alignment kernels," ICML 2011.
      """
      be = instantiate_backend(be, dataset)
      return (
          2.0
          * sigma_gak(
              dataset=dataset,
              n_samples=n_samples,
              random_state=random_state,
              be=be,
          )
          ** 2
      )
  
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 8 for calling a global function with example usage: gamma_soft_dtw(dataset, n_samples, random_state, be) and returns: unknown