code: def test_confusion_matrix_random(
      n_samples, dtype, problem_type, client
  ):
      upper_range = 2 if problem_type == "binary" else 1000
  
      y_true, y_pred, np_y_true, np_y_pred = generate_random_labels(
          lambda rng: rng.randint(0, upper_range, n_samples).astype(
              dtype
          ),
          as_cupy=True,
      )
      y_true, y_pred = da.from_array(y_true), da.from_array(y_pred)
  
      cm = confusion_matrix(y_true, y_pred)
      ref = sk_confusion_matrix(np_y_true, np_y_pred)
      cp.testing.assert_array_almost_equal(ref, cm, decimal=4)
  
file_path: cuml/python/cuml/tests/dask/test_dask_metrics.py
imports: import dask.array
  from cuml.dask.metrics import confusion_matrix
  from cuml.testing.utils import stress_param, generate_random_labels
  from sklearn.metrics import confusion_matrix
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
  from itertools import chain, permutations
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 3 for calling a global function with example usage: test_confusion_matrix_random(n_samples, dtype, problem_type, client) without return types