code: def _get_vc_env(plat_spec):
      if os.getenv("DISTUTILS_USE_SDK"):
          return {
              key.lower(): value for key, value in os.environ.items()
          }
  
      vcvarsall, _ = _find_vcvarsall(plat_spec)
      if not vcvarsall:
          raise DistutilsPlatformError("Unable to find vcvarsall.bat")
  
      try:
          out = subprocess.check_output(
              f'cmd /u /c "{vcvarsall}" {plat_spec} && set',
              stderr=subprocess.STDOUT,
          ).decode("utf-16le", errors="replace")
      except subprocess.CalledProcessError as exc:
          log.error(exc.output)
          raise DistutilsPlatformError(f"Error executing {exc.cmd}")
  
      env = {
          key.lower(): value
          for key, _, value in (
              line.partition("=") for line in out.splitlines()
          )
          if key and value
      }
  
      return env
  
imports: import os
  import subprocess
  import contextlib
  import warnings
  import unittest.mock
  from .errors import DistutilsExecError, DistutilsPlatformError, CompileError, LibError, LinkError
  from .ccompiler import CCompiler, gen_lib_options
  from ._log import log
  from .util import get_platform
  from itertools import count
label_desc: Use image node_id 4 for calling a global function with example usage: _get_vc_env(plat_spec) and returns: env, unknown