buffer = buf_from_mem(c_pointer, arr_size)
arr = np.ndarray(tuple(shape[:]), dtype, buffer, order=order)
if own_data and not arr.flags.owndata:
    return arr.copy()
else:
    return arr
Getting data from ctypes array into numpy