code: def cospectrum(
      X, window=128, overlap=0.75, fmin=None, fmax=None, fs=None
  ):
      """Compute co-spectral matrices, the real part of cross-spectra.
  
      Parameters
      ----------
      X : ndarray, shape (n_channels, n_times)
          Multi-channel time-series, real-valued.
      window : int, default=128
          The length of the FFT window used for spectral estimation.
      overlap : float, default=0.75
          The percentage of overlap between window.
      fmin : float | None, default=None
          The minimal frequency to be returned.
      fmax : float | None, default=None
          The maximal frequency to be returned.
      fs : float | None, default=None
          The sampling frequency of the signal.
  
      Returns
      -------
      S : ndarray, shape (n_channels, n_channels, n_freqs)
          Co-spectral matrices, for each frequency bin.
      freqs : ndarray, shape (n_freqs,)
          The frequencies associated to cospectra.
      """
      S, freqs = cross_spectrum(
          X=X,
          window=window,
          overlap=overlap,
          fmin=fmin,
          fmax=fmax,
          fs=fs,
      )
  
      return S.real, freqs
  
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 18 for calling a global function with example usage: cospectrum(X, window, overlap, fmin, fmax, fs) and returns: S,  freqs