code: def signals_and_covariances(cov_estimator):
      signals, _ = _signals()
      emp_covs = []
      ledoit_covs = []
      ledoit_estimator = LedoitWolf()
      for k, signal_ in enumerate(signals):
          n_samples = 200 + k
          signal_ -= signal_.mean(axis=0)
          emp_covs.append((signal_.T).dot(signal_) / n_samples)
          ledoit_covs.append(ledoit_estimator.fit(signal_).covariance_)
  
      if isinstance(cov_estimator, LedoitWolf):
          return signals, ledoit_covs
      elif isinstance(cov_estimator, EmpiricalCovariance):
          return signals, emp_covs
  
imports: import copy
  import warnings
  from math import cosh, exp, log, sinh, sqrt
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from pandas import DataFrame
  from scipy import linalg
  from sklearn.covariance import EmpiricalCovariance, LedoitWolf
  from nilearn._utils.extmath import is_spd
  from nilearn.connectome.connectivity_matrices import ConnectivityMeasure, _check_spd, _check_square, _form_symmetric, _geometric_mean, _map_eigenvalues, prec_to_partial, sym_matrix_to_vec, vec_to_sym_matrix
  from nilearn.tests.test_signal import generate_signals
label_desc: Use image node_id 5 for calling a global function with example usage: signals_and_covariances(cov_estimator) and returns: signals,  ledoit_covs, signals,  emp_covs