code: def get_tree_size(path, recursive=False, raise_all_errors=False):
      if os.path.isfile(path):
          return get_file_size(path)
      total_size = 0
      for dir_path, _, files in os.walk(path):
          for f in files:
              fp = os.path.join(dir_path, f)
              try:
                  total_size += get_file_size(fp)
              except OSError as e:
                  if raise_all_errors:
                      raise
                  logger.debug("Cannot calculate file size: %s", e)
          if not recursive:
              break
      return total_size
  
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 26 for calling a global function with example usage: get_tree_size(path, recursive, raise_all_errors) and returns: total_size, get_file_size