code: def _test_extended_padding(self, pad, do_2d):
      batch = (
          self._get_pad_test_input_2d()
          if do_2d
          else self._get_pad_test_input_3d()
      )
  
      const = 127.23
      min_dim = min(batch.shape[1:-1]) - 1
      for ks in (2, min_dim):
          for ds in (1, min_dim):
              name = "pad_test_conv" + ("2" if do_2d else "3")
              name += "%i_%i" % (ks, ds)
              init_dict = {
                  "n_output_chns": 4,
                  "kernel_size": ks,
                  "stride": 1,
                  "dilation": ds,
                  "padding": pad,
                  "name": name,
              }
  
              if ds % 2 == 0:
                  init_dict["padding_constant"] = const
  
              self._test_extended_conv(batch, init_dict)
  
imports: from __future__ import division, absolute_import, print_function
  import functools
  import numpy
  import tensorflow
  from tensorflow.contrib.layers.python.layers import regularizers
  from niftynet.layer.convolution import ConvLayer
  from niftynet.layer.convolution import ConvolutionalLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 8 for calling the ConvTest obj's underlying member method code with example usage: obj._test_extended_padding(pad, do_2d) without return types