def chunked_join(iterable, int1, int2, str1, str2, func):
chunks = list(chunked(iterable, int1))<EOL>logging.debug(chunks)<EOL>groups = [list(chunked(chunk, int2)) for chunk in chunks]<EOL>logging.debug(groups)<EOL>return str1.join([<EOL>str2.join([func('<STR_LIT>'.join(chunk)) for chunk in chunks])<EOL>for chunks in groups<EOL>])<EOL>
Chunk and join.