(data, definition, timezone=pytz.utc)
return sections
Return a low-level definition of a group of tables, given a data object and
    a high-level declarative definition of the table rows and value
    calculations.

    :param definition: dict with keys:
       "name" (optional): the name of the section
       "layout": list of rows to display. Each row must be a list of `DisplayConfig` classes
            that represent the cells of the row.
Return a low-level definition of a group of tables, given a data object and
    a high-level declarative definition of the table rows and value
    calculations.
Return a low - level definition of a group of tables given a data object and a high - level declarative definition of the table rows and value calculations .
def get_tables_as_rows(data, definition, timezone=pytz.utc):
    """
    Return a low-level definition of a group of tables, given a data object and
    a high-level declarative definition of the table rows and value
    calculations.

    :param definition: dict with keys:
       "name" (optional): the name of the section
       "layout": list of rows to display. Each row must be a list of `DisplayConfig` classes
            that represent the cells of the row.
    """

    sections = []

    for section in definition:
        rows = [
            [get_display_data(
                data,
                prop,
                timezone=timezone) for prop in row]
            for row in section['layout']]

        max_row_len = max(list(map(len, rows))) if rows else 0
        for row in rows:
            if len(row) < max_row_len:
                row.append({
                    "colspan": 2 * (max_row_len - len(row))
                })

        sections.append({
            "name": section.get('name') or '',
            "rows": rows
        })

    return sections
def get_tables_as_rows ( data , definition , timezone = pytz . utc ) : sections = [ ] for section in definition : rows = [ [ get_display_data ( data , prop , timezone = timezone ) for prop in row ] for row in section [ 'layout' ] ] max_row_len = max ( list ( map ( len , rows ) ) ) if rows else 0 for row in rows : if len ( row ) < max_row_len : row . append ( { "colspan" : 2 * ( max_row_len - len ( row ) ) } ) sections . append ( { "name" : section . get ( 'name' ) or '' , "rows" : rows } ) return sections