code: def test_affinity_propagation_equal_mutual_similarities(global_dtype):
      X = np.array([[-1, 1], [1, -1]], dtype=global_dtype)
      S = -euclidean_distances(X, squared=True)
  
      # setting preference > similarity
      with pytest.warns(UserWarning, match="mutually equal"):
          cluster_center_indices, labels = affinity_propagation(
              S, preference=0
          )
  
      # expect every sample to become an exemplar
      assert_array_equal([0, 1], cluster_center_indices)
      assert_array_equal([0, 1], labels)
  
      # setting preference < similarity
      with pytest.warns(UserWarning, match="mutually equal"):
          cluster_center_indices, labels = affinity_propagation(
              S, preference=-10
          )
  
      # expect one cluster, with arbitrary (first) sample as exemplar
      assert_array_equal([0], cluster_center_indices)
      assert_array_equal([0, 0], labels)
  
      # setting different preferences
      with warnings.catch_warnings():
          warnings.simplefilter("error", UserWarning)
          cluster_center_indices, labels = affinity_propagation(
              S, preference=[-20, -10], random_state=37
          )
  
      # expect one cluster, with highest-preference sample as exemplar
      assert_array_equal([1], cluster_center_indices)
      assert_array_equal([0, 0], labels)
  
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 9 for calling a global function with example usage: test_affinity_propagation_equal_mutual_similarities(global_dtype) without return types