code: def subsample_nearest_neighbor(arr, size):
      src_height, src_width, _ = arr.shape
      dst_height, dst_width = size
      height_step = src_height // dst_height
      width_step = src_width // dst_width
      assert height_step * dst_height == src_height
      assert width_step * dst_width == src_width
  
      height_offset = int(np.floor((height_step - 1) / 2))
      width_offset = int(np.floor((width_step - 1) / 2))
      subsampled = arr[
          height_offset::height_step, width_offset::width_step, :
      ]
      return subsampled
  
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 8 for calling a global function with example usage: subsample_nearest_neighbor(arr, size) and returns: subsampled