def delete_config(key):
    """
    Delete a config key
    """
    path = os.path.expanduser("~") + os.sep + '.rainbow_config.json'
    try:
        data = load_config(path)
    except:
        raise Exception('Config file is messed up.')
    # Drop key
    if key in data and key in c:
        data.pop(key)
        c.pop(key)
        try:
            data[key] = c[key] = get_default_config(key)
        except:
            pass
    else:
        raise Exception('No such config key.')
    # Save
    with open(path, 'w') as out:
        json.dump(data, out, indent=4)
    os.system('chmod 777 ' + path)
dataset/ETHPy150Open DTVD/rainbowstream/rainbowstream/config.py/delete_config/original