code: def arrayCast(source, dtype):
  	
  	
  	# Determine the number of bytes required to store the array
  	requiredBytes = _requiredSize(source.shape, dtype)
  	
  	# Determine if there is sufficient available memory
  	vmem = psutil.virtual_memory()
  	if vmem.available > requiredBytes:
  		return source.astype(dtype, subok=False)
  	else:
  		dest = arrayFactory(source.shape, dtype)
  		np.copyto(dest, source, casting='unsafe')
  		return dest
docs: Casts a NumPy array to the specified datatype, storing the copy
  	in memory if there is sufficient available space or else using a
  	memory-mapped temporary file to provide the underlying buffer.