docstr: Tests that responses for PR curves for run-tag combos are
  correct.
docstr_tok: ["Tests","that","responses","for","PR","curves","for","run-tag","combos","are","correct","."]
code: def testPrCurvesDataCorrect(self):
      """Tests that responses for PR curves for run-tag combos are
      correct."""
      pr_curves_response = self.plugin.pr_curves_impl(
          context.RequestContext(),
          "123",
          ["colors", "mask_every_other_prediction"],
          "blue/pr_curves",
      )
  
      # Assert that the runs are correct.
      self.assertCountEqual(
          ["colors", "mask_every_other_prediction"],
          list(pr_curves_response.keys()),
      )
  
      # Assert that PR curve data is correct for the colors run.
      entries = pr_curves_response["colors"]
      self.assertEqual(3, len(entries))
      self.validatePrCurveEntry(
          expected_step=0,
          expected_precision=[0.3333333, 0.3853211, 0.5421687, 0.75],
          expected_recall=[1.0, 0.84, 0.3, 0.04],
          expected_true_positives=[150, 126, 45, 6],
          expected_false_positives=[300, 201, 38, 2],
          expected_true_negatives=[0, 99, 262, 298],
          expected_false_negatives=[0, 24, 105, 144],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[0],
      )
      self.validatePrCurveEntry(
          expected_step=1,
          expected_precision=[0.3333333, 0.3855422, 0.5357143, 0.4],
          expected_recall=[1.0, 0.8533334, 0.3, 0.0266667],
          expected_true_positives=[150, 128, 45, 4],
          expected_false_positives=[300, 204, 39, 6],
          expected_true_negatives=[0, 96, 261, 294],
          expected_false_negatives=[0, 22, 105, 146],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[1],
      )
      self.validatePrCurveEntry(
          expected_step=2,
          expected_precision=[
              0.3333333,
              0.3934426,
              0.5064935,
              0.6666667,
          ],
          expected_recall=[1.0, 0.8, 0.26, 0.0266667],
          expected_true_positives=[150, 120, 39, 4],
          expected_false_positives=[300, 185, 38, 2],
          expected_true_negatives=[0, 115, 262, 298],
          expected_false_negatives=[0, 30, 111, 146],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[2],
      )
  
      # Assert that PR curve data is correct for the mask_every_other_prediction
      # run.
      entries = pr_curves_response["mask_every_other_prediction"]
      self.assertEqual(3, len(entries))
      self.validatePrCurveEntry(
          expected_step=0,
          expected_precision=[0.3333333, 0.3786982, 0.5384616, 1.0],
          expected_recall=[1.0, 0.8533334, 0.28, 0.0666667],
          expected_true_positives=[75, 64, 21, 5],
          expected_false_positives=[150, 105, 18, 0],
          expected_true_negatives=[0, 45, 132, 150],
          expected_false_negatives=[0, 11, 54, 70],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[0],
      )
      self.validatePrCurveEntry(
          expected_step=1,
          expected_precision=[0.3333333, 0.3850932, 0.5, 0.25],
          expected_recall=[1.0, 0.8266667, 0.28, 0.0133333],
          expected_true_positives=[75, 62, 21, 1],
          expected_false_positives=[150, 99, 21, 3],
          expected_true_negatives=[0, 51, 129, 147],
          expected_false_negatives=[0, 13, 54, 74],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[1],
      )
      self.validatePrCurveEntry(
          expected_step=2,
          expected_precision=[
              0.3333333,
              0.3986928,
              0.4444444,
              0.6666667,
          ],
          expected_recall=[1.0, 0.8133333, 0.2133333, 0.0266667],
          expected_true_positives=[75, 61, 16, 2],
          expected_false_positives=[150, 92, 20, 1],
          expected_true_negatives=[0, 58, 130, 149],
          expected_false_negatives=[0, 14, 59, 73],
          expected_thresholds=[0.0, 0.25, 0.5, 0.75],
          pr_curve_entry=entries[2],
      )
  
imports: import collections.abc
  import functools
  import os.path
  import numpy
  import tensorflow
  from tensorboard import context
  from tensorboard.backend.event_processing import plugin_event_multiplexer
  from tensorboard.backend.event_processing import data_provider
  from tensorboard.plugins import base_plugin
  from tensorboard.plugins.pr_curve import pr_curve_demo
  from tensorboard.plugins.pr_curve import pr_curves_plugin
label_desc: Use image node_id 6 for calling the PrCurvesPluginTest obj's underlying member method code with example usage: obj.testPrCurvesDataCorrect() without return types