code: def create_list_series_from_2d_ar(ar, index):
      """
      Create a cudf list series  from 2d arrays
      """
      n_rows, n_cols = ar.shape
      data = as_column(ar.flatten())
      offset_col = as_column(
          cp.arange(start=0, stop=len(data) + 1, step=n_cols),
          dtype="int32",
      )
      mask_col = cp.full(shape=n_rows, fill_value=True)
      mask = cudf._lib.transform.bools_to_mask(as_column(mask_col))
      lc = cudf.core.column.ListColumn(
          size=n_rows,
          dtype=cudf.ListDtype(data.dtype),
          mask=mask,
          offset=0,
          null_count=0,
          children=(offset_col, data),
      )
      return cudf.Series(lc, index=index)
  
imports: import importlib
  import os
  import shutil
  from numba import cuda
  import cudf
  from cudf.core.column import as_column
  from cuda.cudart import cudaDeviceAttr
  from rmm._cuda.gpu import getDeviceAttribute
label_desc: Use image node_id 17 for calling a global function with example usage: create_list_series_from_2d_ar(ar, index) and returns: cudf