code: def _get_zipped_directory_size(directory):
      """Measures the compressed size of a directory."""
      with tempfile.TemporaryFile(suffix=".zip") as zipped_file:
          for root, _, files in os.walk(directory):
              for file in files:
                  with zipfile.ZipFile(
                      zipped_file, "w", compression=zipfile.ZIP_DEFLATED
                  ) as f:
                      f.write(
                          os.path.join(root, file),
                          os.path.relpath(
                              os.path.join(root, file),
                              os.path.join(directory, ".."),
                          ),
                      )
  
          zipped_file.seek(0, 2)
          return os.fstat(zipped_file.fileno()).st_size
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/algorithms/weight_clustering_test.py
imports: import os
  import tempfile
  import zipfile
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.common.keras.compression.algorithms import weight_clustering
label_desc: Use image node_id 5 for calling a global function with example usage: _get_zipped_directory_size(directory) and returns: os