code: def replace_nodes(root, old, new):
  
      '''
      Replace the old node with the new one. 
      Old must be an indirect child of root
       
      :param root: ast node that contains an indirect reference to old
      :param old: node to replace
      :param new: node to replace `old` with 
      '''
  
      rep = Replacer(old, new)
      rep.visit(root)
      returf replace_nodes(root, old, new):
  
      '''
      Replace the old node with the new one. 
      Old must be an indirect child of root
       
      :param root: ast node that contains an indirect reference to old
      :param old: node to replace
      :param new: node to replace `old` with 
      '''
  
      rep = Replacer(old, new)
      rep.visit(root)
      return
docs: Replace the old node with the new one. 
      Old must be an indirect child of root
       
      :param root: ast node that contains an indirect reference to old
      :param old: node to replace
      :param new: node to replace `old` with