code: def _find_cmd(cmd):
      """Find the full path to a .bat or .exe using the win32api module."""
      try:
          from win32api import SearchPath
      except ImportError:
          raise ImportError(
              "you need to have pywin32 installed for this to work"
          )
      else:
          PATH = os.environ["PATH"]
          extensions = [".exe", ".com", ".bat", ".py"]
          path = None
          for ext in extensions:
              try:
                  path = SearchPath(PATH, cmd, ext)[0]
              except:
                  pass
          if path is None:
              raise OSError("command %r not found" % cmd)
          else:
              return path
  
file_path: catboost/contrib/python/ipython/py2/IPython/utils/_process_win32.py
imports: from __future__ import print_function
  import os
  import sys
  import ctypes
  from ctypes import c_int, POINTER
  from ctypes.wintypes import LPCWSTR, HLOCAL
  from subprocess import STDOUT
  from ._process_common import read_no_interrupt, process_handler, arg_split
  from .None import py3compat
  from .encoding import DEFAULT_ENCODING
label_desc: Use image node_id 1 for calling a global function with example usage: _find_cmd(cmd) and returns: path