code: def test_new_partition(self):
      data_param = test_sections
      test_partitioner = ImageSetsPartitioner()
      with self.assertRaisesRegexp(TypeError, ""):
          test_partitioner.initialise(
              data_param,
              new_partition=True,
              data_split_file=partition_output,
          )
      test_partitioner.initialise(
          data_param,
          new_partition=True,
          ratios=(2.0, 2.0),
          data_split_file=partition_output,
      )
      self.assertEqual(
          test_partitioner.get_file_list()[COLUMN_UNIQ_ID].count(), 4
      )
      self.assertEqual(test_partitioner.get_file_list(TRAIN), None)
      self.assertEqual(
          test_partitioner.get_file_list(VALID)[COLUMN_UNIQ_ID].count(),
          4,
      )
      self.assertEqual(test_partitioner.get_file_list(INFER), None)
      self.assertEqual(
          test_partitioner.get_file_list(VALID, "T1", "Flair")[
              COLUMN_UNIQ_ID
          ].count(),
          4,
      )
      self.assertEqual(
          test_partitioner.get_file_list(VALID, "Flair")[
              COLUMN_UNIQ_ID
          ].count(),
          4,
      )
      with self.assertRaisesRegexp(ValueError, ""):
          test_partitioner.get_file_list(VALID, "foo")
      with self.assertRaisesRegexp(ValueError, ""):
          test_partitioner.get_file_list("T1")
  
      self.assertFalse(test_partitioner.has_training)
      self.assertFalse(test_partitioner.has_inference)
      self.assertTrue(test_partitioner.has_validation)
  
file_path: NiftyNet/tests/image_sets_partitioner_test.py
imports: from __future__ import absolute_import, print_function
  import os
  import tensorflow
  from niftynet.io.image_sets_partitioner import COLUMN_UNIQ_ID
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.engine.signal import TRAIN, VALID, INFER
  from niftynet.utilities.util_common import ParserNamespace
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling the ImageSetsPartitionerNewPartition obj's underlying member method code with example usage: obj.test_new_partition() without return types