@click.command()<EOL>@click.option(<EOL>'<STR_LIT>', default=sys.stdin, type=click.File(),<EOL>help="<STR_LIT>"<EOL>)<EOL>@click_log.simple_verbosity_option(default=u'<STR_LIT>')<EOL>def pylint_amnesty(pylint_output):
errors = defaultdict(lambda: defaultdict(set))<EOL>for pylint_error in parse_pylint_output(pylint_output):<EOL><INDENT>errors[pylint_error.filename][pylint_error.linenum].add(pylint_error)<EOL><DEDENT>for file_with_errors in sorted(errors):<EOL><INDENT>try:<EOL><INDENT>opened_file = open(file_with_errors)<EOL><DEDENT>except IOError:<EOL><INDENT>LOG.warning(u"<STR_LIT>", file_with_errors, exc_info=True)<EOL><DEDENT>else:<EOL><INDENT>with opened_file as input_file:<EOL><INDENT>output_lines = []<EOL>for line_num, line in enumerate(input_file, start=<NUM_LIT:1>):<EOL><INDENT>output_lines.extend(<EOL>fix_pylint(<EOL>line,<EOL>errors[file_with_errors][line_num]<EOL>)<EOL>)<EOL><DEDENT><DEDENT>with open(file_with_errors, '<STR_LIT:w>') as output_file:<EOL><INDENT>output_file.writelines(output_lines)<EOL><DEDENT><DEDENT><DEDENT>
Add ``# pylint: disable`` clauses to add exceptions to all existing pylint errors in a codebase.