def flatten(groups):
	""" Flatten a list of lists.
	"""
	flat = []
	for subgroup in groups:
		if isinstance(subgroup, list):
			for g in subgroup:
				flat.append(g)
		else:
			flat.append(subgroup)
	return flat