def _format_multirow(self, row, ilevels, i, rows):
for j in range(ilevels):<EOL><INDENT>if row[j].strip():<EOL><INDENT>nrow = <NUM_LIT:1><EOL>for r in rows[i + <NUM_LIT:1>:]:<EOL><INDENT>if not r[j].strip():<EOL><INDENT>nrow += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if nrow > <NUM_LIT:1>:<EOL><INDENT>row[j] = '<STR_LIT>'.format(<EOL>nrow=nrow, row=row[j].strip())<EOL>self.clinebuf.append([i + nrow - <NUM_LIT:1>, j + <NUM_LIT:1>])<EOL><DEDENT><DEDENT><DEDENT>return row<EOL>
r"""
        Check following rows, whether row should be a multirow

        e.g.:     becomes:
        a & 0 &   \multirow{2}{*}{a} & 0 &
          & 1 &     & 1 &
        b & 0 &   \cline{1-2}
                  b & 0 &