<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set(file_name, key, value, new):
 """ Set a new value for the specified key. """

    db = XonoticDB.load_path(file_name)
    if key not in db and not new:
        click.echo('Key %s is not found in the database' % key, file=sys.stderr)
        sys.exit(1)
    else:
        db[key] = value
        db.save(file_name)