code: def _transform(index, outs):
      import networkx as nx
  
      from dvc.stage import Stage
  
      def _relabel(node) -> str:
          return (
              node.addressing if isinstance(node, Stage) else str(node)
          )
  
      graph = index.outs_graph if outs else index.graph
      return nx.relabel_nodes(graph, _relabel, copy=True)
  
file_path: dvc/dvc/commands/dag.py
imports: from typing import TYPE_CHECKING
  from dvc.cli import formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.ui import ui
label_desc: Use image node_id 6 for calling a global function with example usage: _transform(index, outs) and returns: nx, unknown