(src, shape, np_dtype=None)
return arr
Returns a numpy array view of the contents of a ctypes pointer or array.

  Args:
    src: A ctypes pointer or array.
    shape: A tuple specifying the dimensions of the output array.
    np_dtype: A string or `np.dtype` object specifying the dtype of the output
      array. If None, the dtype is inferred from the type of `src`.

  Returns:
    A numpy array.
Returns a numpy array view of the contents of a ctypes pointer or array.
Returns a numpy array view of the contents of a ctypes pointer or array .
def buf_to_npy(src, shape, np_dtype=None):
  """Returns a numpy array view of the contents of a ctypes pointer or array.

  Args:
    src: A ctypes pointer or array.
    shape: A tuple specifying the dimensions of the output array.
    np_dtype: A string or `np.dtype` object specifying the dtype of the output
      array. If None, the dtype is inferred from the type of `src`.

  Returns:
    A numpy array.
  """
  # This causes a harmless RuntimeWarning about mismatching buffer format
  # strings due to a bug in ctypes: http://stackoverflow.com/q/4964101/1461210
  arr = _as_array(src, shape)
  if np_dtype is not None:
    arr.dtype = np_dtype
  return arr
def buf_to_npy ( src , shape , np_dtype = None ) : # This causes a harmless RuntimeWarning about mismatching buffer format # strings due to a bug in ctypes: http://stackoverflow.com/q/4964101/1461210 arr = _as_array ( src , shape ) if np_dtype is not None : arr . dtype = np_dtype return arr