code: def _shrink_prob(
      count1, nobs1, count2, nobs2, shrink_factor=2, return_corr=True
  ):
      """
      Shrink observed counts towards independence
  
      Helper function for 'logit-smoothed' inference for the odds-ratio of two
      independent proportions.
  
      Parameters
      ----------
      count1, nobs1 : float or int
          count and sample size for first sample
      count2, nobs2 : float or int
          count and sample size for the second sample
      shrink_factor : float
          This corresponds to the number of observations that are added in total
          proportional to the probabilities under independence.
      return_corr : bool
          If true, then only the correction term is returned
          If false, then the corrected counts, i.e. original counts plus
          correction term, are returned.
  
      Returns
      -------
      count1_corr, nobs1_corr, count2_corr, nobs2_corr : float
          correction or corrected counts
      prob_indep :
          TODO/Warning : this will change most likely
          probabilities under independence, only returned if return_corr is
          false.
  
      """
      vectorized = any(
          np.size(i) > 1 for i in [count1, nobs1, count2, nobs2]
      )
      if vectorized:
          raise ValueError("function is not vectorized")
      nobs_col = np.array(
          [count1 + count2, nobs1 - count1 + nobs2 - count2]
      )
      nobs_row = np.array([nobs1, nobs2])
      nobs = nobs1 + nobs2
      prob_indep = (nobs_col * nobs_row[:, None]) / nobs**2
      corr = shrink_factor * prob_indep
      if return_corr:
          return (corr[0, 0], corr[0].sum(), corr[1, 0], corr[1].sum())
      else:
          return (
              count1 + corr[0, 0],
              nobs1 + corr[0].sum(),
              count2 + corr[1, 0],
              nobs2 + corr[1].sum(),
          ), prob_indep
  
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 23 for calling a global function with example usage: _shrink_prob(count1, nobs1, count2, nobs2, shrink_factor, return_corr) and returns: corr,  corr,  corr,  corr, unknown,  unknown,  unknown,  unknown,  prob_indep