code: def unnormalized_gak(s1, s2, sigma=1.0, be=None):
      r"""Compute Global Alignment Kernel (GAK) between (possibly
      multidimensional) time series and return it.
  
      It is not required that both time series share the same size, but they must
      be the same dimension. GAK was
      originally presented in [1]_.
      This is an unnormalized version.
  
      Parameters
      ----------
      s1 : array-like, shape=(sz1, d) or (sz1,)
          A time series.
          If shape is (sz1,), the time series is assumed to be univariate.
      s2 : array-like, shape=(sz2, d) or (sz2,)
          Another time series.
          If shape is (sz2,), the time series is assumed to be univariate.
      sigma : float (default 1.)
          Bandwidth of the internal gaussian kernel used for GAK.
      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
          Kernel value
  
      Examples
      --------
      >>> unnormalized_gak([1, 2, 3],
      ...                  [1., 2., 2., 3.],
      ...                  sigma=2.)  # doctest: +ELLIPSIS
      15.358...
      >>> unnormalized_gak([1, 2, 3],
      ...                  [1., 2., 2., 3., 4.])  # doctest: +ELLIPSIS
      3.166...
  
      See Also
      --------
      gak : normalized version of GAK that ensures that k(x,x) = 1
      cdist_gak : Compute cross-similarity matrix using Global Alignment kernel
  
      References
      ----------
      .. [1] M. Cuturi, "Fast global alignment kernels," ICML 2011.
      """
      be = instantiate_backend(be, s1, s2)
      s1 = to_time_series(s1, remove_nans=True, be=be)
      s2 = to_time_series(s2, remove_nans=True, be=be)
  
      gram = _gak_gram(s1, s2, sigma=sigma, be=be)
  
      if be.is_numpy:
          return _njit_gak(gram)
      return _gak(gram, be=be)
  
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 4 for calling a global function with example usage: unnormalized_gak(s1, s2, sigma, be) and returns: _gak, _njit_gak