code: def detect_compiler_type() -> Optional[CompilerType]:
      # check if user specifies the compiler type
      user_specify = os.environ.get("CXX", None)
      if user_specify:
          if user_specify in ["clang", "clang++"]:
              return CompilerType.CLANG
          elif user_specify in ["gcc", "g++"]:
              return CompilerType.GCC
  
          raise RuntimeError(
              f"User specified compiler is not valid {user_specify}"
          )
  
      # auto detect
      auto_detect_result = subprocess.check_output(
          ["cc", "-v"], stderr=subprocess.STDOUT
      ).decode("utf-8")
      if "clang" in auto_detect_result:
          return CompilerType.CLANG
      elif "gcc" in auto_detect_result:
          return CompilerType.GCC
      raise RuntimeError(
          f"Auto detected compiler is not valid {auto_detect_result}"
      )
  
file_path: pytorch/tools/code_coverage/package/oss/utils.py
imports: import os
  import subprocess
  from typing import List, Optional
  from ..util.setting import CompilerType, TestType, TOOLS_FOLDER
  from ..util.utils import print_error, remove_file
label_desc: Use image node_id 6 for calling a global function with example usage: detect_compiler_type() and returns: CompilerType, CompilerType, CompilerType, CompilerType