code: def test_dynamic_init(self):
      sampler = UniformSampler(
          reader=get_dynamic_window_reader(),
          window_sizes=DYNAMIC_MOD_DATA,
          batch_size=2,
          windows_per_image=10,
          queue_length=10,
      )
      with self.cached_session() as sess:
          sampler.set_num_threads(2)
          out = sess.run(sampler.pop_batch_op())
          self.assertAllClose(out["image"].shape[1:], (8, 2, 256, 2))
      sampler.close_all()
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.engine.sampler_uniform_v2 import UniformSampler
  from niftynet.engine.sampler_uniform_v2 import rand_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 niftynet.engine.image_window import N_SPATIAL
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 4 for calling the UniformSamplerTest obj's underlying member method code with example usage: obj.test_dynamic_init() without return types