def RegListComp(list_reg_obj, date, gain):
	"""
	Filters the regression table objects by a specific date and gain setting
	:param list_reg_obj: a list objects of type regression class
	:param date: desired date as a python date time object
	:param gain: desired gain setting
	:return: regression object
	"""
	# gets the date only from the python date time object
	date = date.date()
	# use list comprehension to filter all elements with desired gain setting and date
	subset = [x for x in list_reg_obj if (x.date == date and x.gain == gain)]

	if len(subset) == 1:
		reg = subset[0]

	elif len(subset) == 0:
		# regression does not exist
		# need to do something with this use case
		raise Exception("Regression values does not exist for this date and gain setting!")
	else:
		raise Exception("Regression values for date and gain must be unique!")
	return reg