human
I wrote the below code

    as_gamma = expr.has(gamma)
    as_factorial = expr.has(factorial)
    as_binomial = expr.has(binomial)
    expr = expr.replace(binomial, (lambda n, k: (_rf(((n - k) + 1).expand(), k.expand()) / _rf(1, k.expand()))))
    expr = expr.replace(factorial, (lambda n: _rf(1, n.expand())))
    expr = expr.rewrite(gamma)
    expr = expr.replace(gamma, (lambda n: _rf(1, (n - 1).expand())))
    if as_gamma:
        expr = expr.replace(_rf, (lambda a, b: (gamma((a + b)) / gamma(a))))
    else:
        expr = expr.replace(_rf, (lambda a, b: (binomial(((a + b) - 1), b) * gamma((b + 1)))))
    def rule(n, k):
        (coeff, rewrite) = (S.One, False)
        (cn, _n) = n.as_coeff_Add()
        if (_n and cn.is_Integer and cn):
            coeff *= (_rf((_n + 1), cn) / _rf(((_n - k) + 1), cn))
            rewrite = True
            n = _n
        if k.is_Add:
            (ck, _k) = k.as_coeff_Add()
            if (_k and ck.is_Integer and ck):
                coeff *= (_rf((((n - ck) - _k) + 1), ck) / _rf((_k + 1), ck))
                rewrite = True
                k = _k
        if rewrite:
            return (coeff * binomial(n, k))
    expr = expr.replace(binomial, rule)
    def rule_gamma(expr, level=0):
        '    Simplify    products    of    gamma    functions    further.    '
        if expr.is_Atom:
            return expr
        def gamma_rat(x):
            was = x.count(gamma)
            xx = x.replace(gamma, (lambda n: _rf(1, (n - 1).expand()).replace(_rf, (lambda a, b: (gamma((a + b)) / gamma(a))))))
            if (xx.count(gamma) < was):
                x = xx
            return x
        def gamma_factor(x):
            if (x.func is gamma):
                return True
            if (x.is_Add or x.is_Mul):
                return any((gamma_factor(xi) for xi in x.args))
            if (x.is_Pow and (x.exp.is_integer or x.base.is_positive)):
                return gamma_factor(x.base)
            return False
        if (level == 0):
            expr = expr.func(*[rule_gamma(x, (level + 1)) for x in...

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

@timethis('combsimp')
def combsimp(expr):