human
I wrote the below code

    _map = map
    _count = itertools.count
    _islice = itertools.islice
    def calc_ndigits(n):
        def gen_x():
            return _map((lambda k: (k, ((4 * k) + 2), 0, ((2 * k) + 1))), _count(1))
        def compose(a, b):
            (aq, ar, as_, at) = a
            (bq, br, bs, bt) = b
            return ((aq * bq), ((aq * br) + (ar * bt)), ((as_ * bq) + (at * bs)), ((as_ * br) + (at * bt)))
        def extract(z, j):
            (q, r, s, t) = z
            return (((q * j) + r) // ((s * j) + t))
        def pi_digits():
            z = (1, 0, 0, 1)
            x = gen_x()
            while 1:
                y = extract(z, 3)
                while (y != extract(z, 4)):
                    z = compose(z, next(x))
                    y = extract(z, 3)
                z = compose((10, ((-10) * y), 0, 1), z)
                (yield y)
        return list(_islice(pi_digits(), n))
    return (calc_ndigits, (50,))

What's a good function header?
assistant
#Here's a good function header.

def task_pidigits():