code: def main():
      filename = os.path.join(
          os.path.dirname(__file__), "../psycopg/sqlstate_errors.h"
      )
  
      # If you add a version to the list fix the docs (in errors.rst)
      classes, errors = fetch_errors(
          "9.1 9.2 9.3 9.4 9.5 9.6 10 11 12 13 14 15".split()
      )
  
      f = open(filename, "w")
      print(
          "/*\n * Autogenerated by 'scripts/make_errors.py'.\n */\n",
          file=f,
      )
      for line in generate_module_data(classes, errors):
          print(line, file=f)
  
file_path: psycopg2/scripts/make_errors.py
imports: import os
  import re
  import sys
  from urllib.request import urlopen
  from collections import defaultdict
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types