

@ensure_tag(['tbl'])
def get_rowspan_data(table):
    w_namespace = get_namespace(table, 'w')
    tr_index = 0
    td_index = 0
    tr_rows = list(table.xpath('.//w:tr', namespaces=table.nsmap))
    for tr in table.xpath('.//w:tr', namespaces=table.nsmap):
        for td in tr.xpath('.//w:tc', namespaces=tr.nsmap):
            v_merge = get_v_merge(td)
            if (v_merge is None):
                td_index += get_grid_span(td)
                continue
            if (v_merge.get(('%sval' % w_namespace)) == 'restart'):
                row_span = 1
                for tr_el in tr_rows[(tr_index + 1):]:
                    td_el = get_td_at_index(tr_el, td_index)
                    td_el_v_merge = get_v_merge(td_el)
                    if (td_el_v_merge is None):
                        break
                    val = td_el_v_merge.get(('%sval' % w_namespace))
                    if (val == 'restart'):
                        break
                    row_span += 1
                (yield row_span)
            td_index += get_grid_span(td)
        tr_index += 1
        td_index = 0

dataset/ETHPy150Open PolicyStat/docx2html/docx2html/core.py get_rowspan_data/original