human
I wrote the below code

    def f(rv):
        if (not (rv.func in (cos, sin))):
            return rv
        if base:
            f = rv.func
            t = f((base * 2))
            co = S.One
            if t.is_Mul:
                (co, t) = t.as_coeff_Mul()
            if (not (t.func in (cos, sin))):
                return rv
            if (rv.args[0] == t.args[0]):
                c = cos(base)
                s = sin(base)
                if (f is cos):
                    return (((c ** 2) - (s ** 2)) / co)
                else:
                    return (((2 * c) * s) / co)
            return rv
        elif (not rv.args[0].is_Number):
            (c, m) = rv.args[0].as_coeff_Mul(rational=True)
            if ((c.p % 2) == 0):
                arg = (((c.p // 2) * m) / c.q)
                c = TR11(cos(arg))
                s = TR11(sin(arg))
                if (rv.func == sin):
                    rv = ((2 * s) * c)
                else:
                    rv = ((c ** 2) - (s ** 2))
        return rv
    return bottom_up(rv, f)

What's a good function header?

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

def TR11(rv, base=None):