def format_option_for_gamess(opt, val, lop_off=True):
    """Reformat `val` for option `opt` from python into GAMESS-speak."""

    text = ''

    # Transform booleans into Fortran booleans
    if str(val) == 'True':
        text += '.true.'
    elif str(val) == 'False':
        text += '.false.'

    # No Transform
    else:
        text += str(val).lower()

    if lop_off:
        return opt[7:].lower(), text
    else:
        return opt.lower(), text