code: def get_pinned_mem(shape, dtype):
      """
      Create a pinned memory allocation.
  
      Parameters
      ----------
      shape : int or tuple of ints
          Output shape.
      dtype : data-type
          Output data type.
  
      Returns
      -------
      ret : ndarray
          Pinned memory numpy array.
  
      """
  
      from math import prod
  
      count = prod(shape) if isinstance(shape, tuple) else shape
      mem = cp.cuda.alloc_pinned_memory(
          count * cp.dtype(dtype).itemsize
      )
      ret = np.frombuffer(mem, dtype, count).reshape(shape)
  
      return ret
  
file_path: cusignal/python/cusignal/utils/arraytools.py
imports: import cupy
  import numpy
  from numba import cuda
label_desc: Use image node_id 4 for calling a global function with example usage: get_pinned_mem(shape, dtype) and returns: ret