def store_current_settings(c_settings):
    # Remove certain keys that just shouldn't be saved
    to_save = dict(c_settings)
    for k in ['action', 'verbose']:
        if k in c_settings:
            to_save.pop(k, None)
    buf = six.StringIO()
    buf.write("# Anvil last used settings\n")
    buf.write(utils.add_header(SETTINGS_FILE,
                               utils.prettify_yaml(to_save),
                               adjusted=sh.isfile(SETTINGS_FILE)))
    try:
        sh.write_file(SETTINGS_FILE, buf.getvalue())
    except __HOLE__ as e:
        LOG.warn("Failed writing to %s due to %s", SETTINGS_FILE, e)
dataset/ETHPy150Open openstack/anvil/anvil/__main__.py/store_current_settings