def camelize(s):
    def f(k):
        if k.upper() != k:
            return k
        return k[0].upper() + k[1:].lower()
    return ' '.join([f(k) for k in s.split()])
>>> camelize("ABC DEF")
dataset/ETHPy150Open lsaffre/lino/lino/utils/__init__.py/camelize