code: def binom_interval(success, total, confint=0.95):
      """
      Compute two-sided binomial confidence interval in Python. Based on R's binom.test.
      """
  
      from scipy.stats import beta
  
      quantile = (1 - confint) / 2.0
      lower = beta.ppf(quantile, success, total - success + 1)
      upper = beta.ppf(1 - quantile, success + 1, total - success)
      return (lower, upper)
  
imports: import numpy
  from pandas.compat import range
label_desc: Use image node_id 1 for calling a global function with example usage: binom_interval(success, total, confint) and returns: lower,  upper