def boolean_flag(name, configurable, set_help='', unset_help=''):
    # default helpstrings
    set_help = set_help or "set %s=True"%configurable
    unset_help = unset_help or "set %s=False"%configurable
    
    cls,trait = configurable.split('.')
    
    setter = {cls : {trait : True}}
    unsetter = {cls : {trait : False}}
    return {name : (setter, set_help), 'no-'+name : (unsetter, unset_help)}
Helper for building basic --trait, --no-trait flags.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/config/application.py/boolean_flag