code: def generate_dask_array(np_array, n_parts):
      """
      Creates a dask array from a numpy 2d array
      """
      n_samples = np_array.shape[0]
      n_samples_per_part = int(n_samples / n_parts)
      chunks = [n_samples_per_part] * n_parts
      samples_last_row = n_samples - (
          (n_parts - 1) * n_samples_per_part
      )
      chunks[-1] = samples_last_row
      chunks = tuple(chunks)
      return da.from_array(np_array, chunks=(chunks, -1))
  
file_path: cuml/python/cuml/tests/dask/test_dask_tfidf.py
imports: from sklearn.feature_extraction.text import TfidfTransformer
  from cuml.dask.feature_extraction.text import TfidfTransformer
  import dask
  import dask.array
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import cpu_only_import_from
  from cuml.internals.safe_imports import gpu_only_import
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
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