code: def test_svm_memleak(
      params, n_rows, n_iter, n_cols, use_handle, dataset="blobs"
  ):
      """
      Test whether there is any memory leak.
  
      .. note:: small `n_rows`, and `n_cols` values will result in small model
          size, that will not be measured by get_memory_info.
  
      """
      X_train, X_test, y_train, y_test = make_dataset(
          dataset, n_rows, n_cols
      )
      stream = cuml.cuda.Stream()
      handle = cuml.Handle(stream=stream)
      # Warmup. Some modules that are used in SVC allocate space on the device
      # and consume memory. Here we make sure that this allocation is done
      # before the first call to get_memory_info.
      tmp = cu_svm.SVC(handle=handle, **params)
      tmp.fit(X_train, y_train)
      ms = get_memsize(tmp)
      print(
          "Memory consumption of SVC object is {} MiB".format(
              ms / (1024 * 1024.0)
          )
      )
  
      free_mem = cuda.current_context().get_memory_info()[0]
  
      # Check first whether the get_memory_info gives us the correct memory
      # footprint
      cuSVC = cu_svm.SVC(handle=handle, **params)
      cuSVC.fit(X_train, y_train)
      delta_mem = free_mem - cuda.current_context().get_memory_info()[0]
      assert delta_mem >= ms
  
      # Main test loop
      b_sum = 0
      for i in range(n_iter):
          cuSVC = cu_svm.SVC(handle=handle, **params)
          cuSVC.fit(X_train, y_train)
          b_sum += cuSVC.intercept_
          cuSVC.predict(X_train)
  
      del cuSVC
      handle.sync()
      delta_mem = free_mem - cuda.current_context().get_memory_info()[0]
      print("Delta GPU mem: {} bytes".format(delta_mem))
      assert delta_mem == 0
  
imports: import platform
  from sklearn.preprocessing import StandardScaler
  from sklearn.model_selection import train_test_split
  from sklearn.metrics import mean_squared_error
  from sklearn.datasets import make_classification, make_gaussian_quantiles
  from sklearn.datasets import make_regression, make_friedman1
  from sklearn.datasets import load_iris, make_blobs
  from sklearn import svm
  from cuml.testing.utils import unit_param, quality_param, stress_param, compare_svm, compare_probabilistic_svm, svm_array_equal
  from cuml.common import input_to_cuml_array
  import cuml.svm
  import cuml
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  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_svm_memleak(params, n_rows, n_iter, n_cols, use_handle, dataset) without return types