<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def clear_queue(self, trans_id=None):
		''' Clear the queue of database operations without executing any of
			 the pending operations'''
		if not self.queue:
			return
		if trans_id is None:
			self.queue = []
			return

		for index, op in enumerate(self.queue):
			if op.trans_id == trans_id:
				break
		self.queue = self.queue[:index]