code: def sqize_kernel_ho(K, L, D=1, theta=1.0, normalize=False):
      """Compute the higher-order sequential kernel from a pairwise kernel matrix.
  
      aka compute "sequentialization of the kernel K", higher-order approximation
  
      Parameters
      ----------
      K : 2D np.ndarray
          the kernel matrix of increments, i.e.,
          K[i,j] is the kernel between the i-th increment of path 1 (rows),
          and the j-th increment of path 2 (columns)
      L : an integer >= 1, representing the level of truncation
      D : int, optional, default = 1
          an integer >= 1, representing the order of approximation
      theta : float, optional, default=1.0
          a positive scaling factor for the levels, i-th level is scaled by theta^i
      normalize : bool, optional, default = False
          whether the output kernel matrix is normalized
          if True, sums and cumsums are divided by prod(K.shape)
  
      Returns
      -------
      a real number, the sequential kernel between path 1 (rows of K) and path 2 (cols)
      """
      A = np.zeros(np.concatenate(([L, D, D], K.shape)))
      Id = np.ones(K.shape)
  
      for ell in range(1, L):
          Dprime = min(D, ell)
          Acs = cumsum_shift_mult(
              np.sum(A[ell - 1, :, :, :, :], (0, 1)), (0, 1)
          )
          A[ell, 0, 0, :, :] = K * (Id + Acs)
          for d1 in range(1, Dprime):
              Acs1 = cumsum_shift_mult(
                  np.sum(A[ell - 1, d1 - 1, :, :, :], 0), 1
              )
              Acs2 = cumsum_shift_mult(
                  np.sum(A[ell - 1, :, d1 - 1, :, :], 0), 0
              )
              A[ell, d1, 0, :, :] = (
                  A[ell, d1, 0, :, :] + (1 / d1) * K * Acs1
              )
              A[ell, :, d1, :, :] = (
                  A[ell, 0, d1, :, :] + (1 / d1) * K * Acs2
              )
  
              for d2 in range(1, Dprime):
                  Acs12 = cumsum_shift_mult(
                      np.sum(A[ell - 1, d1 - 1, d2 - 1, :, :], 0), 0
                  )
                  A[ell, d1, d2, :, :] = (
                      A[ell, d1, d2, :, :] + (1 / (d1 * d2)) * K * Acs12
                  )
      return 1 + np.sum(A[L - 1, :, :, :, :])
  
imports: import collections
  from functools import partial
  import numpy
  from scipy.sparse.linalg import svds
  from sklearn.base import BaseEstimator, TransformerMixin
  from sktime.dists_kernels.base import BasePairwiseTransformerPanel
label_desc: Use image node_id 18 for calling a global function with example usage: sqize_kernel_ho(K, L, D, theta, normalize) and returns: unknown