def match_rating_codex(s):
    if isinstance(s, bytes):
        raise TypeError(_no_bytes_err)
    s = s.upper()
    codex = []

    prev = None
    for i, c in enumerate(s):
        # not a space OR
        # starting character & vowel
        # or consonant not preceded by same consonant
        if (c != ' ' and (i == 0 and 'AEIOU' in c) or (c not in 'AEIOU' and c != prev)):
            codex.append(c)

        prev = c

    # just use first/last 3
    if len(codex) > 6:
        return ''.join(codex[:3]+codex[-3:])
    else:
        return ''.join(codex)
dataset/ETHPy150Open jamesturk/jellyfish/jellyfish/_jellyfish.py/match_rating_codex/swapped operands of `in`