code: def _write_metadata(value):
      metadata = list(
          collections.OrderedDict(sorted(value.items())).values()
      )
      content = json.dumps(metadata, indent=2, ensure_ascii=False)
      content = re.sub(r"\s {8}", " ", content)
      content = re.sub(r",\s {8}", ", ", content)
      content = re.sub(r"\s {6}}", " }", content)
      _write(metadata_file, content)
  
file_path: netron/tools/pytorch_metadata.py
imports: import collections
  import json
  import os
  import re
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: _write_metadata(value) without return types