code: def rewrite_zip(root_dir, zip_filepath):
      """Rewrite the given .zip file into a new one containing compressed images.
  
      Args:
        root_dir: directory path which contain zip compressed file
        zip_filepath: path from directory to file
      """
      # Creating a temporary file to store images
      with tempfile.TemporaryDirectory(dir=root_dir) as temp_dir:
          # Extraction of compressed .zip file
          with zipfile.ZipFile(zip_filepath, "r") as zip_file:
              zip_file.extractall(path=temp_dir)
  
          rewrite_dir(
              temp_dir
          )  # Recursively compress the archive content
  
          # Compress the .zip file again
          with zipfile.ZipFile(
              zip_filepath,
              "w",
              compression=zipfile.ZIP_DEFLATED,
              compresslevel=zlib.Z_BEST_COMPRESSION,
          ) as zip_file:
              for file_dir, _, files in os.walk(temp_dir):
                  for file in files:
                      file_path = os.path.join(file_dir, file)
                      zip_file.write(
                          file_path,
                          arcname=os.path.relpath(file_path, temp_dir),
                      )
  
file_path: datasets/tensorflow_datasets/scripts/replace_fake_images.py
imports: import hashlib
  import os
  import tarfile
  import tempfile
  import zipfile
  import zlib
  import absl.app
  import absl.flags
  import numpy
  import PIL.Image
label_desc: Use image node_id 2 for calling a global function with example usage: rewrite_zip(root_dir, zip_filepath) without return types