def _get_bytes_buffer(ptr, nbytes):
 if isinstance(ptr, ctypes.c_void_p):
  ptr = ptr.value
 arrty = (ctypes.c_byte * nbytes)
 return arrty.from_address(ptr)

def _get_bytes_buffer ( ptr , nbytes ) : if isinstance ( ptr , ctypes . c_void_p ) : ptr = ptr . value arrty = ( ctypes . c_byte * nbytes ) return arrty . from_address ( ptr )
get a ctypes array of *nbytes* starting at *ptr* .