code: def create_tree(
      path_to_info=None,
      *,
      by="networkx_path",
      skip=0,
      networkx_path=False,
      dispatch_name=False,
      version_added=False,
      plc=False,
      dispatch_name_if_different=False,
      incomplete=False,
      different=False,
      prefix="",
  ):
      if path_to_info is None:
          path_to_info = get_path_to_info()
      if isinstance(by, str):
          by = [by]
      G = nx.DiGraph()
      for info in sorted(
          path_to_info.values(),
          key=lambda x: (*(getattr(x, b) for b in by), x.networkx_path),
      ):
          if not all(getattr(info, b) for b in by):
              continue
          path = prefix + ".".join(getattr(info, b) for b in by)
          extra = get_extra(
              info,
              networkx_path=networkx_path,
              dispatch_name=dispatch_name,
              version_added=version_added,
              plc=plc,
              dispatch_name_if_different=dispatch_name_if_different,
              incomplete=incomplete,
              different=different,
          )
          add_branch(G, path, extra=extra, skip=skip)
      return G
  
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 3 for calling a global function with example usage: create_tree(path_to_info) and returns: G