code: def create_non_leaf_nodes(
      parent_node_name, child_node_name, all_ops, general_children_dict
  ):
      """
      Create a path from leaf to root, e.g. /a/b/c -> /a/b -> /a -> /. If node in path not exists, \
          create one and fill information.
      Args:
          parent_node_name: name of parent node
          child_node_name: name of current node
          all_ops: used to store and index all nodes.
          general_children_dict: used to store all descendants for each non-leaf node.
      """
      if parent_node_name == "/" or parent_node_name == "":  # root node
          parent_node_name = "/"
      if parent_node_name not in all_ops:
          all_ops[parent_node_name] = {}
          all_ops[parent_node_name]["children_node"] = set()
          all_ops[parent_node_name]["name"] = parent_node_name
          all_ops[parent_node_name]["show_name"] = os.path.dirname(
              all_ops[child_node_name]["show_name"]
          )
          all_ops[parent_node_name]["attrs"] = {}
          all_ops[parent_node_name]["input_nodes"] = set()
          all_ops[parent_node_name]["output_nodes"] = set()
          all_ops[parent_node_name]["type"] = os.path.basename(
              all_ops[parent_node_name]["show_name"]
          )
          all_ops[parent_node_name]["input_vars"] = set()
          all_ops[parent_node_name]["output_vars"] = set()
          all_ops[parent_node_name]["parent_node"] = ""
          all_ops[parent_node_name]["edge_input_nodes"] = []
          all_ops[parent_node_name]["edge_output_nodes"] = []
          all_ops[parent_node_name]["is_leaf_node"] = False
  
      all_ops[child_node_name]["parent_node"] = parent_node_name
      all_ops[parent_node_name]["children_node"].add(child_node_name)
      general_children_dict[parent_node_name].add(child_node_name)
      general_children_dict[parent_node_name].update(
          general_children_dict[child_node_name]
      )
      if parent_node_name == "/":  # root node
          return
      else:
          create_non_leaf_nodes(
              os.path.dirname(parent_node_name),
              parent_node_name,
              all_ops,
              general_children_dict,
          )
  
file_path: VisualDL/visualdl/component/graph/graph_component.py
imports: import collections
  import os.path
  import pathlib
  import re
  from .None import utils
label_desc: Use image node_id 2 for calling a global function with example usage: create_non_leaf_nodes(parent_node_name, child_node_name, all_ops, general_children_dict) without return types