code: def test_knn_fit_twice():
      """
      Test that fitting a model twice does not fail.
      This is necessary since the NearestNeighbors class
      needs to free Cython allocated heap memory when
      fit() is called more than once.
      """
  
      n_samples = 1000
      n_feats = 50
      k = 5
  
      X, y = make_blobs(
          n_samples=n_samples, n_features=n_feats, random_state=0
      )
  
      knn_cu = cuKNN()
      knn_cu.fit(X)
      knn_cu.fit(X)
  
      knn_cu.kneighbors(X, k)
  
      del knn_cu
  
imports: import gc
  from cuml.common import has_scipy
  import cuml
  import sklearn
  from cuml.internals.safe_imports import cpu_only_import_from
  from numpy.testing import assert_array_equal, assert_allclose
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  import math
  from cuml.testing.utils import array_equal, unit_param, quality_param, stress_param
  from cuml.neighbors import NearestNeighbors
  from sklearn.neighbors import NearestNeighbors
  from cuml.datasets import make_blobs
  from sklearn.metrics import pairwise_distances
  from cuml.metrics import pairwise_distances
  from cuml.internals import logger
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 13 for calling a global function with example usage: test_knn_fit_twice() without return types