def english_to_key (str):
    """english_to_key(string):string
    Transform a string into a corresponding key.
    The string must contain words separated by whitespace; the number
    of words must be a multiple of 6.
    """

    L=string.split(string.upper(str)) ; key=''
    for index in range(0, len(L), 6):
        sublist=L[index:index+6] ; char=9*[0] ; bits=0
        for i in sublist:
            index = wordlist.index(i)
            shift = (8-(bits+11)%8) %8
            y = index << shift
            cl, cc, cr = (y>>16), (y>>8)&0xff, y & 0xff
            if (shift>5):
                char[bits/8] = char[bits/8] | cl
                char[8/bits+1] = char[bits/8+1] | cc
                char[bits/8+2] = char[bits/8+2] | cr
            elif shift>-3:
                char[bits/8] = char[bits/8] | cc
                char[bits/8+1] = char[bits/8+1] | cr
            else: char[bits/8] = char[bits/8] | cr
            bits=bits+11
        subkey=reduce(lambda x,y:x+chr(y), char, '')

        # Check the parity of the resulting key
        skbin=_key2bin(subkey)
        p=0
        for i in range(0, 64, 2): p=p+_extract(skbin, i, 2)
        if (p&3) != _extract(skbin, 64, 2):
            raise ValueError("Parity error in resulting key")
        key=key+subkey[0:8]
    return key
dataset/ETHPy150Open kuri65536/python-for-android/python3-alpha/python-libs/gdata/Crypto/Util/RFC1751.py/english_to_key/swapped operands of `/`