code: def test_find_candidate_parameters_generate_linf(
      self,
      mock_find_candidate_from_histogram,
      metric,
      expected_generate_linf,
  ):
      mock_l0_histogram = histograms.Histogram(
          histograms.HistogramType.L0_CONTRIBUTIONS, bins=[]
      )
      mock_linf_histogram = histograms.Histogram(
          histograms.HistogramType.LINF_CONTRIBUTIONS, bins=[]
      )
      mock_histograms = histograms.DatasetHistograms(
          mock_l0_histogram,
          None,
          mock_linf_histogram,
          None,
          None,
          None,
          None,
      )
  
      mock_find_candidate_from_histogram.return_value = [1, 2]
  
      parameters_to_tune = parameter_tuning.ParametersToTune(
          max_partitions_contributed=True,
          max_contributions_per_partition=True,
      )
  
      candidates = parameter_tuning._find_candidate_parameters(
          mock_histograms,
          parameters_to_tune,
          metric,
          max_candidates=100,
      )
  
      mock_find_candidate_from_histogram.assert_any_call(
          mock_l0_histogram, mock.ANY
      )
      if expected_generate_linf:
          self.assertEqual(
              candidates.max_partitions_contributed, [1, 1, 2, 2]
          )
          self.assertEqual(
              candidates.max_contributions_per_partition, [1, 2, 1, 2]
          )
          mock_find_candidate_from_histogram.assert_any_call(
              mock_linf_histogram, mock.ANY
          )
      else:
          self.assertEqual(
              candidates.max_partitions_contributed, [1, 2]
          )
          self.assertIsNone(candidates.max_contributions_per_partition)
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  from unittest import mock
  from unittest.mock import patch
  from typing import List, Optional
  import pipeline_dp
  import analysis
  from analysis import metrics
  from analysis import parameter_tuning
  from pipeline_dp.dataset_histograms import histograms
  from pipeline_dp.dataset_histograms import computing_histograms
label_desc: Use image node_id 7 for calling the ParameterTuning obj's underlying member method code with example usage: obj.test_find_candidate_parameters_generate_linf(mock_find_candidate_from_histogram, metric, expected_generate_linf) without return types