def handle(self, *args, **options):
        domain = since = None
        if len(args) == 1:
            domain = args[0]
        elif len(args) == 2:
            domain = args[0]
            since = string_to_datetime(args[1])
        else:
            raise CommandError((self.args, self.help) % 'Usage: %s\n%s')

        succeeded = []
        failed = []
        error_messages = defaultdict(lambda: 0)
        for form in iter_problem_forms(domain, since):
            print "%s\t%s\t%s\t%s\t%s" % (form._id, form.received_on,
                              form.xmlns,
                              form.get_data('form/meta/username'),
                              form.problem.strip())
            if not options["dryrun"]:
                try:
                    reprocess_form_cases(form)
                except Exception, e:
                    failed.append(form._id)
                    error_messages[str(e)] += 1
                else:
                    succeeded.append(form._id)

        print "%s / %s forms successfully processed, %s failures" % \
              (len(succeeded), len(succeeded) + len(failed), len(failed))
        if error_messages:
            print "The following errors were seen: \n%s" % \
                  ("\n".join("%s: %s" % (v, k) for k, v in error_messages.items()))
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/cleanup/management/commands/reprocess_error_forms.py/Command.handle/swapped operands of `%`