from typing import List
from typing import Tuple


def clean_location(location: str, replacements: List[Tuple[str,str]]) -> str:
	"""Clean the location by removing the building and room specifications and handling replacements

	Keyword arguments:
	location     -- the location
	replacements -- a list of tuples with pairs of (old, new)
	"""
	new_location = ''.join(location.split('Building: '))
	new_location = ''.join(new_location.split(' Room: '))

	# Replace substrings in the location as set in configuration file
	for pair in replacements:
		new_location = new_location.replace(pair[0], pair[1])
	return new_location