code: def test_generate_nsamples_weights():
      (
          samples,
          w,
      ) = cuml.explainer.kernel_shap._generate_nsamples_weights(
          ncols=20,
          nsamples=30,
          nsamples_exact=10,
          nsamples_random=20,
          randind=5,
          dtype=np.float32,
      )
      # check that all our samples are between 5 and 6, and the weights in pairs
      # are generated correctly
      for i, s in enumerate(samples):
          assert s in [5, 6]
          assert w[i * 2] == cuml.explainer.kernel_shap._shapley_kernel(
              20, int(s)
          )
          assert w[
              i * 2 + 1
          ] == cuml.explainer.kernel_shap._shapley_kernel(20, int(s))
  
imports: from sklearn.model_selection import train_test_split
  from cuml.testing.utils import create_synthetic_dataset, ClassEnumerator, get_shap_values
  from cuml.datasets import make_regression
  from cuml.internals.import_utils import has_shap
  from cuml.internals.import_utils import has_scipy
  from cuml import KernelExplainer
  from cuml import Lasso
  import sklearn.neighbors
  import pytest
  import math
  from cuml.internals.safe_imports import cpu_only_import
  import cuml
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 12 for calling a global function with example usage: test_generate_nsamples_weights() without return types