code: def _complete_partial_window_sizes(win_size, img_size):
      """
      Window size can be partially specified in the config.
      This function complete the window size by making it
      the same ndim as img_size, and set the not added dim
      to size None. None values in window will be realised
      when each image is loaded.
  
      :param win_size: a tuple of (partial) window size
      :param img_size: a tuple of image size
      :return: a window size with the same ndim as image size,
          with None components to be inferred at runtime
      """
      img_ndims = len(img_size)
      # crop win_size list if it's longer than img_size
      win_size = list(win_size[:img_ndims])
      while len(win_size) < N_SPATIAL:
          win_size.append(-1)
      # complete win_size list if it's shorter than img_size
      while len(win_size) < img_ndims:
          win_size.append(img_size[len(win_size)])
      # replace zero with full length in the n-th dim of image
      win_size = [win if win > 0 else None for win in win_size]
      return tuple(win_size)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import copy
  import numpy
  import tensorflow
  from tensorflow.python.data.util import nest
  from niftynet.utilities.util_common import ParserNamespace
label_desc: Use image node_id 2 for calling a global function with example usage: _complete_partial_window_sizes(win_size, img_size) and returns: tuple