def _expand(dict_in):
	""" Convert {key1: list1, key2: list2} to
	{list1[0]: key1, list1[1]: key1, list2[0]: key2 etc}
	"""
	dict_out = {}
	for key in dict_in:
		for item in dict_in[key]:
			dict_out[item] = key
	return dict_out