def getnodes(tree):
    if isinstance(tree, tuple):
        name, subtree = tree
        ab = [name]
        al = []
        #degenerate branches
        if len(subtree) == 1:
            adeg = [name]
        else:
            adeg = []

        for st in subtree:
            b, l, d = getnodes(st)
            ab.extend(b)
            al.extend(l)
            adeg.extend(d)
        return ab, al, adeg
    return [], [tree], []
Print system-related info, above the process list.
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/regression/treewalkerclass.py/getnodes--crossover with--dataset/ETHPy150Open giampaolo/psutil/scripts/top.py/print_header