code: def test_convergence_warning():
      nca = NeighborhoodComponentsAnalysis(max_iter=2, verbose=1)
      cls_name = nca.__class__.__name__
      msg = "[{}] NCA did not converge".format(cls_name)
      with pytest.warns(ConvergenceWarning, match=re.escape(msg)):
          nca.fit(iris_data, iris_target)
  
imports: import re
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from scipy.optimize import check_grad
  from sklearn import clone
  from sklearn.datasets import load_iris, make_blobs, make_classification
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors import NeighborhoodComponentsAnalysis
  from sklearn.preprocessing import LabelEncoder
  from sklearn.utils import check_random_state
label_desc: Use image node_id 17 for calling a global function with example usage: test_convergence_warning() without return types