def safe_list_of_objects(input, input_class = None):
	"""Create a list given an object or a list of objects.

	Arguments:
		input: Object or list of objects.
		input_class: Class of the objects.

	Returns:
		List of objects.
	"""
	if input_class is not None:
		if not isinstance(input, (input_class, list)):
			raise Exception("The given variable should be an object of type '{}' or a list.".format(input_class))

	safe_list = [input]
	if isinstance(safe_list[0], list):
		safe_list = safe_list[0]

	return safe_list