code: def main():
      argparser = argparse.ArgumentParser()
      argparser.add_argument(
          "--logdir", default="wandb/latest-run/logs/"
      )
      argparser.add_argument("--format", default="mermaid")
      args = argparser.parse_args()
  
      parser = TracelogParser()
      parser.loaddir(args.logdir)
      if args.format == "plantuml":
          parser.output_plantuml()
      elif args.format == "mermaid":
          parser.output_mermaid()
      else:
          print(f"Unknown format: {args.format}")
          sys.exit(1)
  
file_path: wandb/tools/tracelog-tool.py
imports: import argparse
  import pathlib
  import sys
  from dataclasses import dataclass
  from typing import List
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types