code: def test_not_fitted():
      rs = np.random.RandomState(3)
      kde = KernelDensity()
      X = rs.normal(size=(30, 5))
      with pytest.raises(NotFittedError):
          kde.score(X)
      with pytest.raises(NotFittedError):
          kde.sample(X)
      with pytest.raises(NotFittedError):
          kde.score_samples(X)
  
file_path: cuml/python/cuml/tests/test_kernel_density.py
imports: from cuml.testing.utils import as_type
  from sklearn.model_selection import GridSearchCV
  import pytest
  from hypothesis.extra.numpy import arrays
  from hypothesis import given, settings, assume, strategies
  from cuml.neighbors import KernelDensity, VALID_KERNELS, logsumexp_kernel
  from cuml.common.exceptions import NotFittedError
  from sklearn.metrics import pairwise_distances
  from sklearn.neighbors._ball_tree import kernel_norm
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 7 for calling a global function with example usage: test_not_fitted() without return types