code: def eegtocov(
      sig, window=128, overlapp=0.5, padding=True, estimator="cov"
  ):
      """Convert EEG signal to covariance using sliding window."""
      est = _check_cov_est_function(estimator)
      X = []
      if padding:
          padd = np.zeros((int(window / 2), sig.shape[1]))
          sig = np.concatenate((padd, sig, padd), axis=0)
  
      n_times, n_channels = sig.shape
      jump = int(window * overlapp)
      ix = 0
      while ix + window < n_times:
          X.append(est(sig[ix : ix + window, :].T))
          ix = ix + jump
  
      return np.array(X)
  
imports: import warnings
  from functools import wraps
  import numpy
  from scipy.linalg import block_diag
  from scipy.stats import chi2
  from sklearn.covariance import oas, ledoit_wolf, fast_mcd
  from .distance import distance_mahalanobis
  from .test import is_square, is_real_type
label_desc: Use image node_id 16 for calling a global function with example usage: eegtocov(sig, window, overlapp, padding, estimator) and returns: np