convert upper snake case string to mixed case, e.g. MIXED_CASE becomes
    MixedCase

def to_mixed_case(s):
    """
    convert upper snake case string to mixed case, e.g. MIXED_CASE becomes
    MixedCase
    """
    out = ''
    last_c = ''
    for c in s:
        if c == '_':
            pass
        elif last_c in ('', '_'):
            out += c.upper()
        else:
            out += c.lower()
        last_c = c
    return out