code: def test_cuda_array_interface_interop_out(dtype, module):
      expectation = does_not_raise()
      if dtype == "str":
          expectation = pytest.raises(AttributeError)
      if module == "cupy":
          module_constructor = cupy.asarray
  
          def to_host_function(x):
              return cupy.asnumpy(x)
  
      elif module == "numba":
          module_constructor = cuda.as_cuda_array
  
          def to_host_function(x):
              return x.copy_to_host()
  
      with expectation:
          np_data = np.arange(10).astype(dtype)
          cudf_data = cudf.Series(np_data)
          assert isinstance(cudf_data.__cuda_array_interface__, dict)
  
          module_data = module_constructor(cudf_data)
          got = to_host_function(module_data)
  
          expect = np_data
  
          assert_eq(expect, got)
  
file_path: cudf/python/cudf/cudf/tests/test_cuda_array_interface.py
imports: import types
  from contextlib import ExitStack
  import cupy
  import numpy
  import pandas
  import pytest
  from numba import cuda
  import cudf
  from cudf.core.buffer.spill_manager import get_global_manager
  from cudf.testing._utils import DATETIME_TYPES, NUMERIC_TYPES, assert_eq
label_desc: Use image node_id 2 for calling a global function with example usage: test_cuda_array_interface_interop_out(dtype, module) and returns: cupy, x