code: def preprocess(tool, filename, cwd=None, **kwargs):
      argv = _build_argv(tool, filename, **kwargs)
      logger.debug(" ".join(shlex.quote(v) for v in argv))
  
      # Make sure the OS is supported for this file.
      if _expected := is_os_mismatch(filename):
          error = None
          raise OSMismatchError(filename, _expected, argv, error, TOOL)
  
      # Run the command.
      with converted_error(tool, argv, filename):
          # We use subprocess directly here, instead of calling the
          # distutil compiler object's preprocess() method, since that
          # one writes to stdout/stderr and it's simpler to do it directly
          # through subprocess.
          return run_cmd(argv, cwd=cwd)
  
file_path: cpython/Tools/c-analyzer/c_parser/preprocessor/common.py
imports: import contextlib
  import distutils.ccompiler
  import logging
  import os
  import shlex
  import subprocess
  import sys
  from ..info import FileInfo, SourceLine
  from .errors import PreprocessorFailure, ErrorDirectiveError, MissingDependenciesError, OSMismatchError
label_desc: Use image node_id 2 for calling a global function with example usage: preprocess(tool, filename, cwd) and returns: run_cmd