code: def compute_safe_domain_size(
      prvs,
      max_self_compositions: Sequence[int],
      eps_error: float,
      delta_error: float,
  ) -> float:
      """
      Compute safe domain size for the discretization of the PRVs.
  
      For details about this algorithm, see remark 5.6 in
      https://www.microsoft.com/en-us/research/publication/numerical-composition-of-differential-privacy/
      """
      total_compositions = sum(max_self_compositions)
  
      rdp_accountant = RDPAccountant()
      for prv, max_self_composition in zip(prvs, max_self_compositions):
          rdp_accountant.history.append(
              (
                  prv.noise_multiplier,
                  prv.sample_rate,
                  max_self_composition,
              )
          )
  
      L_max = rdp_accountant.get_epsilon(delta_error / 4)
  
      for prv, max_self_composition in zip(prvs, max_self_compositions):
          rdp_accountant = RDPAccountant()
          rdp_accountant.history = [
              (prv.noise_multiplier, prv.sample_rate, 1)
          ]
          L_max = max(
              L_max,
              rdp_accountant.get_epsilon(
                  delta=delta_error / (8 * total_compositions)
              ),
          )
  
      # FIXME: this implementation is adapted from the code accompanying the paper, but
      # disagrees subtly with the theory from remark 5.6. It's not immediately clear this
      # gives the right guarantees in all cases, though it's fine for eps_error < 1 and
      # hence generic cases.
      # cf. https://github.com/microsoft/prv_accountant/discussions/34
      return max(L_max, eps_error) + 3
  
file_path: opacus/opacus/accountants/analysis/prv/domain.py
imports: from dataclasses import dataclass
  from typing import Sequence
  import numpy
  from ...rdp import RDPAccountant
label_desc: Use image node_id 1 for calling a global function with example usage: compute_safe_domain_size(prvs, max__compositions, eps_error, delta_error) and returns: unknown