'Create a top level tree item and its children'

@staticmethod
def create_top_level_item(name, dict_children, icon=None, ellipsis=None):

    def create_children(grouped_branches):
        u'Create    children    items    for    a    tree    item'
        result = []
        for (k, v) in grouped_branches.items():
            item = BranchTreeWidgetItem(k, icon=icon)
            item.addChildren(create_children(v))
            if ((item.childCount() > 0) and (ellipsis is not None)):
                item.setIcon(0, ellipsis)
            result.append(item)
        return result
    branch = BranchTreeWidgetItem(name, icon=ellipsis)
    branch.addChildren(create_children(dict_children))
    return branch
