code: def pkgconfig_windows(package, kw):
      is_x64 = platform.machine().endswith("64")
      root_dir, dll_dir = find_pkg_dirs(package)
      include_dir = None
      library_dir = None
      parent = None
      while parent != root_dir:
          parent = os.path.dirname(
              dll_dir if parent is None else parent
          )
          if include_dir is None and os.path.exists(
              os.path.join(parent, "include")
          ):
              include_dir = os.path.join(parent, "include")
          library_dirs = set()
          libraries = glob(
              os.path.join(parent, "**", "lib", "**", "*.lib"),
              recursive=True,
          )
          for library in libraries:
              if (is_x64 and "x86" in library) or (
                  not is_x64 and "x64" in library
              ):
                  continue
              library_dirs.add(os.path.dirname(library))
          if library_dir is None and library_dirs:
              library_dir = sorted(library_dirs)[-1]
          if include_dir and library_dir:
              libraries = [
                  os.path.splitext(library)[0]
                  for library in glob(
                      os.path.join(library_dir, "*.lib")
                  )
              ]
              break
      if not include_dir or not library_dir:
          raise Exception(
              f"Could not find required package: {package}."
          )
      kw.setdefault("include_dirs", []).append(include_dir)
      kw.setdefault("library_dirs", []).append(library_dir)
      kw.setdefault("libraries", []).extend(libraries)
      return kw
  
file_path: ffcv/setup.py
imports: from setuptools import find_packages
  import subprocess
  from difflib import get_close_matches
  from glob import glob
  import os
  import platform
  from distutils.core import setup, Extension
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: pkgconfig_windows(package, kw) and returns: kw