code: def subsample_avg(arr, size):
      src_height, src_width, channels = arr.shape
      dst_height, dst_width = size
      height_bin = src_height // dst_height
      width_bin = src_width // dst_width
      return np.round(
          arr.reshape(
              (dst_height, height_bin, dst_width, width_bin, channels)
          ).mean(axis=(1, 3))
      ).astype(np.uint8)
  
imports: import dataclasses
  import json
  import logging
  import imageio
  import numpy
  import png
  import tensorflow
  import tensorflow_datasets.public_api
  from typing import List, Dict, Union
label_desc: Use image node_id 10 for calling a global function with example usage: subsample_avg(arr, size) and returns: np