parameters: (self, parent, block)
return_statement: return is_table
docstring: Ensure first two rows (column header and separator row) are valid table rows.
  
          Keep border check and separator row do avoid repeating the work.
docstring_summary: Ensure first two rows (column header and separator row) are valid table rows.
docstring_tokens: Ensure first two rows ( column header and separator row ) are valid table rows .
function: def test(self, parent, block):
          """
          Ensure first two rows (column header and separator row) are valid table rows.
  
          Keep border check and separator row do avoid repeating the work.
          """
          is_table = False
          rows = [row.strip() for row in block.split('\n')]
          if len(rows) > 1:
              header0 = rows[0]
              self.border = PIPE_NONE
              if header0.startswith('|'):
                  self.border |= PIPE_LEFT
              if self.RE_END_BORDER.search(header0) is not None:
                  self.border |= PIPE_RIGHT
              row = self._split_row(header0)
              row0_len = len(row)
              is_table = row0_len > 1
  
              # Each row in a single column table needs at least one pipe.
              if not is_table and row0_len == 1 and self.border:
                  for index in range(1, len(rows)):
                      is_table = rows[index].startswith('|')
                      if not is_table:
                          is_table = self.RE_END_BORDER.search(rows[index]) is not None
                      if not is_table:
                          break
  
              if is_table:
                  row = self._split_row(rows[1])
                  is_table = (len(row) == row0_len) and set(''.join(row)) <= set('|:- ')
                  if is_table:
                      self.separator = row
  
          return is_table
function_tokens: def test ( self , parent , block ) : is_table = False rows = [ row . strip ( ) for row in block . split ( '\n' ) ] if len ( rows ) > 1 : header0 = rows [ 0 ] self . border = PIPE_NONE if header0 . startswith ( '|' ) : self . border |= PIPE_LEFT if self . RE_END_BORDER . search ( header0 ) is not None : self . border |= PIPE_RIGHT row = self . _split_row ( header0 ) row0_len = len ( row ) is_table = row0_len > 1 # Each row in a single column table needs at least one pipe. if not is_table and row0_len == 1 and self . border : for index in range ( 1 , len ( rows ) ) : is_table = rows [ index ] . startswith ( '|' ) if not is_table : is_table = self . RE_END_BORDER . search ( rows [ index ] ) is not None if not is_table : break if is_table : row = self . _split_row ( rows [ 1 ] ) is_table = ( len ( row ) == row0_len ) and set ( '' . join ( row ) ) <= set ( '|:- ' ) if is_table : self . separator = row return is_table