class_docstr: Process Tables. 
class_docstr_tok: ["Process","Tables","."]
docstr: Ensure first two rows (column header and separator row) are valid table rows.
  
  Keep border check and separator row do avoid repeating the work.
docstr_tok: ["Ensure","first","two","rows","(","column","header","and","separator","row",")","are","valid","table","rows",".","Keep","border","check","and","separator","row","do","avoid","repeating","the","work","."]
code: def test(self, parent: etree.Element, block: str) -> bool:
      """
      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
  
file_path: markdown/markdown/extensions/tables.py
imports: from __future__ import annotations
  from .None import Extension
  from ..blockprocessors import BlockProcessor
  import xml.etree.ElementTree
  import re
  from typing import TYPE_CHECKING, Any, Sequence
label_desc: Use image node_id 2 for calling the TableProcessor obj's underlying member method code with example usage: obj.test(parent, block) and returns: is_table