def _kraft_burrows_nousek(N, B, CL):
 try:
  import scipy
  HAS_SCIPY = True
 except ImportError:
  HAS_SCIPY = False
 try:
  import mpmath
  HAS_MPMATH = True
 except ImportError:
  HAS_MPMATH = False
 if (HAS_SCIPY and (N <= 100)):
  try:
   return _scipy_kraft_burrows_nousek(N, B, CL)
  except OverflowError:
   if (not HAS_MPMATH):
    raise ValueError(u'Need mpmath package for input numbers this large.')
 if HAS_MPMATH:
  return _mpmath_kraft_burrows_nousek(N, B, CL)
 raise ImportError(u'Either scipy or mpmath are required.')

def _kraft_burrows_nousek ( N , B , CL ) : try : import scipy HAS_SCIPY = True except ImportError : HAS_SCIPY = False try : import mpmath HAS_MPMATH = True except ImportError : HAS_MPMATH = False if ( HAS_SCIPY and ( N <= 100 ) ) : try : return _scipy_kraft_burrows_nousek ( N , B , CL ) except OverflowError : if ( not HAS_MPMATH ) : raise ValueError ( u'Need mpmath package for input numbers this large.' ) if HAS_MPMATH : return _mpmath_kraft_burrows_nousek ( N , B , CL ) raise ImportError ( u'Either scipy or mpmath are required.' )
upper limit on a poisson count rate the implementation is based on kraft .