code: def rm_r(path):
      """
      Given an arbitrary path, properly remove it with the correct Python construct if it exists.
      From: http://stackoverflow.com/a/9559881
      """
  
      if os.path.isdir(path):
          shutil.rmtree(path)
      elif os.path.exists(path):
          os.remove(path)
  
file_path: spark/dev/sparktestsupport/shellutils.py
imports: import os
  import shutil
  import subprocess
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: rm_r(path) without return types