import re


def pascal_case_ify(name):
    """
    Uppercase first letter of ``name``, or any letter following an ``_``. In
    the latter case, also strips out the ``_``.

    => key_for becomes KeyFor
    => options becomes Options
    """
    return re.sub(r'(^|_)\w', lambda m: m.group(0)[-1].upper(), name)