code: def run(gpuid, n_clusters, num, max_iter, use_custom_kernel, output):
      samples = numpy.random.randn(num, 2)
      X_train = numpy.r_[samples + 1, samples - 1]
  
      with timer(" CPU "):
          centers, pred = fit_xp(X_train, n_clusters, max_iter)
  
      with cupy.cuda.Device(gpuid):
          X_train = cupy.asarray(X_train)
  
          with timer(" GPU "):
              if use_custom_kernel:
                  centers, pred = fit_custom(
                      X_train, n_clusters, max_iter
                  )
              else:
                  centers, pred = fit_xp(X_train, n_clusters, max_iter)
  
          if output is not None:
              index = numpy.random.choice(10000000, 300, replace=False)
              draw(
                  X_train[index].get(),
                  n_clusters,
                  centers.get(),
                  pred[index].get(),
                  output,
              )
  
file_path: cupy/examples/kmeans/kmeans.py
imports: import argparse
  import contextlib
  import time
  import cupy
  import matplotlib.pyplot
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: run(gpuid, n_clusters, num, max_iter, use_custom_kernel, output) without return types