docstr: Update lower precision bound for a candidate anchors dependent on the KL-divergence.
  
  Parameters
  ----------
  p
      Precision of candidate anchors.
  level
      `beta / nb of samples` for each result.
  n_iter
      Number of iterations during lower bound update.
  
  Returns
  -------
  Updated lower precision bounds array.
docstr_tok: ["Update","lower","precision","bound","for","a","candidate","anchors","dependent","on","the","KL-divergence",".","Parameters","--","--","--","--","--","p","Precision","of","candidate","anchors",".","level","`","beta","\/","nb","of","samples","`","for","each","result",".","n_iter","Number","of","iterations","during","lower","bound","update",".","Returns","--","--","--","-","Updated","lower","precision","bounds","array","."]
code: def dlow_bernoulli(
      p: np.ndarray, level: np.ndarray, n_iter: int = 17
  ) -> np.ndarray:
      """
      Update lower precision bound for a candidate anchors dependent on the KL-divergence.
  
      Parameters
      ----------
      p
          Precision of candidate anchors.
      level
          `beta / nb of samples` for each result.
      n_iter
          Number of iterations during lower bound update.
  
      Returns
      -------
      Updated lower precision bounds array.
      """
  
      um = p.copy()
      lm = np.clip(p - np.sqrt(level / 2.0), 0.0, 1.0)  # lower bound
  
      # Perform bisection algorithm to find the smallest qm s.t. kl divergence is > level
      for _ in range(1, n_iter):
          qm = (um + lm) / 2.0
          kl_gt_idx = kl_bernoulli(p, qm) > level
          kl_lt_idx = np.logical_not(kl_gt_idx)
          lm[kl_gt_idx] = qm[kl_gt_idx]
          um[kl_lt_idx] = qm[kl_lt_idx]
  
      return lm
  
imports: import copy
  import logging
  from collections import defaultdict, namedtuple
  from typing import Callable, Dict, List, Optional, Set, Tuple
  import numpy
  from alibi.utils.distributions import kl_bernoulli
label_desc: Use image node_id 5 for calling the AnchorBaseBeam obj's underlying member method code with example usage: obj.dlow_bernoulli(p, level, n_iter) and returns: lm