code: def test_numba_memalloc(c, dtype):
      ctx, nb_ctx = context_choices[c]
      dtype = np.dtype(dtype)
      # Allocate memory using numba context
      # Warning: this will not be reflected in pyarrow context manager
      # (e.g bytes_allocated does not change)
      size = 10
      mem = nb_ctx.memalloc(size * dtype.itemsize)
      darr = DeviceNDArray(
          (size,), (dtype.itemsize,), dtype, gpu_data=mem
      )
      darr[:5] = 99
      darr[5:] = 88
      np.testing.assert_equal(darr.copy_to_host()[:5], 99)
      np.testing.assert_equal(darr.copy_to_host()[5:], 88)
  
      # wrap numba allocated memory with CudaBuffer
      cbuf = cuda.CudaBuffer.from_numba(mem)
      arr2 = np.frombuffer(cbuf.copy_to_host(), dtype=dtype)
      np.testing.assert_equal(arr2, darr.copy_to_host())
  
file_path: arrow/python/pyarrow/tests/test_cuda_numba_interop.py
imports: import pytest
  import pyarrow
  import numpy
  from numba.cuda.cudadrv.devicearray import DeviceNDArray
label_desc: Use image node_id 6 for calling a global function with example usage: test_numba_memalloc(c, dtype) without return types