code: def which(program):
      """
      Find and return the given program by its absolute path or 'None' if the program cannot be found.
      From: http://stackoverflow.com/a/377028
      """
  
      fpath = os.path.split(program)[0]
  
      if fpath:
          if is_exe(program):
              return program
      else:
          for path in os.environ.get("PATH").split(os.pathsep):
              path = path.strip('"')
              exe_file = os.path.join(path, program)
              if is_exe(exe_file):
                  return exe_file
      return None
  
file_path: spark/dev/sparktestsupport/shellutils.py
imports: import os
  import shutil
  import subprocess
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: which(program) and returns: None, program, exe_file