<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete_role(query):
 """ Delete a role. """

    role = _query_to_role(query)
    if click.confirm(f'Are you sure you want to delete {role!r}?'):
        role_manager.delete(role, commit=True)
        click.echo(f'Successfully deleted {role!r}')
    else:
        click.echo('Cancelled.')