code: def test_lda_store_covariance():
      # Test for solver 'lsqr' and 'eigen'
      # 'store_covariance' has no effect on 'lsqr' and 'eigen' solvers
      for solver in ("lsqr", "eigen"):
          clf = LinearDiscriminantAnalysis(solver=solver).fit(X6, y6)
          assert hasattr(clf, "covariance_")
  
          # Test the actual attribute:
          clf = LinearDiscriminantAnalysis(
              solver=solver, store_covariance=True
          ).fit(X6, y6)
          assert hasattr(clf, "covariance_")
  
          assert_array_almost_equal(
              clf.covariance_,
              np.array([[0.422222, 0.088889], [0.088889, 0.533333]]),
          )
  
      # Test for SVD solver, the default is to not set the covariances_ attribute
      clf = LinearDiscriminantAnalysis(solver="svd").fit(X6, y6)
      assert not hasattr(clf, "covariance_")
  
      # Test the actual attribute:
      clf = LinearDiscriminantAnalysis(
          solver=solver, store_covariance=True
      ).fit(X6, y6)
      assert hasattr(clf, "covariance_")
  
      assert_array_almost_equal(
          clf.covariance_,
          np.array([[0.422222, 0.088889], [0.088889, 0.533333]]),
      )
  
imports: import numpy
  import pytest
  from scipy import linalg
  from sklearn.cluster import KMeans
  from sklearn.covariance import LedoitWolf, ShrunkCovariance, ledoit_wolf
  from sklearn.datasets import make_blobs
  from sklearn.discriminant_analysis import LinearDiscriminantAnalysis, QuadraticDiscriminantAnalysis, _cov
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import _IS_WASM, check_random_state
  from sklearn.utils._testing import _convert_container, assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal
label_desc: Use image node_id 9 for calling a global function with example usage: test_lda_store_covariance() without return types