def METHOD_NAME(
    k, s, eta, mu, max_iter=10000, delta=1e-14, poly_corr=None
):  # pylint: disable=too-many-arguments
    r"""Calculates the expectation value of the characteristic function
    :math:`\langle n^m \exp(mu n) \rangle` where :math:`n` is the total photon number of :math:`k` identical
    single-mode squeezed vacua with squeezing parameter :math:`s` undergoing loss by
    transmission :math:`\eta`.
    Args:
        k (int): number of squeezed modes
        s (float): squeezing parameter
        eta (float): transmission parameter, between 0 and 1 inclusive
        mu (float): value at which to evaluate the characteristic function
        max_iter (int): maximum number of terms allowed in the sum
        delta (float): fractional change in the sum after which the sum is stopped
        poly_corr (int): give the value of the exponent :math:`m` of the polynomial correction
    Returns:
        (float): the expected value of the moment generation function
    """
    if poly_corr is None or poly_corr == 0:
        f = lambda x: 1
    else:
        f = lambda x: x**poly_corr
    if s == 0 or eta == 0:
        return f(0)
    pref = np.exp(mu)
    tot_sum = f(0) * total_photon_number_distribution(0, k, s, eta, pref=pref)
    converged = False
    i = 1
    prev_addend = tot_sum
    while converged is False and i < max_iter:
        old_tot_sum = tot_sum
        addend = f(i) * total_photon_number_distribution(i, k, s, eta, pref=pref)
        tot_sum += addend
        i += 1
        # Note that we check that the sum of the last *two* values does not change the net
        # sum much, this is because for eta=0 the distrobution does not have support over
        # the odd integers.
        ratio = (addend + prev_addend) / old_tot_sum
        if ratio < delta:
            converged = True
        prev_addend = addend
    return tot_sum