def get_subs(relativize_fn, links):
	""" Return a list of substitution pairs, where the first item is the
	original string (link) and the second item is the string to replace it
	(relativized link). Duplicate subs are filtered out."""
	subs = ((l, relativize_fn(l)) for l in links)
	subs = filter(lambda p: p[0] != p[1], subs) # filter out no-op substitutions
	return list(subs)