code: def add_branch(G, path, extra="", *, skip=0):
      branch = path.split(".")
      prev = ".".join(branch[: skip + 1])
      for i in range(skip + 2, len(branch)):
          cur = ".".join(branch[:i])
          G.add_edge(prev, cur)
          prev = cur
      if extra:
          if not isinstance(extra, str):
              extra = ", ".join(extra)
          path += f" ({extra})"
      G.add_edge(prev, path)
  
file_path: cugraph/python/nx-cugraph/nx_cugraph/scripts/print_tree.py
imports: import argparse
  import re
  import sys
  import networkx
  from nx_cugraph.scripts.print_table import get_path_to_info
label_desc: Use image node_id 1 for calling a global function with example usage: add_branch(G, path, extra) without return types