<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sam_list(sam):
 	""" 	get a list of mapped reads 	"""

	list = []
	for file in sam:
		for line in file:
			if line.startswith('@') is False:
				line = line.strip().split()
				id, map = line[0], int(line[1])
				if map != 4 and map != 8:
					list.append(id)
	return set(list)