code: def remove_tree(path):
      @library.python.windows.diehard(
          library.python.windows.RETRIABLE_DIR_ERRORS,
          tries=_diehard_win_tries,
      )
      def rmtree(path):
          if library.python.windows.on_win():
              library.python.windows.rmtree(path)
          else:
              shutil.rmtree(fix_path_encoding(path))
  
      st = os.lstat(path)
      if stat.S_ISLNK(st.st_mode) or stat.S_ISREG(st.st_mode):
          remove_file(path)
      elif stat.S_ISDIR(st.st_mode):
          rmtree(path)
      else:
          assert False
  
imports: import codecs
  import errno
  import logging
  import os
  import random
  import shutil
  import six
  import stat
  import sys
  import library.python.func
  import library.python.strings
  import library.python.windows
label_desc: Use image node_id 9 for calling a global function with example usage: remove_tree(path) without return types