class_docstr: Function to score different max_partitions_contributed bounds.
  
  Suitable only for COUNT and PRIVACY_ID_COUNT aggregations.
docstr: Computes score of a given parameter k.
  
  Let
  P := number_of_partitions
  std := count_noise_std
  B := _max_partitions_contributed_best_upper_bound (= global_sensitivity)
  D := dataset
  uid := user identifier
  #contributions(uid, D) = number of partitions in D where uid contributed
  at least once.
  
  Then
  score(k) = -0.5 * impact_noise(k) - 0.5 * impact_dropped(k) =(1)
  -0.5 * P * std - 0.5 * Σ_uid max(min(#contributions(uid, D), B) - k, 0)
  
  Note: linf = 1, because impact_noise and impact_dropped are proportional
  to linf, and we can omit it in (1) equality.
  
  k is l0 for which std is calculated.
  Laplace noise:
  std = sqrt(2 * (l0 / ε)^2) = k / ε * sqrt(2)
  Gaussian noise:
  std is calculated based on https://arxiv.org/abs/1805.06530v2.
docstr_tok: ["Computes","score","of","a","given","parameter","k.","Let","P",":","=","number_of_partitions","std",":","=","count_noise_std","B",":","=","_max_partitions_contributed_best_upper_bound","(","=","global_sensitivity",")","D",":","=","dataset","uid",":","=","user","identifier","#","contributions","(","uid",",","D",")","=","number","of","partitions","in","D","where","uid","contributed","at","least","once",".","Then","score","(","k",")","=","-0.5","*","impact_noise","(","k",")","-","0.5","*","impact_dropped","(","k",")","=","(","1",")","-0.5","*","P","*","std","-","0.5","*","\u03a3_uid","max","(","min","(","#","contributions","(","uid",",","D",")",",","B",")","-","k",",","0",")","Note",":","linf","=","1",",","because","impact_noise","and","impact_dropped","are","proportional","to","linf",",","and","we","can","omit","it","in","(","1",")","equality",".","k","is","l0","for","which","std","is","calculated",".","Laplace","noise",":","std","=","sqrt","(","2","*","(","l0","\/","\u03b5",")","^2",")","=","k","\/","\u03b5","*","sqrt","(","2",")","Gaussian","noise",":","std","is","calculated","based","on","https",":","\/\/arxiv.org\/abs\/1805.06530v2","."]
code: def score(self, k: int) -> float:
      """Computes score of a given parameter k.
  
      Let
      P := number_of_partitions
      std := count_noise_std
      B := _max_partitions_contributed_best_upper_bound (= global_sensitivity)
      D := dataset
      uid := user identifier
      #contributions(uid, D) = number of partitions in D where uid contributed
      at least once.
  
      Then
      score(k) = -0.5 * impact_noise(k) - 0.5 * impact_dropped(k) =(1)
      -0.5 * P * std - 0.5 * Σ_uid max(min(#contributions(uid, D), B) - k, 0)
  
      Note: linf = 1, because impact_noise and impact_dropped are proportional
      to linf, and we can omit it in (1) equality.
  
      k is l0 for which std is calculated.
      Laplace noise:
      std = sqrt(2 * (l0 / ε)^2) = k / ε * sqrt(2)
      Gaussian noise:
      std is calculated based on https://arxiv.org/abs/1805.06530v2.
      """
      impact_noise_weight = 0.5
      return -(
          impact_noise_weight * self._l0_impact_noise(k)
          + (1 - impact_noise_weight) * self._l0_impact_dropped(k)
      )
  
imports: from dataclasses import dataclass
  from functools import lru_cache
  from typing import List
  import pipeline_dp
  from pipeline_dp import dp_computations
  from pipeline_dp.dataset_histograms.histograms import Histogram
  from pipeline_dp import pipeline_functions
label_desc: Use image node_id 2 for calling the L0ScoringFunction obj's underlying member method code with example usage: obj.score(k) and returns: unknown