<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def constant_time_string_compare(a, b):
 """Helper for comparing string in constant time, independent of the python version being used. Args: a (str):
 A string to compare b (str):
 A string to compare """


    try:
        return hmac.compare_digest(a, b)
    except AttributeError:

        if len(a) != len(b):
            return False

        result = 0

        for x, y in zip(a, b):
            result |= ord(x) ^ ord(y)

        return result == 0