code: def __init__(self, pgdf: PandasGuiDataFrameStore):
      super().__init__()
      pgdf = PandasGuiDataFrameStore.cast(pgdf)
      pgdf.filter_viewer = self
      self.pgdf = pgdf
  
      self.list_view = self.ListView()
      self.list_model = self.ListModel(pgdf)
      self.list_view.setModel(self.list_model)
  
      # autocompletion for QLineEdit
      columns = self.pgdf.df_unfiltered.columns
      valid_values = [f"`{col}`" for col in columns]
      categoricals = columns[
          self.pgdf.df_unfiltered.dtypes == "category"
      ]
      low_cardinality = columns[
          nunique(self.pgdf.df_unfiltered) < CATEGORICAL_THRESHOLD
      ]
  
      # make unique the column names
      all_categoricals = list(set(categoricals) | set(low_cardinality))
  
      for col in all_categoricals:
          if col in categoricals:
              in_dataset = [
                  f'"{val}"'
                  for val in self.pgdf.df_unfiltered[col].cat.categories
              ]
          else:
              in_dataset = [
                  f'"{val}"'
                  for val in unique(self.pgdf.df_unfiltered[col])
              ]
          valid_values.extend(in_dataset)
  
      self.completer = Completer(valid_values)
      self.completer.setCaseSensitivity(Qt.CaseInsensitive)
      self.completer.setFilterMode(Qt.MatchContains)
  
      self.text_input = QtWidgets.QLineEdit()
      self.text_input.setCompleter(self.completer)
      self.text_input.setPlaceholderText("Enter query expression")
      self.text_input_label = QtWidgets.QLabel(
          """<a style="color: #1e81cc;" href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.query.html">What's a query expression?</a>"""
      )
      self.text_input_label.linkActivated.connect(
          lambda link: QDesktopServices.openUrl(QUrl(link))
      )
      self.text_input.setValidator(None)
      self.text_input.setCompleter(self.completer)
  
      # Signals
      self.text_input.returnPressed.connect(self.add_filter)
  
      # Layout
      self.new_filter_layout = QtWidgets.QHBoxLayout()
      self.new_filter_layout.addWidget(self.text_input)
      self.layout = QtWidgets.QVBoxLayout()
      self.layout.addLayout(self.new_filter_layout)
      self.layout.addWidget(self.text_input_label)
      self.layout.addWidget(self.list_view)
      self.setLayout(self.layout)
  
imports: import os
  import re
  import sys
  from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtCore import Qt
  from PyQt5.QtGui import QDesktopServices
  from PyQt5.QtCore import QUrl
  from pandasgui.utility import nunique, unique
  from pandasgui.store import PandasGuiDataFrameStore
  import pandasgui
  import logging
label_desc: Use image node_id 1 to create a new FilterViewer object from inherited base classes: QtWidgets with example: obj = FilterViewer(pgdf)