code: def test_affinity_propagation_predict_non_convergence(global_dtype):
      # In case of non-convergence of affinity_propagation(), the cluster
      # centers should be an empty array
      X = np.array([[0, 0], [1, 1], [-2, -2]], dtype=global_dtype)
  
      # Force non-convergence by allowing only a single iteration
      with pytest.warns(ConvergenceWarning):
          af = AffinityPropagation(
              preference=-10, max_iter=1, random_state=75
          ).fit(X)
  
      # At prediction time, consider new samples as noise since there are no
      # clusters
      to_predict = np.array([[2, 2], [3, 3], [4, 4]])
      with pytest.warns(ConvergenceWarning):
          y = af.predict(to_predict)
      assert_array_equal(np.array([-1, -1, -1]), y)
  
imports: import warnings
  import numpy
  import pytest
  from sklearn.cluster import AffinityPropagation, affinity_propagation
  from sklearn.cluster._affinity_propagation import _equal_similarities_and_preferences
  from sklearn.datasets import make_blobs
  from sklearn.exceptions import ConvergenceWarning, NotFittedError
  from sklearn.metrics import euclidean_distances
  from sklearn.utils._testing import assert_allclose, assert_array_equal
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 10 for calling a global function with example usage: test_affinity_propagation_predict_non_convergence(global_dtype) without return types