<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def register(template_class,*extensions):
		''' Register a template for a given extension or range of extensions '''
		for ext in extensions:
			ext = normalize(ext)
			if not Lean.template_mappings.has_key(ext):
				Lean.template_mappings[ext] = []

			Lean.template_mappings[ext].insert(0,template_class)
			Lean.template_mappings[ext] = unique(Lean.template_mappings[ext])