code: def test_node_parent_reinsertion():
      """Test that replacing a parent with the same one does not change anything"""
      parent = TreeNode("test")
      child1 = TreeNode("test", parent)
      child2 = TreeNode("test", parent)
  
      assert child1.parent is parent
      assert child2.parent is parent
      assert parent.children[0] is child1
      assert parent.children[1] is child2
  
      child1.set_parent(parent)
  
      assert child1.parent is parent
      assert child2.parent is parent
      assert parent.children[0] is child1
      assert parent.children[1] is child2
  
      child2.set_parent(parent)
  
      assert child1.parent is parent
      assert child2.parent is parent
      assert parent.children[0] is child1
      assert parent.children[1] is child2
  
imports: from orion.core.utils.tree import DepthFirstTraversal, PreOrderTraversal, TreeNode, flattened
label_desc: Use image node_id 16 for calling a global function with example usage: test_node_parent_reinsertion() without return types