code: def assert_window(self, window):
      if not isinstance(window, dict):
          window = next(window)
      self.assertEqual(window["mr"].shape[1:3], (120, 160))
      self.assertEqual(
          window["mr_location"][0, 1:].tolist(), [0, 0, 0, 120, 160, 1]
      )
      self.assertEqual(window["mr"].dtype, np.float32)
      self.assertEqual(window["mr_location"].dtype, np.int32)
  
imports: from __future__ import absolute_import, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.engine.image_window_dataset import ImageWindowDataset
  from niftynet.io.image_reader import ImageReader
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling the ImageWindowDataset_2D_Test obj's underlying member method code with example usage: obj.assert_window(window) without return types