code: def _findp(func):
      try:
          p = brentq(func, 0, 1)
      except RuntimeError:
          raise RuntimeError(
              "numerical solver failed to converge when "
              "computing the confidence limits"
          ) from None
      except ValueError as exc:
          raise ValueError(
              "brentq raised a ValueError; report this to the "
              "SciPy developers"
          ) from exc
      return p
  
file_path: catboost/contrib/python/scipy/py3/scipy/stats/_binomtest.py
imports: from math import sqrt
  import numpy
  from scipy._lib._util import _validate_int
  from scipy.optimize import brentq
  from scipy.special import ndtri
  from ._discrete_distns import binom
  from ._common import ConfidenceInterval
label_desc: Use image node_id 1 for calling a global function with example usage: _findp(func) and returns: p