code: def _find_nccl_config(base_paths, required_version):
      def get_header_version(path):
          version = (
              _get_header_version(path, name)
              for name in ("NCCL_MAJOR", "NCCL_MINOR", "NCCL_PATCH")
          )
          return ".".join(version)
  
      header_path, header_version = _find_header(
          base_paths, "nccl.h", required_version, get_header_version
      )
      nccl_version = header_version.split(".")[0]
  
      library_path = _find_library(base_paths, "nccl", nccl_version)
  
      return {
          "nccl_version": nccl_version,
          "nccl_include_dir": os.path.dirname(header_path),
          "nccl_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 24 for calling a global function with example usage: _find_nccl_config(base_paths, required_version) and returns: dict, str