def genlaguerre(n, alpha, monic=False):
if any(alpha <= -<NUM_LIT:1>):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if n < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if n == <NUM_LIT:0>:<EOL><INDENT>n1 = n + <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>n1 = n<EOL><DEDENT>x, w, mu0 = la_roots(n1, alpha, mu=True)<EOL>wfunc = lambda x: exp(-x) * x**alpha<EOL>if n == <NUM_LIT:0>:<EOL><INDENT>x, w = [], []<EOL><DEDENT>hn = _gam(n + alpha + <NUM_LIT:1>) / _gam(n + <NUM_LIT:1>)<EOL>kn = (-<NUM_LIT:1>)**n / _gam(n + <NUM_LIT:1>)<EOL>p = orthopoly1d(x, w, hn, kn, wfunc, (<NUM_LIT:0>, inf), monic,<EOL>lambda x: eval_genlaguerre(n, alpha, x))<EOL>return p<EOL>
Returns the nth order generalized (associated) Laguerre polynomial,
    L^(alpha)_n(x), orthogonal over [0,inf) with weighting function
    exp(-x) x**alpha with alpha > -1