@dallinger.command()<EOL>@click.option("<STR_LIT>")<EOL>@click.option(<EOL>"<STR_LIT>",<EOL>is_flag=True,<EOL>flag_value=True,<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.option(<EOL>"<STR_LIT>",<EOL>default="<STR_LIT>",<EOL>help="<STR_LIT>",<EOL>)<EOL>@click.option("<STR_LIT>", is_flag=True, flag_value=True, help="<STR_LIT>")<EOL>@click.argument("<STR_LIT>", nargs=-<NUM_LIT:1>)<EOL>def revoke(workers, qualification, by_name, reason, sandbox):
if not (workers and qualification):<EOL><INDENT>raise click.BadParameter(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>mturk = _mturk_service_from_config(sandbox)<EOL>if by_name:<EOL><INDENT>result = mturk.get_qualification_type_by_name(qualification)<EOL>if result is None:<EOL><INDENT>raise click.BadParameter(<EOL>'<STR_LIT>'.format(qualification)<EOL>)<EOL><DEDENT>qid = result["<STR_LIT:id>"]<EOL><DEDENT>else:<EOL><INDENT>qid = qualification<EOL><DEDENT>if not click.confirm(<EOL>'<STR_LIT>'<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(qid, "<STR_LIT>".join(workers))<EOL>):<EOL><INDENT>click.echo("<STR_LIT>")<EOL>return<EOL><DEDENT>for worker in workers:<EOL><INDENT>if mturk.revoke_qualification(qid, worker, reason):<EOL><INDENT>click.echo(<EOL>'<STR_LIT>'.format(qid, worker)<EOL>)<EOL><DEDENT><DEDENT>results = list(mturk.get_workers_with_qualification(qid))<EOL>click.echo(<EOL>'<STR_LIT>'.format(len(results), qid)<EOL>)<EOL>
Revoke a qualification from 1 or more workers