import re


def get_set(srr_rar_block):	
	"""
	An SRR file can contain re-creation data of different RAR sets.
	This function tries to pick the basename of such a set.
	"""
	n = srr_rar_block.file_name[:-4]
	match = re.match("(.*)\.part\d*$", n, re.I)
	if match:
		return match.group(1)
	else:
		return n