MCPcopy Create free account
hub / github.com/ipython/ipython / _col_chunks

Function _col_chunks

IPython/utils/text.py:616–624  ·  view source on GitHub ↗

Yield successive max_rows-sized column chunks from l.

(l, max_rows, row_first=False)

Source from the content-addressed store, hash-verified

614#-----------------------------------------------------------------------------
615
616def _col_chunks(l, max_rows, row_first=False):
617 """Yield successive max_rows-sized column chunks from l."""
618 if row_first:
619 ncols = (len(l) // max_rows) + (len(l) % max_rows > 0)
620 for i in range(ncols):
621 yield [l[j] for j in range(i, len(l), ncols)]
622 else:
623 for i in range(0, len(l), max_rows):
624 yield l[i:(i + max_rows)]
625
626
627def _find_optimal(rlist, row_first=False, separator_size=2, displaywidth=80):

Callers 1

_find_optimalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected