code: def binom_confint(
      k, n, conf_level=0.95, correct=True, alternative="two sided"
  ):
      assert alternative in ("two sided", "less", "greater")
      assert np.all(k >= 0) and np.all(k <= n) and np.all(n >= 1)
      assert np.all(conf_level >= 0) and np.all(conf_level <= 1)
  
      alpha = (
          (1 - conf_level) / 2
          if (alternative == "two sided")
          else (1 - conf_level)
      )
      if correct:
          alpha = alpha / len(k)
      alpha = np.array([alpha] * len(k))
  
      lower = safe_qbeta(alpha, k, n - k + 1)
      upper = safe_qbeta(alpha, k + 1, n - k, lower_tail=False)
      return pd.DataFrame(
          {
              "lower": lower
              if alternative in ["two sided", "greater"]
              else [0] * len(k),
              "upper": upper
              if alternative in ["two sided", "less"]
              else [0] * len(k),
          }
      )
  
file_path: scattertext/scattertext/termscoring/lrc.py
imports: from typing import Union
  import numpy
  import pandas
  from scipy.stats import beta
  from scattertext import CorpusBasedTermScorer
label_desc: Use image node_id 7 for calling a global function with example usage: binom_confint(k, n, conf_level, correct, alternative) and returns: pd