code: def test_slice_by_custom_indices(self):
      custom_train_indices = np.array([2, 2, 100, 4])
      custom_test_indices = np.array([100, 2, 2, 2])
      custom_slice = SingleSliceSpec(
          SlicingFeature.CUSTOM,
          (custom_train_indices, custom_test_indices, 2, None),
      )
      output = get_slice(self.input_data, custom_slice)
      np.testing.assert_array_equal(
          output.logits_train, np.array([[0, 1, 0], [2, 0, 3]])
      )
      np.testing.assert_array_equal(
          output.logits_test,
          np.array([[12, 13, 0], [14, 15, 0], [0, 16, 17]]),
      )
      np.testing.assert_array_equal(
          output.probs_train, np.array([[0, 1, 0], [0.1, 0, 0.7]])
      )
      np.testing.assert_array_equal(
          output.probs_test,
          np.array([[0.1, 0.9, 0], [0.15, 0.85, 0], [0, 0, 1]]),
      )
      np.testing.assert_array_equal(
          output.labels_train, np.array([1, 0])
      )
      np.testing.assert_array_equal(
          output.labels_test, np.array([2, 0, 2])
      )
      np.testing.assert_array_equal(
          output.loss_train, np.array([2, 0.25])
      )
      np.testing.assert_array_equal(
          output.loss_test, np.array([3.5, 7, 4.5])
      )
      np.testing.assert_array_equal(
          output.entropy_train, np.array([0.4, 8])
      )
      np.testing.assert_array_equal(
          output.entropy_test, np.array([10.5, 4.5, 0.3])
      )
  
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 6 for calling the GetSliceTest obj's underlying member method code with example usage: obj.test_slice_by_custom_indices() without return types