code: def _complex_estimator(func):
      """Decorator to extend a real-valued covariance estimator to complex data.
  
      Applied to a real-valued covariance estimator, this decorator allows to
      estimate complex covariance matrices from complex-valued multi-channel
      time-series. See Eq.(4) in [1]_.
  
      Parameters
      ----------
      func : callable
          Real-valued covariance estimator.
  
      Returns
      -------
      output : callable
          Complex-valued covariance estimator.
  
      Notes
      -----
      .. versionadded:: 0.6
  
      References
      ----------
      .. [1] `Enhanced Covariance Matrix Estimators in Adaptive Beamforming
          <https://doi.org/10.1109/ICASSP.2007.366399>`_
          R. Abrahamsson, Y. Selen and P. Stoica. 2007 IEEE International
          Conference on Acoustics, Speech and Signal Processing, Volume 2, 2007.
      """
  
      @wraps(func)
      def wrapper(X, **kwds):
          iscomplex = np.iscomplexobj(X)
          if iscomplex:
              n_channels, n_times = X.shape
              X = np.concatenate((X.real, X.imag), axis=0)
          cov = func(X, **kwds)
          if iscomplex:
              cov = (
                  cov[:n_channels, :n_channels]
                  + cov[n_channels:, n_channels:]
                  + 1j
                  * (
                      cov[n_channels:, :n_channels]
                      - cov[:n_channels, n_channels:]
                  )
              )
          return cov
  
      return wrapper
  
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 1 for calling a global function with example usage: _complex_estimator(func) and returns: wrapper, cov