<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retry_call(func, cleanup=lambda: None, retries=0, trap=()):
 	""" 	Given a callable func, trap the indicated exceptions 	for up to 'retries' times, invoking cleanup on the 	exception. On the final attempt, allow any exceptions 	to propagate. 	"""

	attempts = count() if retries == float('inf') else range(retries)
	for attempt in attempts:
		try:
			return func()
		except trap:
			cleanup()

	return func()