code: def count_tables(filename_or_fobj, encoding="utf-8", table_tag="table"):
      
  
      source = Source.from_file(
          filename_or_fobj, plugin_name="html", mode="rb", encoding=encoding
      )
      html = source.fobj.read().decode(source.encoding)
      html_tree = document_fromstring(html)
      tables = html_tree.xpath("//{}".format(table_tag))
      result = len(tables)
  
      if source.should_close:
          source.fobj.close()
  
      return result
docs: Read a file passed by arg and return your table HTML tag count.