code: def _check_build(self, std_cpp03, extension_name, python_exe):
      pkg_dir = "pkg"
      os.mkdir(pkg_dir)
      shutil.copy(SETUP, os.path.join(pkg_dir, os.path.basename(SETUP)))
      shutil.copy(
          SOURCE, os.path.join(pkg_dir, os.path.basename(SOURCE))
      )
  
      def run_cmd(operation, cmd):
          env = os.environ.copy()
          env["CPYTHON_TEST_CPP_STD"] = (
              "c++03" if std_cpp03 else "c++11"
          )
          env["CPYTHON_TEST_EXT_NAME"] = extension_name
          if support.verbose:
              print("Run:", " ".join(cmd))
              subprocess.run(cmd, check=True, env=env)
          else:
              proc = subprocess.run(
                  cmd,
                  env=env,
                  stdout=subprocess.PIPE,
                  stderr=subprocess.STDOUT,
                  text=True,
              )
              if proc.returncode:
                  print(proc.stdout, end="")
                  self.fail(
                      f"{operation} failed with exit code {proc.returncode}"
                  )
  
      # Build and install the C++ extension
      cmd = [
          python_exe,
          "-X",
          "dev",
          "-m",
          "pip",
          "install",
          "--no-build-isolation",
          os.path.abspath(pkg_dir),
      ]
      run_cmd("Install", cmd)
  
      # Do a reference run. Until we test that running python
      # doesn't leak references (gh-94755), run it so one can manually check
      # -X showrefcount results against this baseline.
      cmd = [
          python_exe,
          "-X",
          "dev",
          "-X",
          "showrefcount",
          "-c",
          "pass",
      ]
      run_cmd("Reference run", cmd)
  
      # Import the C++ extension
      cmd = [
          python_exe,
          "-X",
          "dev",
          "-X",
          "showrefcount",
          "-c",
          f"import {extension_name}",
      ]
      run_cmd("Import", cmd)
  
file_path: cpython/Lib/test/test_cppext/__init__.py
imports: import os.path
  import shutil
  import unittest
  import subprocess
  import sysconfig
  from test import support
label_desc: Use image node_id 4 for calling the TestCPPExt obj's underlying member method code with example usage: obj._check_build(std_cpp03, extension_name, python_exe) without return types