code: def extract(self, html, encoding=None, as_blocks=False):
          
          preds, blocks = self.predict(html, encoding=encoding, return_blocks=True)
          if as_blocks is False:
              return str_cast(b'\n'.join(blocks[ind].text for ind in np.flatnonzero(preds)))
          else:
              return [blocks[ind] for ind in np.flatnonzero(preds)]
docs: Extract the main content and/or comments from an HTML document and
          return it as a string or as a sequence of block objects.
  
          Args:
              html (str): HTML document as a string.
              encoding (str): Encoding of ``html``. If None (encoding unknown), the
                  original encoding will be guessed from the HTML itself.
              as_blocks (bool): If False, return the main content as a combined
                  string; if True, return the content-holding blocks as a list of
                  block objects.
  
          Returns:
              str or List[Block]