code: def cint8_array_to_numpy(cptr, length):
      
      if isinstance(cptr, ctypes.POINTER(ctypes.c_int8)):
          return np.fromiter(cptr, dtype=np.int8, count=length)
      else:
          raise RuntimeError('Expected int pointer')
docs: Convert a ctypes int pointer array to a numpy array.