code: def test_seg_values(self):
      with tempfile.TemporaryDirectory() as tempdir:
          # prepare test datalist file
          test_data = {
              "name": "Spleen",
              "description": "Spleen Segmentation",
              "labels": {"0": "background", "1": "spleen"},
              "training": [
                  {
                      "image": "spleen_19.nii.gz",
                      "label": "spleen_19.nii.gz",
                  },
                  {
                      "image": "spleen_31.nii.gz",
                      "label": "spleen_31.nii.gz",
                  },
              ],
              "test": ["spleen_15.nii.gz", "spleen_23.nii.gz"],
          }
          json_str = json.dumps(test_data)
          file_path = os.path.join(tempdir, "test_data.json")
          with open(file_path, "w") as json_file:
              json_file.write(json_str)
  
          data_list = DatasetFunc(
              data=file_path,
              func=load_decathlon_datalist,
              data_list_key="training",
              base_dir=tempdir,
          )
          # partition dataset for train / validation
          data_partition = DatasetFunc(
              data=data_list,
              func=lambda x, **kwargs: partition_dataset(x, **kwargs)[
                  0
              ],
              num_partitions=2,
          )
          dataset = Dataset(data=data_partition, transform=None)
          self.assertEqual(
              dataset[0]["image"],
              os.path.join(tempdir, "spleen_19.nii.gz"),
          )
          self.assertEqual(
              dataset[0]["label"],
              os.path.join(tempdir, "spleen_19.nii.gz"),
          )
  
file_path: MONAI/tests/test_dataset_func.py
imports: from __future__ import annotations
  import json
  import os
  import tempfile
  import unittest
  from monai.data import Dataset, DatasetFunc, load_decathlon_datalist, partition_dataset
label_desc: Use image node_id 1 for calling the TestDatasetFunc obj's underlying member method code with example usage: obj.test_seg_values() without return types