code: def _get_directory_size_in_bytes(directory):
      total = 0
      try:
          for entry in os.scandir(directory):
              if entry.is_file():
                  # if it's a file, use stat() function
                  total += entry.stat().st_size
              elif entry.is_dir():
                  # if it's a directory, recursively call this function
                  total += _get_directory_size_in_bytes(entry.path)
      except NotADirectoryError:
          # if `directory` isn't a directory, get the file size then
          return os.path.getsize(directory)
      except PermissionError:
          # if for whatever reason we can't open the folder, return 0
          return 0
      return total
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/algorithms/different_training_and_inference_test.py
imports: import os
  import tempfile
  import tensorflow
  from tensorflow_model_optimization.python.core.common.keras.compression.algorithms import different_training_and_inference
  from tensorflow_model_optimization.python.core.keras.testing import test_utils_mnist
label_desc: Use image node_id 6 for calling a global function with example usage: _get_directory_size_in_bytes(directory) and returns: total, os, int