code: def replace_name(expr: AST, old_name: str, new_name: str) -> AST:
      
      return _NameReplacer(old_name, new_name).visit(deepcopy(expr))
docs: Replace all Name nodes named `old_name` with nodes named `new_name`.