code: def _max_tree_sensitivity_square_sum(
      max_participation: int, min_separation: int, steps: int
  ) -> float:
      """Compute the worst-case sum of sensitivity square in tree aggregation.
  
      See Appendix D.2 of
      "Practical and Private (Deep) Learning without Sampling or Shuffling"
      https://arxiv.org/abs/2103.00039.
  
      Args:
        max_participation: The maximum number of times a sample will appear.
        min_separation: The minimum number of nodes between two appearance of a
          sample. If a sample appears in consecutive x, y steps in a streaming
          setting, then `min_separation=y-x-1`.
        steps: Total number of steps (leaf nodes in tree aggregation).
  
      Returns:
        The worst-case sum of sensitivity square for the given input.
      """
      num_participation = max_participation
      while not _check_possible_tree_participation(
          num_participation, min_separation, 0, min_separation, steps
      ):
          num_participation -= 1
      candidate_sum = []
      for num_part in range(1, num_participation + 1):
          candidate_sum.append(
              _tree_sensitivity_square_sum(
                  num_part, min_separation, 0, min_separation, steps
              )
          )
      return max(candidate_sum)
  
file_path: privacy/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant.py
imports: import functools
  import math
  from typing import Collection, Optional, Union
  import dp_accounting
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: _max_tree_sensitivity_square_sum(max_participation, min_separation, steps) and returns: max