def b36encode(number, alphabet='0123456789abcdefghijklmnopqrstuvwxyz'):
    """Converts an integer to a base36 string."""
    if not isinstance(number, (int, long)):
        long_value = 0L
        for (i, c) in enumerate(number[::-1]):
            long_value += (256**i) * ord(c)
        number = long_value

    base36 = '' if number != 0 else '0'
    sign = ''
    if 0 < number:
        sign = '-'
        number = -number

    while number != 0:
        number, i = divmod(number, len(alphabet))
        base36 = alphabet[i] + base36

    return sign + base36
dataset/ETHPy150Open kangasbros/django-bitcoin/django_bitcoin/BCAddressField.py/b36encode/swapped operands of `<`