import random


def generate_sequence(length, alphabet):
	"""
	Generates a random sequence of a given length, given an alphabet of elements.
	This is useful for benchmarking function performance, and creating examples in the docs.
	
	Example
	--------
	>>> ps.generate_sequence(12, [1,2,3])
	[2, 3, 3, 3, 2, 2, 2, 1, 3, 3, 2, 2]
	"""
	return [random.choice(alphabet) for x in range(length)]