environment/lib/python2.7/site-packages/IPython/utils/text.py
def compute_item_matrix(items, empty=None, *args, **kwargs) :
    """Returns a nested list, and info to columnize items

    Parameters :
    ------------

    items :
        list of strings to columize
    empty : (default None)
        default value to fill list if needed
    separator_size : int (default=2)
        How much caracters will be used as a separation between each columns.
    displaywidth : int (default=80)
        The width of the area onto wich the columns should enter

    Returns :
    ---------

    Returns a tuple of (strings_matrix, dict_info)

    strings_matrix :

        nested list of string, the outer most list contains as many list as
        rows, the innermost lists have each as many element as colums. If the
        total number of elements in `items` does not equal the product of
        rows*columns, the last element of some lists are filled with `None`.

    dict_info :
        some info to make columnize easier:

        columns_numbers : number of columns
        rows_numbers    : number of rows
        columns_width   : list of with of each columns
        optimal_separator_width : best separator width between columns

    Exemple :
    ---------

    In [1]: l = ['aaa','b','cc','d','eeeee','f','g','h','i','j','k','l']
       ...: compute_item_matrix(l,displaywidth=12)
    Out[1]:
        ([['aaa', 'f', 'k'],
        ['b', 'g', 'l'],
        ['cc', 'h', None],
        ['d', 'i', None],
        ['eeeee', 'j', None]],
        {'columns_numbers': 3,
        'columns_width': [5, 1, 1],
        'optimal_separator_width': 2,
        'rows_numbers': 5})

    """
    info = _find_optimal(map(len, items), *args, **kwargs)
    nrow, ncol = info['rows_numbers'], info['columns_numbers']
    return ([[ _get_or_default(items, c*nrow+i, default=empty) for c in range(ncol) ] for i in range(nrow) ], info)
def compute_item_matrix(items, empty=None, *args, **kwargs) :
    info = _find_optimal(map(len, items), *args, **kwargs)
    nrow, ncol = info['rows_numbers'], info['columns_numbers']
    return ([[ _get_or_default(items, c*nrow+i, default=empty) for c in range(ncol) ] for i in range(nrow) ], info)
def compute_item_matrix ( items , empty = None , * args , * * kwargs ) : info = _find_optimal ( map ( len , items ) , * args , * * kwargs ) nrow , ncol = info [ 'rows_numbers' ] , info [ 'columns_numbers' ] return ( [ [ _get_or_default ( items , c * nrow + i , default = empty ) for c in range ( ncol ) ] for i in range ( nrow ) ] , info )
Returns a nested list, and info to columnize items

    Parameters :
    ------------

    items :
        list of strings to columize
    empty : (default None)
        default value to fill list if needed
    separator_size : int (default=2)
        How much caracters will be used as a separation between each columns.
    displaywidth : int (default=80)
        The width of the area onto wich the columns should enter

    Returns :
    ---------

    Returns a tuple of (strings_matrix, dict_info)

    strings_matrix :

        nested list of string, the outer most list contains as many list as
        rows, the innermost lists have each as many element as colums. If the
        total number of elements in `items` does not equal the product of
        rows*columns, the last element of some lists are filled with `None`.

    dict_info :
        some info to make columnize easier:

        columns_numbers : number of columns
        rows_numbers    : number of rows
        columns_width   : list of with of each columns
        optimal_separator_width : best separator width between columns

    Exemple :
    ---------

    In [1]: l = ['aaa','b','cc','d','eeeee','f','g','h','i','j','k','l']
       ...: compute_item_matrix(l,displaywidth=12)
    Out[1]:
        ([['aaa', 'f', 'k'],
        ['b', 'g', 'l'],
        ['cc', 'h', None],
        ['d', 'i', None],
        ['eeeee', 'j', None]],
        {'columns_numbers': 3,
        'columns_width': [5, 1, 1],
        'optimal_separator_width': 2,
        'rows_numbers': 5})
Returns a nested list and info to columnize items