def _normalize_function_name(function):
    """
    Given a C++ function name, convert it to a nicely formatted Python
    function name.  For example "SetPositions" becomes "set_positions".
    """
    
    name = function[0].lower()
    for i,l in enumerate(function[1:]):
        if l.isupper():
            name += '_'
        name += l.lower()
    return name