code: def get_header_version_info(srcdir):
      patchlevel_h = os.path.join(
          srcdir, "..", "Include", "patchlevel.h"
      )
  
      # This won't pick out all #defines, but it will pick up the ones we
      # care about.
      rx = re.compile(
          r"\s*#define\s+([a-zA-Z][a-zA-Z_0-9]*)\s+([a-zA-Z_0-9]+)"
      )
  
      d = {}
      with open(patchlevel_h) as f:
          for line in f:
              m = rx.match(line)
              if m is not None:
                  name, value = m.group(1, 2)
                  d[name] = value
  
      release = version = "%s.%s" % (
          d["PY_MAJOR_VERSION"],
          d["PY_MINOR_VERSION"],
      )
      micro = int(d["PY_MICRO_VERSION"])
      release += "." + str(micro)
  
      level = d["PY_RELEASE_LEVEL"]
      suffixes = {
          "PY_RELEASE_LEVEL_ALPHA": "a",
          "PY_RELEASE_LEVEL_BETA": "b",
          "PY_RELEASE_LEVEL_GAMMA": "rc",
      }
      if level != "PY_RELEASE_LEVEL_FINAL":
          release += suffixes[level] + str(int(d["PY_RELEASE_SERIAL"]))
      return version, release
  
imports: from __future__ import print_function
  import os
  import re
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: get_header_version_info(srcdir) and returns: version,  release