<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_paired(list):
 	""" 	require that both pairs are mapped in the sam file in order to remove the reads 	"""

	pairs = {}
	filtered = []
	for id in list:
		read = id.rsplit('/')[0]
		if read not in pairs:
			pairs[read] = []
		pairs[read].append(id)
	for read in pairs:
		ids = pairs[read]
		if len(ids) == 2:
			filtered.extend(ids)
	return set(filtered)