code: def test_EmpiricalCovariance_validates_mahalanobis():
      """Checks that EmpiricalCovariance validates data with mahalanobis."""
      cov = EmpiricalCovariance().fit(X)
  
      msg = f"X has 2 features, but \\w+ is expecting {X.shape[1]} features as input"
      with pytest.raises(ValueError, match=msg):
          cov.mahalanobis(X[:, :2])
  
file_path: scikit-learn/sklearn/covariance/tests/test_covariance.py
imports: import numpy
  import pytest
  from sklearn import datasets
  from sklearn.covariance import OAS, EmpiricalCovariance, LedoitWolf, ShrunkCovariance, empirical_covariance, ledoit_wolf, ledoit_wolf_shrinkage, oas, shrunk_covariance
  from sklearn.covariance._shrunk_covariance import _ledoit_wolf
  from sklearn.utils._testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from .._shrunk_covariance import _oas
label_desc: Use image node_id 10 for calling a global function with example usage: test_EmpiricalCovariance_validates_mahalanobis() without return types