code: def _pkg_config(name):
      command = os.environ.get("PKG_CONFIG", "pkg-config")
      for keep_system in (True, False):
          try:
              command_libs = [command, "--libs-only-L", name]
              command_cflags = [command, "--cflags-only-I", name]
              stderr = None
              if keep_system:
                  command_libs.append("--keep-system-libs")
                  command_cflags.append("--keep-system-cflags")
                  stderr = subprocess.DEVNULL
              if not DEBUG:
                  command_libs.append("--silence-errors")
                  command_cflags.append("--silence-errors")
              libs = re.split(
                  r"(^|\s+)-L",
                  subprocess.check_output(command_libs, stderr=stderr)
                  .decode("utf8")
                  .strip(),
              )[::2][1:]
              cflags = re.split(
                  r"(^|\s+)-I",
                  subprocess.check_output(command_cflags)
                  .decode("utf8")
                  .strip(),
              )[::2][1:]
              return libs, cflags
          except Exception:
              pass
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  import struct
  import subprocess
  import sys
  import warnings
  from setuptools import Extension, setup
  from setuptools.command.build_ext import build_ext
label_desc: Use image node_id 9 for calling a global function with example usage: _pkg_config(name) and returns: libs,  cflags