code: def rename_edges(self, old_node_name, new_node_name):
          
          graph = self.graph
          for node, edges in graph.items():
              if node == old_node_name:
                  graph[new_node_name] = copy(edges)
                  del graph[old_node_name]
  
              else:
                  if old_node_name in edges:
                      edges.remove(old_node_name)
                      edges.add(new_node_name)
docs: Change references to a node in existing edges.
  
          Args:
              old_node_name (str): The old name for the node.
              new_node_name (str): The new name for the node.