human
I wrote the below code

    from scipy.optimize import brentq
    from scipy.integrate import quad
    from math import exp
    def eqn8(N, B):
        n = np.arange((N + 1), dtype=np.float64)
        factorial_n = np.ones(n.shape, dtype=np.float64)
        np.cumprod(n[1:], out=factorial_n[1:])
        return (1.0 / (exp((- B)) * np.sum((np.power(B, n) / factorial_n))))
    eqn8_res = eqn8(N, B)
    factorial_N = float(math.factorial(N))
    def eqn7(S, N, B):
        SpB = (S + B)
        return (eqn8_res * ((exp((- SpB)) * (SpB ** N)) / factorial_N))
    def eqn9_left(S_min, S_max, N, B):
        return quad(eqn7, S_min, S_max, args=(N, B), limit=500)
    def find_s_min(S_max, N, B):
        u'\n                                Kraft,    Burrows    and    Nousek    suggest    to    integrate    from    N-B    in    both\n                                directions    at    once,    so    that    S_min    and    S_max    move    similarly    (see\n                                the    article    for    details).    Here,    this    is    implemented    differently:\n                                Treat    S_max    as    the    optimization    parameters    in    func    and    then\n                                calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here.\n                                '
        y_S_max = eqn7(S_max, N, B)
        if (eqn7(0, N, B) >= y_S_max):
            return 0.0
        else:
            return brentq((lambda x: (eqn7(x, N, B) - y_S_max)), 0, (N - B))
    def func(s):
        s_min = find_s_min(s, N, B)
        out = eqn9_left(s_min, s, N, B)
        return (out[0] - CL)
    S_max = brentq(func, (N - B), 100)
    S_min = find_s_min(S_max, N, B)
    return (S_min, S_max)

What's a good function header?
 ... What is a Python code to calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here?
assistant
#Here is Python code to calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here.

def _scipy_kraft_burrows_nousek(N, B, CL):