code: def conv_output_shape(
      dimension_size, filter_size, padding, stride, dilation=1
  ):
      """
      Computes convolution's output shape for one spatial dimension.
  
      Parameters
      ----------
      dimension_size : int or None
          Size of the dimension. Typically it's image's weight or height.
          It might be equal to ``None`` when we input might have variable
          dimension.
  
      filter_size : int
          Size of the convolution filter.
  
      padding : {``valid``, ``same``} or int
          Type or size of the zero-padding.
  
      stride : int
          Stride size.
  
      dilation : int
          Dilation rate. Defaults to ``1``.
  
      Returns
      -------
      int
          Dimension size after applying convolution
          operation with specified configurations.
      """
      if isinstance(dimension_size, tf.Dimension):
          dimension_size = dimension_size.value
  
      if dimension_size is None:
          return None
  
      if not isinstance(stride, int):
          raise ValueError(
              "Stride needs to be an integer, got {} (value {!r})"
              "".format(type(stride), stride)
          )
  
      if not isinstance(filter_size, int):
          raise ValueError(
              "Filter size needs to be an integer, got {} "
              "(value {!r})".format(type(filter_size), filter_size)
          )
  
      # We can think of the dilation as very sparse convolutional filter
      # filter=3 and dilation=2 the same as filter=5 and dilation=1
      filter_size = filter_size + (filter_size - 1) * (dilation - 1)
  
      if padding in ("VALID", "valid"):
          return int(
              math.ceil((dimension_size - filter_size + 1) / stride)
          )
  
      elif padding in ("SAME", "same"):
          return int(math.ceil(dimension_size / stride))
  
      elif isinstance(padding, int):
          return int(
              math.ceil(
                  (dimension_size + 2 * padding - filter_size + 1)
                  / stride
              )
          )
  
      raise ValueError(
          "`{!r}` is unknown convolution's padding value".format(
              padding
          )
      )
  
imports: from __future__ import division
  import math
  import collections
  import six
  import tensorflow
  from neupy import init
  from neupy.utils import as_tuple
  from neupy.exceptions import LayerConnectionError
  from neupy.core.properties import TypedListProperty, Property, ParameterProperty
  from .base import BaseLayer
label_desc: Use image node_id 2 for calling a global function with example usage: conv_output_shape(dimension_size, filter_size, padding, stride, dilation) and returns: None, int, int, int