code: def parse_errors_txt(url):
      classes = {}
      errors = defaultdict(dict)
  
      page = urlopen(url)
      for line in page:
          # Strip comments and skip blanks
          line = line.decode("ascii").split("#")[0].strip()
          if not line:
              continue
  
          # Parse a section
          m = re.match(r"Section: (Class (..) - .+)", line)
          if m:
              label, class_ = m.groups()
              classes[class_] = label
              continue
  
          # Parse an error
          m = re.match(
              r"(.....)\s+(?:E|W|S)\s+ERRCODE_(\S+)(?:\s+(\S+))?$", line
          )
          if m:
              errcode, macro, spec = m.groups()
              # skip errcodes without specs as they are not publicly visible
              if not spec:
                  continue
              errlabel = spec.upper()
              errors[class_][errcode] = errlabel
              continue
  
          # We don't expect anything else
          raise ValueError(f"unexpected line:\n{line}")
  
      return classes, errors
  
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 2 for calling a global function with example usage: parse_errors_txt(url) and returns: classes,  errors