code: def make_undirected_copy(dag):
      """Returns an exact copy of the dag
      except that direction of edges are dropped."""
      nodes = {}
  
      for node in dag.nodes:
          undirected_node = UndirectedNode(name=node.name)
          undirected_node.func = node.func
          undirected_node.argspec = node.argspec
          undirected_node.variable_name = node.variable_name
          nodes[node.name] = undirected_node
      # Now we need to traverse the original
      # nodes once more and add any parents
      # or children as neighbours.
      for node in dag.nodes:
          for parent in node.parents:
              nodes[node.name].neighbours.append(nodes[parent.name])
              nodes[parent.name].neighbours.append(nodes[node.name])
  
      g = UndirectedGraph(list(nodes.values()))
      return g
  
imports: import copy
  import heapq
  import logging
  from collections import defaultdict
  from io import StringIO
  from itertools import combinations, product
  from random import choice, random
  from .exceptions import VariableNotInGraphError, VariableValueNotInDomainError
  from .graph import Node, UndirectedGraph, UndirectedNode, connect
  from .utils import get_args, get_original_factors
label_desc: Use image node_id 5 for calling a global function with example usage: make_undirected_copy(dag) and returns: g