code: def _read_window_sizes(input_mod_list, input_window_sizes):
      """
      Read window_size for each of the input image names defined
      by input_mod_list.keys().
  
      This function ensures that in the multimodality case
      the spatial window sizes are the same across modalities.
      For example::
  
      # the input indicates `image` is a concatenation of `mr` and `ct`.
      input_mod_list = {'image': ('mr', 'ct')}
      input_window_sizes = {'mr': (42, 42, 42)}
      returns: {'image': (42, 42, 42)}
  
      input_mod_list = ('image',)
      input_window_sizes = {'image': (42, 42, 42)}
      returns: {'image': (42, 42, 42)}
  
      input_mod_list = ('image',)
      input_window_sizes = (42, 42, 42)
      returns: {'image': (42, 42, 42)}
  
      # the input indicates a `image` and a `label` output.
      input_mod_list = ('image','label')
      input_window_sizes = (42, 42, 42)
      returns: {'image': (42, 42, 42), 'label': (42, 42, 42)}
  
      :param input_mod_list: list/dictionary of input source names
      :param input_window_sizes: input source properties obtained
          by parameters parser
      :return: {'output_name': spatial window size} dictionary
      """
      window_sizes = {}
      if isinstance(input_window_sizes, (tuple, list)):
          try:
              win_sizes = [
                  int(win_size) for win_size in input_window_sizes
              ]
          except ValueError:
              tf.logging.fatal(
                  "spatial window should be an array of int"
              )
              raise
          # single window size for all inputs
          for name in set(input_mod_list):
              window_sizes[name] = win_sizes
          return window_sizes
  
      if isinstance(
          input_window_sizes, (ParserNamespace, argparse.Namespace)
      ):
          input_window_sizes = vars(input_window_sizes)
  
      if not isinstance(input_window_sizes, dict):
          raise ValueError(
              "window sizes should be a list/tuple/dictionary"
          )
  
      output_names = set(input_mod_list)
      for name in output_names:
          window_size = None
          if name in input_window_sizes:
              # resolve output window size as input_window_sizes spec.
              window_size = input_window_sizes[name]
          for mod in input_mod_list[name]:
              # resolve output window size as input mod window size dict item
              if mod in input_window_sizes:
                  window_size = input_window_sizes[mod]
          if not window_size:
              # input size not resolved
              raise ValueError(
                  "Unknown output window size "
                  "for input image {}".format(name)
              )
          if name in window_sizes:
              assert window_size == window_sizes[name], (
                  "trying to use different window sizes for "
                  "the concatenated input {}".format(name)
              )
          window_sizes[name] = window_size
      return window_sizes
  
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 1 for calling a global function with example usage: _read_window_sizes(input_mod_list, input_window_sizes) and returns: window_sizes, window_sizes