code: def _preload_library(lib):
      """Preload dependent shared libraries.
  
      The preload configuration file (cupy/.data/_wheel.json) will be added
      during the wheel build process.
      """
  
      _log(f"Preloading triggered for library: {lib}")
  
      if not _can_attempt_preload(lib):
          return
      _preload_libs[lib] = {}
  
      config = get_preload_config()
      cuda_version = config["cuda"]
      _log("CuPy wheel package built for CUDA {}".format(cuda_version))
  
      cupy_cuda_lib_path = get_cupy_cuda_lib_path()
      _log("CuPy CUDA library directory: {}".format(cupy_cuda_lib_path))
  
      version = config[lib]["version"]
      filenames = config[lib]["filenames"]
      for filename in filenames:
          _log(f"Looking for {lib} version {version} ({filename})")
  
          # "lib": cuTENSOR (Linux/Windows) / NCCL (Linux)
          # "lib64": cuDNN (Linux)
          # "bin": cuDNN (Windows)
          libpath_cands = [
              os.path.join(
                  cupy_cuda_lib_path,
                  config["cuda"],
                  lib,
                  version,
                  x,
                  filename,
              )
              for x in ["lib", "lib64", "bin"]
          ]
          if lib == "cutensor":
              libpath_cands = (
                  _get_cutensor_from_wheel(version, config["cuda"])
                  + libpath_cands
              )
  
          for libpath in libpath_cands:
              if not os.path.exists(libpath):
                  _log(
                      "Rejected candidate (not found): {}".format(
                          libpath
                      )
                  )
                  continue
  
              try:
                  _log(f"Trying to load {libpath}")
                  # Keep reference to the preloaded module.
                  _preload_libs[lib][libpath] = ctypes.CDLL(libpath)
                  _log("Loaded")
                  break
              except Exception as e:
                  e_type = type(e).__name__  # NOQA
                  msg = (
                      f"CuPy failed to preload library ({libpath}): "
                      f"{e_type} ({e})"
                  )
                  _log(msg)
                  warnings.warn(msg)
          else:
              _log("File {} could not be found".format(filename))
  
              # Lookup library with fully-qualified version (e.g.,
              # `libcudnn.so.X.Y.Z`).
              _log(
                  f"Trying to load {filename} from default search path"
              )
              try:
                  _preload_libs[lib][filename] = ctypes.CDLL(filename)
                  _log("Loaded")
              except Exception as e:
                  # Fallback to the standard shared library lookup which only
                  # uses the major version (e.g., `libcudnn.so.X`).
                  _log(f"Library {lib} could not be preloaded: {e}")
  
imports: import ctypes
  import importlib.metadata
  import json
  import os
  import os.path
  import re
  import shutil
  import sys
  from typing import Any, Dict, List, Optional, Tuple
  import warnings
label_desc: Use image node_id 18 for calling a global function with example usage: _preload_library(lib) without return types