def sequence_entropy(match):
    first_chr = match['token'][0]
    if ['a', '1'] in first_chr:
        base_entropy = 1
    else:
        if first_chr.isdigit():
            base_entropy = lg(10) # digits
        elif first_chr.isalpha():
            base_entropy = lg(26) # lower
        else:
            base_entropy = lg(26) + 1 # extra bit for uppercase
    if not match['ascending']:
        base_entropy += 1 # extra bit for descending instead of ascending
    return base_entropy + lg(len(match['token']))
dataset/ETHPy150Open dropbox/python-zxcvbn/zxcvbn/scoring.py/sequence_entropy/swapped operands of `in`