human
Complete this python program:
def fisher_exact_test(a, b, c, d, **kwargs):
assistant
#Here is the Python program you requested.

    """Fast implementation of Fisher\s exact test (two-tailed).
    Returns the significance p for the given 2 x 2 contingency table:
    p < 0.05: significant
    p < 0.01: very significant
    The following test shows a very significant correlation between gender & dieting:
    |             | men | women |
    |     dieting |  1  |   9   |
    | non-dieting | 11  |   3   |
    fisher_exact_test(a=1, b=9, c=11, d=3) => 0.0028
    """
    _cache = {}
    def p(a, b, c, d):
        return ((C((a + b), a) * C((c + d), c)) / C((((a + b) + c) + d), (a + c)))
    def C(n, k):
        if (len(_cache) > 10000):
            _cache.clear()
        if (k > (n - k)):
            k = (n - k)
        if ((0 <= k <= n) and ((n, k) not in _cache)):
            c = 1.0
            for i in xrange(1, int((k + 1))):
                c *= ((n - k) + i)
                c /= i
            _cache[(n, k)] = c
        return _cache.get((n, k), 0.0)
    cutoff = p(a, b, c, d)
    s = (([cutoff] + [p((a + i), (b - i), (c - i), (d + i)) for i in xrange(1, (min(int(b), int(c)) + 1))]) + [p((a - i), (b + i), (c + i), (d - i)) for i in xrange(1, (min(int(a), int(d)) + 1))])
    return (sum((v for v in s if (v <= cutoff))) or 0.0)