This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| from zope.interface import classProvides, implements | |
| from collective.transmogrifier.interfaces import ISectionBlueprint | |
| from collective.transmogrifier.interfaces import ISection | |
| from collective.transmogrifier.utils import Matcher, Condition | |
| import logging | |
| logger = logging.getLogger(__name__) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| def groupby(iterable, groupsize=2): | |
| """ | |
| Split an iterable [a, b, c, ...] | |
| into a nested list of tuples [(a, b), (c, ...)] | |
| where the length of the tuples is governed by groupsize. | |
| The default groupsize results in pairwise grouping: |