def level(self):
        "Return number of levels this node is under root."
        count, node = 0, self
        while not node.root:
            node = node.parent
            count += 1
        return count
Return number of levels this node is under root.
recipes/Python/577635_Directory_Pruner_3/recipe-577635.py