code: def parse_dox(project, path):
      tree = ET.parse(
          os.path.realpath(
              os.path.join(
                  path,
                  "..",
                  "build-doc",
                  "doc",
                  "xml-" + project,
                  "index.xml",
              )
          )
      )
      root = tree.getroot()
      toctree = ".. toctree::\n\tmaxdepth: 1\n\n"
      os.mkdir(os.path.join(path, "cpp", project))
      os.mkdir(os.path.join(path, "cpp", project, "class"))
      os.mkdir(os.path.join(path, "cpp", project, "struct"))
      os.mkdir(os.path.join(path, "cpp", project, "namespace"))
      title = project.replace("Cpp", "").replace("-", " ")
      with open(
          os.path.join(path, "cpp", project, "class.rst"), "w"
      ) as rst:
          rst.write(
              "NNABLA " + title + "Class\n============\n\n" + toctree
          )
          rst.close()
      with open(
          os.path.join(path, "cpp", project, "struct.rst"), "w"
      ) as rst:
          rst.write(
              "NNABLA " + title + "Struct\n=============\n\n" + toctree
          )
          rst.close()
      with open(
          os.path.join(path, "cpp", project, "namespace.rst"), "w"
      ) as rst:
          rst.write(
              "NNABLA "
              + title
              + "Namespace\n================\n\n"
              + toctree
          )
          rst.close()
  
      for child in root:
          name = child.find("name").text
          if child.attrib["kind"] == "class":
              ref = child.attrib["refid"]
              subtree = ET.parse(
                  os.path.realpath(
                      os.path.join(
                          path,
                          "..",
                          "build-doc",
                          "doc",
                          "xml-" + project,
                          ref + ".xml",
                      )
                  )
              )
              if check_not_empty(subtree):
                  write_rst("class", name, project, path)
          elif child.attrib["kind"] == "struct":
              ref = child.attrib["refid"]
              subtree = ET.parse(
                  os.path.realpath(
                      os.path.join(
                          path,
                          "..",
                          "build-doc",
                          "doc",
                          "xml-" + project,
                          ref + ".xml",
                      )
                  )
              )
              if check_not_empty(subtree):
                  write_rst("struct", name, project, path)
          elif child.attrib["kind"] == "namespace":
              ref = child.attrib["refid"]
              subtree = ET.parse(
                  os.path.realpath(
                      os.path.join(
                          path,
                          "..",
                          "build-doc",
                          "doc",
                          "xml-" + project,
                          ref + ".xml",
                      )
                  )
              )
              if check_not_empty(subtree):
                  write_rst("namespace", name, project, path)
          else:
              continue
  
imports: import os
  import sys
  import xml.etree.ElementTree
label_desc: Use image node_id 4 for calling a global function with example usage: parse_dox(project, path) without return types