class_docstr: Tests for get_single_slice_specs.
class_docstr_tok: ["Tests","for","get_single_slice_specs","."]
code: def test_slicing_by_custom_indices_slice_name(self):
      all_custom_train_indices = [
          np.array([1, 2, 1, 2]),
      ]
      all_custom_test_indices = [
          np.array([2, 2, 1, 2]),
      ]
      custom_slices_names = {1: "slice1", 2: "slice2"}
      expected_group_values = [[1, 2]]
  
      input_data = SlicingSpec(
          all_custom_train_indices=all_custom_train_indices,
          all_custom_test_indices=all_custom_test_indices,
          custom_slices_names=custom_slices_names,
      )
      expected = [self.ENTIRE_DATASET_SLICE]
      for custom_train_indices, custom_test_indices, eg in zip(
          all_custom_train_indices,
          all_custom_test_indices,
          expected_group_values,
      ):
          for g in eg:
              expected.append(
                  SingleSliceSpec(
                      SlicingFeature.CUSTOM,
                      (
                          custom_train_indices,
                          custom_test_indices,
                          g,
                          custom_slices_names[g],
                      ),
                  )
              )
      output = get_single_slice_specs(input_data)
      self.assertTrue(_are_lists_equal(output, expected))
  
imports: import logging
  from absl.testing import absltest
  from absl.testing import parameterized
  from absl.testing.absltest import mock
  import numpy
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import AttackInputData
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import SingleSliceSpec
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import SlicingFeature
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import SlicingSpec
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.dataset_slicing import get_single_slice_specs
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.dataset_slicing import get_slice
label_desc: Use image node_id 9 for calling the SingleSliceSpecsTest obj's underlying member method code with example usage: obj.test_slicing_by_custom_indices_slice_name() without return types