human
Complete this python program:
def _calculate_tk(source):
assistant
#Here is the Python program you requested.

    """Reverse engineered cross-site request protection.
    """
    tkk = [406398, (561666268 + 1526272306)]
    b = tkk[0]
    if PY2:
        d = map(ord, source)
    else:
        d = source.encode('utf-8')
    def RL(a, b):
        for c in range(0, (len(b) - 2), 3):
            d = b[(c + 2)]
            d = ((ord(d) - 87) if (d >= 'a') else int(d))
            xa = ctypes.c_uint32(a).value
            d = ((xa >> d) if (b[(c + 1)] == '+') else (xa << d))
            a = (((a + d) & 4294967295) if (b[c] == '+') else (a ^ d))
        return ctypes.c_int32(a).value
    a = b
    for di in d:
        a = RL((a + di), '+-a^+6')
    a = RL(a, '+-3^+b+-f')
    a ^= tkk[1]
    a = (a if (a >= 0) else ((a & 2147483647) + 2147483648))
    a %= pow(10, 6)
    tk = '{0:d}.{1:d}'.format(a, (a ^ b))
    return tk