code: def _calculate_output_shape(input_shape, pool_size, strides, padding):
      """Calculates the shape of the unpooled output."""
      if padding == "VALID":
          output_shape = (
              input_shape[0],
              (input_shape[1] - 1) * strides[0] + pool_size[0],
              (input_shape[2] - 1) * strides[1] + pool_size[1],
              input_shape[3],
          )
      elif padding == "SAME":
          output_shape = (
              input_shape[0],
              input_shape[1] * strides[0],
              input_shape[2] * strides[1],
              input_shape[3],
          )
      else:
          raise ValueError(
              'Padding must be a string from: "SAME", "VALID"'
          )
      return output_shape
  
file_path: addons/tensorflow_addons/layers/max_unpooling_2d.py
imports: import tensorflow
  from typeguard import typechecked
  from typing import Union, Iterable
  from tensorflow_addons.utils.keras_utils import normalize_tuple
label_desc: Use image node_id 1 for calling a global function with example usage: _calculate_output_shape(input_shape, pool_size, strides, padding) and returns: output_shape