code: def gen_diagnostics(
      rules_path: str,
      out_py_dir: str,
      out_cpp_dir: str,
      out_docs_dir: str,
  ) -> None:
      with open(rules_path) as f:
          rules = yaml.load(f, Loader=YamlLoader)
  
      template_dir = os.path.join(
          os.path.dirname(os.path.abspath(__file__)), "templates"
      )
  
      gen_diagnostics_python(
          rules,
          out_py_dir,
          template_dir,
      )
  
      gen_diagnostics_cpp(
          rules,
          out_cpp_dir,
          template_dir,
      )
  
      gen_diagnostics_docs(rules, out_docs_dir, template_dir)
  
file_path: pytorch/tools/onnx/gen_diagnostics.py
imports: import argparse
  import os
  import string
  import subprocess
  import textwrap
  from typing import Any, Mapping, Sequence
  import yaml
  from torchgen import utils
  from torchgen.yaml_utils import YamlLoader
label_desc: Use image node_id 10 for calling a global function with example usage: gen_diagnostics(rules_path, out_py_dir, out_cpp_dir, out_docs_dir) without return types