<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def infer_compression(url):
 	""" 	Given a URL or filename, infer the compression code for tar. 	"""

	# cheat and just assume it's the last two characters
	compression_indicator = url[-2:]
	mapping = dict(
		gz='z',
		bz='j',
		xz='J',
	)
	# Assume 'z' (gzip) if no match
	return mapping.get(compression_indicator, 'z')