code: def test_array_interface(inp, mem_type):
      mem_type = MemoryType.from_str(mem_type)
      with using_memory_type(mem_type):
          ary = CumlArray(inp)
  
          in_mem_type = determine_array_memtype(inp)
          if isinstance(inp, PandasSeries):
              converted_inp = inp.to_numpy()
          elif isinstance(inp, CudfSeries):
              converted_inp = cp.asnumpy(inp.to_cupy())
          else:
              converted_inp = inp
  
          try:
              inp_ai = converted_inp.__cuda_array_interface__
          except AttributeError:
              inp_ai = converted_inp.__array_interface__
  
          ary_ai = ary._array_interface
  
          # Check Array Interface equality.
          assert inp_ai["shape"] == ary_ai["shape"]
          assert inp_ai["typestr"] == ary_ai["typestr"]
          if (
              not isinstance(inp, (PandasSeries, CudfSeries))
              and determine_array_memtype(inp)
              is global_settings.memory_type
          ):
              assert inp_ai["data"] == ary_ai["data"]
          # Mismatch for one-dimensional arrays:
          if inp_ai.get("strides", None) is not None:
              assert inp_ai["strides"] == ary_ai["strides"]
  
          if in_mem_type.is_device_accessible:
              joint_mem_type = in_mem_type
          else:
              joint_mem_type = mem_type
  
          # Check equality
          inp_arr = joint_mem_type.xpy.asarray(converted_inp)
          out_arr = joint_mem_type.xpy.asarray(ary)
          assert joint_mem_type.xpy.all(
              inp_arr == out_arr
          ) or joint_mem_type.xpy.all(
              joint_mem_type.xpy.isnan(inp_arr)
              == joint_mem_type.xpy.isnan(out_arr)
          )
  
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 16 for calling a global function with example usage: test_array_interface(inp, mem_type) without return types