def underToMixed(name):
    """
    >>> underToMixed('some_large_model_name_perhaps')
    'someLargeModelNamePerhaps'

    >>> underToMixed('exception_for_id')
    'exceptionForID'
    """
    if name.endswith('_id'):
        return underToMixed(name[:-3] + "ID")
    return _underToMixedRE.sub(lambda m: m.group(0)[1].upper(),
                               name)
def underToMixed ( name ) : if name . endswith ( '_id' ) : return underToMixed ( name [ : - 3 ] + "ID" ) return _underToMixedRE . sub ( lambda m : m . group ( 0 ) [ 1 ] . upper ( ) , name )
>>> underToMixed('some_large_model_name_perhaps')
    'someLargeModelNamePerhaps'

    >>> underToMixed('exception_for_id')
    'exceptionForID'