def tables(output_lines):
 tables_ = []
 table_ = []
 label = None
 start = False
 header = False
 if (not isinstance(output_lines, list)):
  output_lines = output_lines.split('\n')
 for line in output_lines:
  if delimiter_line.match(line):
   if (not start):
    start = True
   elif (not header):
    header = True
   else:
    start = header = None
    table_.append(line)
    parsed = table(table_)
    parsed['label'] = label
    tables_.append(parsed)
    table_ = []
    label = None
    continue
  if start:
   table_.append(line)
  elif (label is None):
   label = line
  else:
   LOG.warning('Invalid line between tables: %s', line)
 if (len(table_) > 0):
  LOG.warning('Missing end of table')
 return tables_

def tables ( output_lines ) : tables_ = [ ] table_ = [ ] label = None start = False header = False if ( not isinstance ( output_lines , list ) ) : output_lines = output_lines . split ( '\n' ) for line in output_lines : if delimiter_line . match ( line ) : if ( not start ) : start = True elif ( not header ) : header = True else : start = header = None table_ . append ( line ) parsed = table ( table_ ) parsed [ 'label' ] = label tables_ . append ( parsed ) table_ = [ ] label = None continue if start : table_ . append ( line ) elif ( label is None ) : label = line else : LOG . warning ( 'Invalid line between tables: %s' , line ) if ( len ( table_ ) > 0 ) : LOG . warning ( 'Missing end of table' ) return tables_
find all ascii-tables in output and parse them .