code: def covariances(X, estimator="cov", **kwds):
      """Estimation of covariance matrices.
  
      Estimates covariance matrices from multi-channel time-series according to
      a covariance estimator. It supports real and complex-valued data.
  
      Parameters
      ----------
      X : ndarray, shape (n_matrices, n_channels, n_times)
          Multi-channel time-series, real or complex-valued.
      estimator : {'corr', 'cov', 'hub', 'lwf', 'mcd', 'oas', 'sch', 'scm', \
              'stu', 'tyl'}, default='scm'
          Covariance matrix estimator [est]_:
  
          * 'corr' for correlation coefficient matrix [corr]_,
          * 'cov' for NumPy based covariance matrix [cov]_,
          * 'hub' for Huber's M-estimator based covariance matrix [mest]_,
          * 'lwf' for Ledoit-Wolf shrunk covariance matrix [lwf]_,
          * 'mcd' for minimum covariance determinant matrix [mcd]_,
          * 'oas' for oracle approximating shrunk covariance matrix [oas]_,
          * 'sch' for Schaefer-Strimmer shrunk covariance matrix [sch]_,
          * 'scm' for sample covariance matrix [scm]_,
          * 'stu' for Student-t's M-estimator based covariance matrix [mest]_,
          * 'tyl' for Tyler's M-estimator based covariance matrix [mest]_,
          * or a callable function.
  
          For regularization, consider 'lwf' or 'oas'.
  
          For robustness, consider 'hub', 'mcd', 'stu' or 'tyl'.
  
          For 'lwf', 'mcd', 'oas' and 'sch' estimators,
          complex covariance matrices are estimated according to [comp]_.
      **kwds : dict
          Any further parameters are passed directly to the covariance estimator.
  
      Returns
      -------
      covmats : ndarray, shape (n_matrices, n_channels, n_channels)
          Covariance matrices.
  
      References
      ----------
      .. [est] https://scikit-learn.org/stable/modules/covariance.html
      .. [corr] https://numpy.org/doc/stable/reference/generated/numpy.corrcoef.html
      .. [cov] https://numpy.org/doc/stable/reference/generated/numpy.cov.html
      .. [lwf] https://scikit-learn.org/stable/modules/generated/sklearn.covariance.ledoit_wolf.html
      .. [mcd] https://scikit-learn.org/stable/modules/generated/sklearn.covariance.MinCovDet.html
      .. [mest] :func:`pyriemann.utils.covariance.covariance_mest`
      .. [oas] https://scikit-learn.org/stable/modules/generated/oas-function.html
      .. [sch] :func:`pyriemann.utils.covariance.covariance_sch`
      .. [scm] :func:`pyriemann.utils.covariance.covariance_scm`
      .. [comp] `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.
      """  # noqa
      est = _check_cov_est_function(estimator)
      n_matrices, n_channels, n_times = X.shape
      covmats = np.empty(
          (n_matrices, n_channels, n_channels), dtype=X.dtype
      )
      for i in range(n_matrices):
          covmats[i] = est(X[i], **kwds)
      return covmats
  
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 12 for calling a global function with example usage: covariances(X, estimator) and returns: covmats