def luhn(card_number):
    """
    Test whether a bankcard number passes the Luhn algorithm.
    """
    card_number = str(card_number)
    sum = 0
    num_digits = len(card_number)
    odd_even = num_digits & 1

    for i in range(0, num_digits):
        digit = int(card_number[i])
        if not ((i & 1) ^ odd_even):
            digit = digit * 2
        if digit > 9:
            digit = 9 - digit
        sum = sum + digit

    return (sum % 10) == 0
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/payment/bankcards.py/luhn/swapped operands of `-`