code: def check_types(config_cmd, ext, build_dir):
      private_defines = []
      public_defines = []
  
      # Expected size (in number of bytes) for each type. This is an
      # optimization: those are only hints, and an exhaustive search for the size
      # is done if the hints are wrong.
      expected = {
          "short": [2],
          "int": [4],
          "long": [8, 4],
          "float": [4],
          "double": [8],
          "long double": [16, 12, 8],
          "Py_intptr_t": [8, 4],
          "PY_LONG_LONG": [8],
          "long long": [8],
          "off_t": [8, 4],
      }
  
      # Check we have the python header (-dev* packages on Linux)
      result = config_cmd.check_header("Python.h")
      if not result:
          python = "python"
          if "__pypy__" in sys.builtin_module_names:
              python = "pypy"
          raise SystemError(
              "Cannot compile 'Python.h'. Perhaps you need to "
              "install {0}-dev|{0}-devel.".format(python)
          )
      res = config_cmd.check_header("endian.h")
      if res:
          private_defines.append(("HAVE_ENDIAN_H", 1))
          public_defines.append(("NPY_HAVE_ENDIAN_H", 1))
      res = config_cmd.check_header("sys/endian.h")
      if res:
          private_defines.append(("HAVE_SYS_ENDIAN_H", 1))
          public_defines.append(("NPY_HAVE_SYS_ENDIAN_H", 1))
  
      # Check basic types sizes
      for type in ("short", "int", "long"):
          res = config_cmd.check_decl(
              "SIZEOF_%s" % sym2def(type), headers=["Python.h"]
          )
          if res:
              public_defines.append(
                  (
                      "NPY_SIZEOF_%s" % sym2def(type),
                      "SIZEOF_%s" % sym2def(type),
                  )
              )
          else:
              res = config_cmd.check_type_size(
                  type, expected=expected[type]
              )
              if res >= 0:
                  public_defines.append(
                      ("NPY_SIZEOF_%s" % sym2def(type), "%d" % res)
                  )
              else:
                  raise SystemError(
                      "Checking sizeof (%s) failed !" % type
                  )
  
      for type in ("float", "double", "long double"):
          already_declared = config_cmd.check_decl(
              "SIZEOF_%s" % sym2def(type), headers=["Python.h"]
          )
          res = config_cmd.check_type_size(
              type, expected=expected[type]
          )
          if res >= 0:
              public_defines.append(
                  ("NPY_SIZEOF_%s" % sym2def(type), "%d" % res)
              )
              if not already_declared and not type == "long double":
                  private_defines.append(
                      ("SIZEOF_%s" % sym2def(type), "%d" % res)
                  )
          else:
              raise SystemError("Checking sizeof (%s) failed !" % type)
  
          # Compute size of corresponding complex type: used to check that our
          # definition is binary compatible with C99 complex type (check done at
          # build time in npy_common.h)
          complex_def = "struct {%s __x; %s __y;}" % (type, type)
          res = config_cmd.check_type_size(
              complex_def, expected=[2 * x for x in expected[type]]
          )
          if res >= 0:
              public_defines.append(
                  ("NPY_SIZEOF_COMPLEX_%s" % sym2def(type), "%d" % res)
              )
          else:
              raise SystemError(
                  "Checking sizeof (%s) failed !" % complex_def
              )
  
      for type in ("Py_intptr_t", "off_t"):
          res = config_cmd.check_type_size(
              type,
              headers=["Python.h"],
              library_dirs=[pythonlib_dir()],
              expected=expected[type],
          )
  
          if res >= 0:
              private_defines.append(
                  ("SIZEOF_%s" % sym2def(type), "%d" % res)
              )
              public_defines.append(
                  ("NPY_SIZEOF_%s" % sym2def(type), "%d" % res)
              )
          else:
              raise SystemError("Checking sizeof (%s) failed !" % type)
  
      # We check declaration AND type because that's how distutils does it.
      if config_cmd.check_decl("PY_LONG_LONG", headers=["Python.h"]):
          res = config_cmd.check_type_size(
              "PY_LONG_LONG",
              headers=["Python.h"],
              library_dirs=[pythonlib_dir()],
              expected=expected["PY_LONG_LONG"],
          )
          if res >= 0:
              private_defines.append(
                  ("SIZEOF_%s" % sym2def("PY_LONG_LONG"), "%d" % res)
              )
              public_defines.append(
                  (
                      "NPY_SIZEOF_%s" % sym2def("PY_LONG_LONG"),
                      "%d" % res,
                  )
              )
          else:
              raise SystemError(
                  "Checking sizeof (%s) failed !" % "PY_LONG_LONG"
              )
  
          res = config_cmd.check_type_size(
              "long long", expected=expected["long long"]
          )
          if res >= 0:
              # private_defines.append(('SIZEOF_%s' % sym2def('long long'), '%d' % res))
              public_defines.append(
                  ("NPY_SIZEOF_%s" % sym2def("long long"), "%d" % res)
              )
          else:
              raise SystemError(
                  "Checking sizeof (%s) failed !" % "long long"
              )
  
      if not config_cmd.check_decl("CHAR_BIT", headers=["Python.h"]):
          raise RuntimeError(
              "Config wo CHAR_BIT is not supported"
              ", please contact the maintainers"
          )
  
      return private_defines, public_defines
  
imports: import os
  import sys
  import sysconfig
  import pickle
  import copy
  import warnings
  import textwrap
  import glob
  from os.path import join
  from numpy.distutils import log
  from numpy.distutils.msvccompiler import lib_opts_if_msvc
  from distutils.dep_util import newer
  from sysconfig import get_config_var
  from numpy.compat import npy_load_module
  from setup_common import *
label_desc: Use image node_id 10 for calling a global function with example usage: check_types(config_cmd, ext, build_dir) and returns: private_defines,  public_defines