I think you might still be missing the point. It appears that the judge is using his discretion to impose a ‘sentence’ on the woman that will force he to do something useful with herself - knit some shit then donate it to charity, and not-coincidentally at the same time force her to sit down doing something quiet and reflect on the idea that punching people (even arseholes) probably isn’t the best use of her time.
The easy option would be sending her to jail. But, as they say, for every problem there is a solution that is easy, obvious, and wrong.^
This is the creative option, which overall is likely to result in much greater net benefit to society.
^ yes, I know that isn’t the exact wording Mencken used