code: def generate_dask_array(np_array, n_parts):
      n_samples = np_array.shape[0]
      n_samples_per_part = int(n_samples / n_parts)
      chunks = [n_samples_per_part] * n_parts
      chunks[-1] += n_samples % n_samples_per_part
      chunks = tuple(chunks)
      return da.from_array(np_array, chunks=(chunks, -1))
  
file_path: cuml/python/cuml/tests/dask/test_dask_kneighbors_classifier.py
imports: from cuml.internals.safe_imports import gpu_only_import
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  from cuml.testing.utils import unit_param, quality_param, stress_param
  from cuml.neighbors import KNeighborsClassifier
  from cuml.dask.neighbors import KNeighborsClassifier
  from sklearn.datasets import make_multilabel_classification
  from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  import dask.array
  import dask.dataframe
  from cuml.dask.common.dask_arr_utils import to_dask_cudf
  from cuml.internals.safe_imports import gpu_only_import_from
label_desc: Use image node_id 1 for calling a global function with example usage: generate_dask_array(np_array, n_parts) and returns: da