MCPcopy Create free account
hub / github.com/makelove/OpenCV-Python-Tutorial / grouper

Function grouper

官方samples/common.py:202–209  ·  view source on GitHub ↗

grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx

(n, iterable, fillvalue=None)

Source from the content-addressed store, hash-verified

200
201
202def grouper(n, iterable, fillvalue=None):
203 '''grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx'''
204 args = [iter(iterable)] * n
205 if PY3:
206 output = it.zip_longest(fillvalue=fillvalue, *args)
207 else:
208 output = it.izip_longest(fillvalue=fillvalue, *args)
209 return output
210
211def mosaic(w, imgs):
212 '''Make a grid from images.

Callers 1

mosaicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected