def constant_time_string_compare(a, b):
try:<EOL><INDENT>return hmac.compare_digest(a, b)<EOL><DEDENT>except AttributeError:<EOL><INDENT>if len(a) != len(b):<EOL><INDENT>return False<EOL><DEDENT>result = <NUM_LIT:0><EOL>for x, y in zip(a, b):<EOL><INDENT>result |= ord(x) ^ ord(y)<EOL><DEDENT>return result == <NUM_LIT:0><EOL><DEDENT>
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