code: def test_classification_toy(csr_container):
      # Check classification on a toy dataset, including sparse versions.
      X_csr = csr_container(X)
      T_csr = csr_container(T)
  
      clf = NearestCentroid()
      clf.fit(X, y)
      assert_array_equal(clf.predict(T), true_result)
  
      # Same test, but with a sparse matrix to fit and test.
      clf = NearestCentroid()
      clf.fit(X_csr, y)
      assert_array_equal(clf.predict(T_csr), true_result)
  
      # Fit with sparse, test with non-sparse
      clf = NearestCentroid()
      clf.fit(X_csr, y)
      assert_array_equal(clf.predict(T), true_result)
  
      # Fit with non-sparse, test with sparse
      clf = NearestCentroid()
      clf.fit(X, y)
      assert_array_equal(clf.predict(T_csr), true_result)
  
      # Fit and predict with non-CSR sparse matrices
      clf = NearestCentroid()
      clf.fit(X_csr.tocoo(), y)
      assert_array_equal(clf.predict(T_csr.tolil()), true_result)
  
file_path: scikit-learn/sklearn/neighbors/tests/test_nearest_centroid.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn import datasets
  from sklearn.neighbors import NearestCentroid
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 1 for calling a global function with example usage: test_classification_toy(csr_container) without return types