code: def compare_model_file_sizes(
      output_uri: str, expected_uri: str, threshold: float
  ) -> bool:
      """Compares pipeline output files sizes in output and recorded uri.
  
      Args:
        output_uri: pipeline output artifact uri.
        expected_uri: recorded pipeline output artifact uri.
        threshold: a float between 0 and 1.
  
      Returns:
         boolean whether file sizes differ within a threshold.
      """
      for dir_name, sub_dirs, leaf_files in fileio.walk(expected_uri):
          if (
              "Format-TFMA" in dir_name
              or "eval_model_dir" in dir_name
              or "export" in dir_name
          ):
              continue
          for sub_dir in sub_dirs:
              new_file_path = os.path.join(
                  dir_name.replace(expected_uri, output_uri, 1), sub_dir
              )
              if not fileio.exists(new_file_path):
                  return False
          for leaf_file in leaf_files:
              if leaf_file.startswith("events.out.tfevents"):
                  continue
              expected_file_name = os.path.join(dir_name, leaf_file)
              file_name = os.path.join(
                  dir_name.replace(expected_uri, output_uri, 1),
                  leaf_file,
              )
              if not _compare_relative_difference(
                  fileio.open(file_name).size(),
                  fileio.open(expected_file_name).size(),
                  threshold,
              ):
                  return False
      return True
  
imports: import filecmp
  import os
  from typing import Dict, List, Optional
  from absl import logging
  import tensorflow_model_analysis
  from tfx import types
  from tfx.dsl.io import fileio
  from tfx.experimental.pipeline_testing import pipeline_recorder_utils
  from tfx.orchestration import metadata
  from tfx.types import artifact_utils
  from tfx.utils import io_utils
  from ml_metadata.proto import metadata_store_pb2
  from tensorflow_metadata.proto.v0 import anomalies_pb2
label_desc: Use image node_id 8 for calling a global function with example usage: compare_model_file_sizes(output_uri, expected_uri, threshold) and returns: True, False, False