def loop_copy(src, dest):
	""" Copies a source array into a destination array, looping
		through the source array until the entire destination array
		is written.

		# Arguments

		src: numpy array. The source array.
		dest: numpy array. The destination array.

		# Return value

		The destination array.

		# Notes

		If the source array is longer than the destination array, then
		only the first N entries of the source array are copied into the
		destination, where N is the length of the destination array.

		If the source array is shorter than, or of equal length with, the
		destination array, then it will be copied into the destination array
		and repeated, back-to-back, until the destination is filled up (almost
		tiling the destination, if you will).
	"""
	if len(src) > len(dest):
		dest[:] = src[:len(dest)]
	else:
		i = 0
		while i < len(dest):
			entries_to_copy = min(len(dest) - i, len(src))
			dest[i:i+entries_to_copy] = src[:entries_to_copy]
			i += len(src)

	return dest