code: def get_directory_size(directory: str) -> int:
      """Return the size of a directory in bytes."""
      total_size = 0
      for dirpath, _, filenames in os.walk(directory):
          for f in filenames:
              fp = os.path.join(dirpath, f)
              total_size += os.path.getsize(fp)
      return total_size
  
file_path: gradio/js/wasm/src/webworker/py/unload_modules.py
imports: import logging
  import fnmatch
  import os
  import sys
  import types
  from typing import Optional, Set
label_desc: Use image node_id 2 for calling a global function with example usage: get_directory_size(directory) and returns: total_size