<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cancel(self, consumer_tag=None):
 		""" 		Cancels the current consuming action by using the stored consumer_tag. If a consumer_tag is given, that one is used instead. 		Parameters 		consumer_tag: string 			Tag of consumer to cancel 		"""

		if not consumer_tag:
			if not hasattr(self, "consumer_tag"):
				return
			consumer_tag = self.consumer_tag
		self.channel.basic_cancel(consumer_tag)