class_docstr: Test the InterclusterDistance visualizer
class_docstr_tok: ["Test","the","InterclusterDistance","visualizer"]
docstr: Test that visualizer properly handles an already-fitted model
docstr_tok: ["Test","that","visualizer","properly","handles","an","already-fitted","model"]
code: def test_with_fitted(self):
      """
      Test that visualizer properly handles an already-fitted model
      """
      X, y = load_nfl(return_dataset=True).to_numpy()
  
      model = KMeans().fit(X, y)
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = ICDM(model)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = ICDM(model, is_fitted=True)
          oz.fit(X, y)
          mockfit.assert_not_called()
  
      with mock.patch.object(model, "fit") as mockfit:
          oz = ICDM(model, is_fitted=False)
          oz.fit(X, y)
          mockfit.assert_called_once_with(X, y)
  
imports: import pytest
  import matplotlib
  import numpy
  from yellowbrick.cluster.icdm import *
  from yellowbrick.datasets import load_nfl
  from yellowbrick.exceptions import YellowbrickValueError
  from unittest import mock
  from tests.fixtures import Dataset
  from tests.base import IS_WINDOWS_OR_CONDA, VisualTestCase
  from sklearn.datasets import make_blobs
  from sklearn.cluster import Birch, AgglomerativeClustering
  from sklearn.decomposition import LatentDirichletAllocation
  from sklearn.cluster import KMeans, AffinityPropagation, MiniBatchKMeans
  from sklearn.pipeline import Pipeline
  from sklearn.impute import SimpleImputer
label_desc: Use image node_id 11 for calling the TestInterclusterDistance obj's underlying member method code with example usage: obj.test_with_fitted() without return types