def METHOD_NAME(L, N):
    assert (L, N) in [(1024, 160), (2048, 224), (2048, 256), (3072, 256)]
    key = Python_DSAKey()
    (q, p) = Python_DSAKey.generate_qp(L, N)
    index = getRandomNumber(1, (p-1))
    g = powMod(index, int((p-1)/q), p)
    x = getRandomNumber(1, q-1)
    y = powMod(g, x, p)
    if gmpyLoaded or GMPY2_LOADED:
        p = mpz(p)
        q = mpz(q)
        g = mpz(g)
        x = mpz(x)
        y = mpz(y)
    key.q = q
    key.p = p
    key.g = g
    key.private_key = x
    key.public_key = y
    return key