@classmethod
def expand(cls, aliases, tree):
    """Expand aliases in tree, recursively.

        'aliases' is a dictionary mapping user defined aliases to alias objects.
        """
    return cls._expand(aliases, tree, [], {})
