code: def _find_cmd(cmd):
      """Find the full path to a command using which."""
      paths = System.Environment.GetEnvironmentVariable("PATH").Split(
          os.pathsep
      )
      for path in paths:
          filename = os.path.join(path, cmd)
          if System.IO.File.Exists(filename):
              return py3compat.bytes_to_str(filename)
      raise OSError("command %r not found" % cmd)
  
file_path: catboost/contrib/python/ipython/py2/IPython/utils/_process_cli.py
imports: import clr
  import System
  import os
  from IPython.utils import py3compat
  from ._process_common import arg_split
label_desc: Use image node_id 1 for calling a global function with example usage: _find_cmd(cmd) and returns: py3compat