code: def test_leafs():
      root = build_full_tree(4)
  
      assert [node.item for node in root.leafs] == list(range(7, 15))
  
      root.children[0].children[0].children[0].drop_parent()
      assert [node.item for node in root.leafs] == list(range(8, 15))
  
      root.children[0].children[1].drop_parent()
      assert [node.item for node in root.leafs] == [8, 11, 12, 13, 14]
  
      root.children[1].children[0].drop_children()
      assert [node.item for node in root.leafs] == [8, 5, 13, 14]
  
      root.children[1].drop_children()
      assert [node.item for node in root.leafs] == [8, 2]
  
      root.drop_children()
      assert [node.item for node in root.leafs] == [0]
  
imports: from orion.core.utils.tree import DepthFirstTraversal, PreOrderTraversal, TreeNode, flattened
label_desc: Use image node_id 24 for calling a global function with example usage: test_leafs() without return types