code: def main():
      papers = []
      for f in HOME.iterdir():
          papers += collect(f)
  
      papers.sort(key=lambda p: p["arxiv_id"])
  
      by_id = {}
      for p in papers:
          if p["arxiv_id"] not in by_id:
              by_id[p["arxiv_id"]] = []
          by_id[p["arxiv_id"]].append(
              f"""https://nn.labml.ai/{p['url']}"""
          )
  
      logger.log([("Papers", Text.key), ": ", f"{len(by_id) :,}"])
  
      with open(str(HOME.parent / "docs" / "papers.json"), "w") as f:
          f.write(json.dumps(by_id, indent=1))
  
imports: import json
  import re
  from pathlib import Path
  from labml import logger
  from labml.logger import Text
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types