def _comp_sum_eeg(beta, ctheta, lut_fun, n_fact):
    # Compute the sum occurring in the evaluation.
    # The result is
    #   sums[:]    (2n+1)^2/n beta^n P_n
    n_chunk = 50000000 // (8 * max(n_fact.shape) * 2)
    lims = np.concatenate([np.arange(0, beta.size, n_chunk), [beta.size]])
    s0 = np.empty(beta.shape)
    for start, stop in zip(lims[:-1], lims[1:]):
        coeffs = lut_fun(ctheta[start:stop])
        betans = np.tile(beta[start:stop][:, np.newaxis], (1, n_fact.shape[0]))
        np.cumprod(betans, axis=1, out=betans)  # run inplace
        coeffs *= betans
        s0[start:stop] = np.dot(coeffs, n_fact)  # == weighted sum across cols
    return s0
Creates a new Type object (an instance of TypeMetaclass).
dataset/ETHPy150Open mne-tools/mne-python/mne/forward/_lead_dots.py/_comp_sum_eeg--crossover with--dataset/ETHPy150Open wickman/pystachio/pystachio/typing.py/TypeMetaclass.__new__