code: def genwincodec(codepage):
      import platform
  
      map = genwinmap(codepage)
      encodingname = "cp%d" % codepage
      code = codegen("", map, encodingname)
      # Replace first lines with our own docstring
      code = (
          '''\
  """Python Character Mapping Codec %s generated on Windows:
  %s with the command:
    python Tools/unicode/genwincodec.py %s
  """#"
  '''
          % (encodingname, " ".join(platform.win32_ver()), codepage)
          + code.split('"""#"', 1)[1]
      )
  
      print(code)
  
imports: import ctypes
  from ctypes import wintypes
  from gencodec import codegen
  import unicodedata
label_desc: Use image node_id 2 for calling a global function with example usage: genwincodec(codepage) without return types