code: def get_cuda_dirs(build_ext, cpp_flags):
      cuda_include_dirs = []
      cuda_lib_dirs = []
  
      cuda_home = os.environ.get("BLUEFOG_CUDA_HOME")
      if cuda_home:
          cuda_include_dirs += ["%s/include" % cuda_home]
          cuda_lib_dirs += [
              "%s/lib" % cuda_home,
              "%s/lib64" % cuda_home,
          ]
  
      cuda_include = os.environ.get("BLUEFOG_CUDA_INCLUDE")
      if cuda_include:
          cuda_include_dirs += [cuda_include]
  
      cuda_lib = os.environ.get("BLUEFOG_CUDA_LIB")
      if cuda_lib:
          cuda_lib_dirs += [cuda_lib]
  
      if not cuda_include_dirs and not cuda_lib_dirs:
          # default to /usr/local/cuda
          cuda_include_dirs += ["/usr/local/cuda/include"]
          cuda_lib_dirs += [
              "/usr/local/cuda/lib",
              "/usr/local/cuda/lib64",
          ]
  
      try:
          test_compile(
              build_ext,
              "test_cuda",
              libraries=["cudart"],
              include_dirs=cuda_include_dirs,
              library_dirs=cuda_lib_dirs,
              extra_compile_preargs=cpp_flags,
              code=textwrap.dedent(
                  """\
              #include <cuda_runtime.h>
              void test() {
                  cudaSetDevice(0);
              }
              """
              ),
          )
      except (CompileError, LinkError):
          raise DistutilsPlatformError(
              "CUDA library was not found (see error above).\n"
              "Please specify correct CUDA location with the BLUEFOG_CUDA_HOME "
              "environment variable or combination of BLUEFOG_CUDA_INCLUDE and "
              "BLUEFOG_CUDA_LIB environment variables.\n\n"
              "BLUEFOG_CUDA_HOME - path where CUDA include and lib directories can be found\n"
              "BLUEFOG_CUDA_INCLUDE - path to CUDA include directory\n"
              "BLUEFOG_CUDA_LIB - path to CUDA lib directory"
          )
  
      return cuda_include_dirs, cuda_lib_dirs
  
imports: import copy
  import os
  import re
  import shlex
  import subprocess
  import sys
  import textwrap
  import shlex
  import traceback
  from typing import List
  from distutils.errors import CompileError, DistutilsError, DistutilsPlatformError, DistutilsSetupError, LinkError
  from distutils.version import LooseVersion
  from setuptools import find_packages, setup, Extension
  from setuptools.command.build_ext import build_ext
  from bluefog import __version__
label_desc: Use image node_id 7 for calling a global function with example usage: get_cuda_dirs(build_ext, cpp_flags) and returns: cuda_include_dirs,  cuda_lib_dirs