code: def samplesize_confint_proportion(
      proportion, half_length, alpha=0.05, method="normal"
  ):
      """
      Find sample size to get desired confidence interval length
  
      Parameters
      ----------
      proportion : float in (0, 1)
          proportion or quantile
      half_length : float in (0, 1)
          desired half length of the confidence interval
      alpha : float in (0, 1)
          significance level, default 0.05,
          coverage of the two-sided interval is (approximately) ``1 - alpha``
      method : str in ['normal']
          method to use for confidence interval,
          currently only normal approximation
  
      Returns
      -------
      n : float
          sample size to get the desired half length of the confidence interval
  
      Notes
      -----
      this is mainly to store the formula.
      possible application: number of replications in bootstrap samples
  
      """
      q_ = proportion
      if method == "normal":
          n = (
              q_
              * (1 - q_)
              / (half_length / stats.norm.isf(alpha / 2.0)) ** 2
          )
      else:
          raise NotImplementedError('only "normal" is available')
  
      return n
  
imports: from statsmodels.compat.python import lzip
  from typing import Callable
  import numpy
  import pandas
  from scipy import optimize, stats
  from statsmodels.stats.base import AllPairsResults, HolderTuple
  from statsmodels.stats.weightstats import _zstat_generic2
  from statsmodels.tools.sm_exceptions import HypothesisTestWarning
  from statsmodels.tools.testing import Holder
  from statsmodels.tools.validation import array_like
label_desc: Use image node_id 5 for calling a global function with example usage: samplesize_confint_proportion(proportion, half_length, alpha, method) and returns: n