title: What's the idiomatic Python equivalent to Django's 'regroup' template tag?
body: <p><a href="http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup" rel="noreferrer">http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup</a></p>
  
  <p>I can think of a few ways of doing it with loops but I'd particularly like to know if there is a neat one-liner.</p>