<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def schedule(demand: dict, alterations: set, looped: set=None, altered: set=None):
 	"""Prioritizes Triggers called from outside."""

	if looped is not None and len(demand) != len(looped):
		for func in looped: del demand[func]
	if keep_temp in demand:
		demand.pop(increase_temp, None)
		demand.pop(lower_temp, None)
	elif lower_temp in demand:
		demand.pop(increase_temp, None)
	return demand, alterations