code: def test_sliced_array_owner(order, mem_type):
      """
      When slicing a CumlArray, a new object can be created created which
      previously had an incorrect owner. This was due to the requirement by
      `cudf.core.Buffer` that all data be in "u1" form. CumlArray would satisfy
      this requirement by calling
      `cp.asarray(data).ravel(order='A').view('u1')`. If the slice is not
      contiguous, this would create an intermediate object with no references
      that would be cleaned up by GC causing an error when using the memory
      """
      mem_type = MemoryType.from_str(mem_type)
      xpy = mem_type.xpy
  
      # Create 2 copies of a random array
      random_arr = xpy.array(
          xpy.random.random((500, 4)), dtype=np.float32, order=order
      )
      arr = xpy.array(random_arr, copy=True)
      with using_memory_type(mem_type):
          cuml_array = CumlArray(random_arr)
  
      # Make sure we have 2 pieces of data
      if mem_type.is_device_accessible:
          assert arr.data.ptr != cuml_array.ptr
      else:
          assert arr.__array_interface__["data"][0] != cuml_array.ptr
  
      # Since these are C arrays, slice off the first column to ensure they are
      # non-contiguous
      cuml_slice = cuml_array[1:, 1:]
      arr_slice = arr[1:, 1:]
  
      # Delete the input object just to be sure
      del random_arr
  
      # Make sure to cleanup any objects. Forces deletion of intermediate owner
      # object
      gc.collect()
  
      # Calling `to_output` forces use of the pointer. This can fail with a cuda
      # error on `cupy.cuda.runtime.pointerGetAttributes(cuml_slice.ptr)` in CUDA
      # < 11.0 or cudaErrorInvalidDevice in CUDA > 11.0 (unclear why it changed)
      assert xpy.all(
          cuml_slice.to_output("array", output_mem_type=mem_type)
          == arr_slice
      )
  
imports: import gc
  import operator
  import pickle
  import pytest
  from copy import deepcopy
  from cuml.internals.array import CumlArray, _order_to_strides, array_to_memory_order
  from cuml import global_settings
  from cuml.internals.mem_type import MemoryType
  from cuml.internals.memory_utils import _get_size_from_shape, determine_array_memtype, using_memory_type
  from cuml.internals.safe_imports import cpu_only_import, cpu_only_import_from, gpu_only_import, gpu_only_import_from
  from cuml.testing.strategies import UNSUPPORTED_CUDF_DTYPES, create_cuml_array_input, cuml_array_dtypes, cuml_array_input_types, cuml_array_inputs, cuml_array_orders, cuml_array_output_types, cuml_array_shapes, cuml_array_mem_types
  from cuml.testing.utils import normalized_shape, series_squeezed_shape, squeezed_shape, to_nparray
  from hypothesis import assume, given, settings
  from hypothesis import strategies
label_desc: Use image node_id 21 for calling a global function with example usage: test_sliced_array_owner(order, mem_type) without return types