class_docstr: Chooses DPStrategy based on DP budget, computation sensitivites, etc
  
  It chooses noise_kind to minimize the noise std deviation.
  For non-public partitions it chooses partition selection strategy to
  minimize threshold. For more details see docstring to
  select_partition_selection_strategy().
docstr: Selects partition selection strategy based on Threshold.
  
  There are many ways how strategies can be compared. For simplicity
  strategies are compared by the number of privacy units, which is needed
  for achieving the probability of releasing partition to be 50%. That is
  number is equal to the threshold for thresholding strategies.
  
  Args:
      epsilon, delta: DP budget for partition selection
      l0_sensitivity: l0 sensitivity of the query, i.e. the maximum
        number of partitions, which 1 privacy unit can influence.
  
  Returns:
      the selected strategy.
docstr_tok: ["Selects","partition","selection","strategy","based","on","Threshold",".","There","are","many","ways","how","strategies","can","be","compared",".","For","simplicity","strategies","are","compared","by","the","number","of","privacy","units",",","which","is","needed","for","achieving","the","probability","of","releasing","partition","to","be","50","%",".","That","is","number","is","equal","to","the","threshold","for","thresholding","strategies",".","Args",":","epsilon",",","delta",":","DP","budget","for","partition","selection","l0_sensitivity",":","l0","sensitivity","of","the","query",",","i.e",".","the","maximum","number","of","partitions",",","which","1","privacy","unit","can","influence",".","Returns",":","the","selected","strategy","."]
code: def select_partition_selection_strategy(
      self, epsilon: float, delta: float, l0_sensitivity: int
  ) -> pipeline_dp.PartitionSelectionStrategy:
      """Selects partition selection strategy based on Threshold.
  
      There are many ways how strategies can be compared. For simplicity
      strategies are compared by the number of privacy units, which is needed
      for achieving the probability of releasing partition to be 50%. That is
      number is equal to the threshold for thresholding strategies.
  
      Args:
          epsilon, delta: DP budget for partition selection
          l0_sensitivity: l0 sensitivity of the query, i.e. the maximum
            number of partitions, which 1 privacy unit can influence.
  
      Returns:
          the selected strategy.
      """
  
      def create_mechanism(
          strategy: pipeline_dp.PartitionSelectionStrategy,
      ):
          return dp_computations.ThresholdingMechanism(
              epsilon,
              delta,
              strategy,
              l0_sensitivity,
              pre_threshold=None,
          )
  
      laplace_thresholding_mechanism = create_mechanism(
          pipeline_dp.PartitionSelectionStrategy.LAPLACE_THRESHOLDING
      )
      gaussian_thresholding_mechanism = create_mechanism(
          pipeline_dp.PartitionSelectionStrategy.GAUSSIAN_THRESHOLDING
      )
      if (
          laplace_thresholding_mechanism.threshold()
          < gaussian_thresholding_mechanism.threshold()
      ):
          # Truncated geometric strategy is slightly better than Laplace
          # thresholding, so returns it instead.
          # Truncated geometric does not have threshold, that is why
          #
          return (
              pipeline_dp.PartitionSelectionStrategy.TRUNCATED_GEOMETRIC
          )
      return (
          pipeline_dp.PartitionSelectionStrategy.GAUSSIAN_THRESHOLDING
      )
  
imports: from dataclasses import dataclass
  from typing import Optional
  import pipeline_dp
  from pipeline_dp import aggregate_params
  from pipeline_dp import dp_computations
  from pipeline_dp import input_validators
label_desc: Use image node_id 13 for calling the DPStrategySelector obj's underlying member method code with example usage: obj.select_partition_selection_strategy(epsilon, delta, l0_sensitivity) and returns: pipeline_dp, dp_computations, pipeline_dp