code: def _indices_by_classification(
      logits_or_probs,
      labels,
      correctly_classified,
  ):
      idx_correct = labels == np.argmax(logits_or_probs, axis=1)
      return (
          idx_correct
          if correctly_classified
          else np.invert(idx_correct)
      )
  
file_path: privacy/tensorflow_privacy/privacy/privacy_tests/membership_inference_attack/dataset_slicing.py
imports: from collections import abc
  import copy
  import logging
  from typing import List, Optional
  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
label_desc: Use image node_id 5 for calling a global function with example usage: _indices_by_classification(logits_or_probs, labels, correctly_classified) and returns: unknown