Batches a list into a list of lists, with sub-lists sized by a specified
    batch size.

def batch(items, size):
    """Batches a list into a list of lists, with sub-lists sized by a specified
    batch size."""
    return [items[x:x + size] for x in xrange(0, len(items), size)]