code: def test_affinity_raises():
      sc = SpectralClustering(affinity="foo")
      with pytest.raises(ValueError) as m:
          sc.fit(X)
  
      assert m.match("Unknown affinity metric name 'foo'")
  
      sc = SpectralClustering(affinity=np.array([]))
      with pytest.raises(TypeError) as m:
          sc.fit(X)
          assert m.match("Unexpected type for affinity 'ndarray'")
  
file_path: dask-ml/tests/test_spectral_clustering.py
imports: from functools import partial
  import numpy
  import pytest
  import sklearn.cluster
  from dask_ml import metrics
  from dask_ml.cluster import SpectralClustering
  from dask_ml.datasets import make_blobs
label_desc: Use image node_id 6 for calling a global function with example usage: test_affinity_raises() without return types