def add_aliases(D, A):
    """
	Given a dict and a iterable of (name, [alias, ...]) pairs, create
	additional entries in the dict mapping each alias to the named function
	if it's in the dict.  Aliases for functions not in the dict are ignored.
	"""
    for name, aliases in A:
        try:
            F = D[name]
        except KeyError:
            continue
        for alias in aliases:
            D[alias] = F
