code: def add_nodes_to_digraph(
      node: DagNodeT, dot: graphviz.Digraph
  ) -> None:
      """Adds the node (and parent nodes) to the dot for visualization."""
      for parent_node in node.parent_nodes:
          add_nodes_to_digraph(parent_node, dot)
  
      dot.node(name=node.node_id.id_str, label=node.graphviz_label)
      for parent_node in node.parent_nodes:
          dot.edge(
              tail_name=parent_node.node_id.id_str,
              head_name=node.node_id.id_str,
          )
  
file_path: metricflow/metricflow/dag/dag_visualization.py
imports: from __future__ import annotations
  import logging
  import os
  from typing import TypeVar
  import graphviz
  from metricflow.dag.mf_dag import DagNode, MetricFlowDag
  from metricflow.random_id import random_id
label_desc: Use image node_id 1 for calling a global function with example usage: add_nodes_to_digraph(node, dot) without return types