<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expandtree(self, model=None):
 """ Goes through the expand options associated with this context and returns a trie of data. :param model: subclass of <orb.Model> || None :return: <dict> """

        if model and not self.columns:
            schema = model.schema()
            defaults = schema.columns(flags=orb.Column.Flags.AutoExpand).keys()
            defaults += schema.collectors(flags=orb.Collector.Flags.AutoExpand).keys()
        else:
            defaults = []

        expand = self.expand or defaults
        if not expand:
            return {}

        def build_tree(parts, tree):
            tree.setdefault(parts[0], {})
            if len(parts) > 1:
                build_tree(parts[1:], tree[parts[0]])

        tree = {}
        for branch in expand:
            build_tree(branch.split('.'), tree)

        return tree