code: def test_run_attack_threshold_entropy_small_tpr_fpr_correct_ppv(
      self, patched_fn
  ):
      # sklearn.metrics.roc_curve returns (fpr, tpr, thresholds).
      patched_fn.return_value = (
          np.array([0.2, 0.04, 0.0003]),
          np.array([0.1, 0.0001, 0.0002]),
          np.array([0.2, 0.4, 0.6]),
      )
      result = mia._run_attack(
          AttackInputData(
              entropy_train=np.array([0.1, 0.2, 1.3, 0.4, 0.5, 0.6]),
              entropy_test=np.array([1.1, 1.2, 1.3, 0.4, 1.5, 1.6]),
              force_multilabel_data=False,
          ),
          AttackType.THRESHOLD_ENTROPY_ATTACK,
      )
      # PPV = TPR / (TPR + test_train_ratio * FPR), except when both TPR and FPR
      # are close to 0. Then PPV = 1/ (1 + test_train_ratio)
      # With the above values, TPR / (TPR + test_train_ratio * FPR) =
      # 0.1 / (0.1 + (6/6) * 0.2) = 0.333,
      # 0.0001 / (0.0001 + (6/6) * 0.04) = 0.002493,
      # and 1/ (1+ (6/6)) = 0.5. So PPV is the max of these three values,
      # namely 0.5.
      np.testing.assert_almost_equal(
          result.roc_curve.get_ppv(), 0.5, decimal=2
      )
  
imports: from unittest import mock
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  from tensorflow_privacy.privacy.privacy_tests import epsilon_lower_bound
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import membership_inference_attack
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack import models
  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 AttackType
  from tensorflow_privacy.privacy.privacy_tests.membership_inference_attack.data_structures import DataSize
  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 16 for calling the RunAttacksTest obj's underlying member method code with example usage: obj.test_run_attack_threshold_entropy_small_tpr_fpr_correct_ppv(patched_fn) without return types