code: def test_2d_coordinates(self):
      coords = grid_spatial_coordinates(
          subject_id=1,
          img_sizes={
              "image": (64, 64, 1, 1, 2),
              "label": (42, 42, 1, 1, 1),
          },
          win_sizes={"image": (63, 63, 1), "label": (30, 32, 1)},
          border_size=(2, 3, 4),
      )
      # first dim corresponds to subject id
      expected_image = np.array(
          [
              [1, 0, 0, 0, 63, 63, 1],
              [1, 1, 0, 0, 64, 63, 1],
              [1, 0, 1, 0, 63, 64, 1],
              [1, 1, 1, 0, 64, 64, 1],
          ],
          dtype=np.int32,
      )
      self.assertAllClose(coords["image"], expected_image)
      expected_label = np.array(
          [
              [1, 0, 0, 0, 30, 32, 1],
              [1, 12, 0, 0, 42, 32, 1],
              [1, 6, 0, 0, 36, 32, 1],
              [1, 0, 10, 0, 30, 42, 1],
              [1, 12, 10, 0, 42, 42, 1],
              [1, 6, 10, 0, 36, 42, 1],
              [1, 0, 5, 0, 30, 37, 1],
              [1, 12, 5, 0, 42, 37, 1],
              [1, 6, 5, 0, 36, 37, 1],
          ],
          dtype=np.int32,
      )
      self.assertAllClose(coords["label"], expected_label)
      pass
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.engine.sampler_grid_v2 import GridSampler, _enumerate_step_points, grid_spatial_coordinates
  from niftynet.io.image_reader import ImageReader
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.utilities.util_common import ParserNamespace
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 2 for calling the CoordinatesTest obj's underlying member method code with example usage: obj.test_2d_coordinates() without return types