code: def _find_cudnn_config(base_paths, required_version):
      def get_header_version(path):
          version = (
              _get_header_version(path, name)
              for name in (
                  "CUDNN_MAJOR",
                  "CUDNN_MINOR",
                  "CUDNN_PATCHLEVEL",
              )
          )
          return ".".join(version)
  
      header_path, header_version = _find_header(
          base_paths, "cudnn.h", required_version, get_header_version
      )
      cudnn_version = header_version.split(".")[0]
  
      library_path = _find_library(base_paths, "cudnn", cudnn_version)
  
      return {
          "cudnn_version": cudnn_version,
          "cudnn_include_dir": os.path.dirname(header_path),
          "cudnn_library_dir": os.path.dirname(library_path),
      }
  
imports: import io
  import os
  import glob
  import platform
  import re
  import subprocess
  import sys
label_desc: Use image node_id 19 for calling a global function with example usage: _find_cudnn_config(base_paths, required_version) and returns: dict, str