docstr: Extract filters to be applied to the dataframe from passed code.
  
  Args:
      code (str): A snippet of code to be parsed.
  
  Returns:
      dict: The dictionary containing all filters parsed from
          the passed code. The dictionary has the following structure:
          {
              "<df_number>": [
                  ("<left_operand>", "<operator>", "<right_operand>")
              ]
          }
  
  Raises:
      SyntaxError: If the code is unable to be parsed by `ast.parse()`.
      Exception: If any exception is raised during working with nodes
          of the code tree.
docstr_tok: ["Extract","filters","to","be","applied","to","the","dataframe","from","passed","code",".","Args",":","code","(","str",")",":","A","snippet","of","code","to","be","parsed",".","Returns",":","dict",":","The","dictionary","containing","all","filters","parsed","from","the","passed","code",".","The","dictionary","has","the","following","structure",":","{","``","<","df_number",">","''",":","[","(","``","<","left_operand",">","''",",","``","<","operator",">","''",",","``","<","right_operand",">","''",")","]","}","Raises",":","SyntaxError",":","If","the","code","is","unable","to","be","parsed","by","`","ast.parse","(",")","`",".","Exception",":","If","any","exception","is","raised","during","working","with","nodes","of","the","code","tree","."]
code: def _extract_filters(self, code) -> dict[str, list]:
      """
      Extract filters to be applied to the dataframe from passed code.
  
      Args:
          code (str): A snippet of code to be parsed.
  
      Returns:
          dict: The dictionary containing all filters parsed from
              the passed code. The dictionary has the following structure:
              {
                  "<df_number>": [
                      ("<left_operand>", "<operator>", "<right_operand>")
                  ]
              }
  
      Raises:
          SyntaxError: If the code is unable to be parsed by `ast.parse()`.
          Exception: If any exception is raised during working with nodes
              of the code tree.
      """
      try:
          parsed_tree = ast.parse(code)
      except SyntaxError:
          self._logger.log(
              "Invalid code passed for extracting filters",
              level=logging.ERROR,
          )
          self._logger.log(
              f"{traceback.format_exc()}", level=logging.DEBUG
          )
          raise
  
      try:
          filters = self._extract_comparisons(parsed_tree)
      except Exception:
          self._logger.log(
              "Unable to extract filters for passed code",
              level=logging.ERROR,
          )
          self._logger.log(
              f"{traceback.format_exc()}", level=logging.DEBUG
          )
          raise
  
      return filters
  
imports: import re
  import ast
  import uuid
  from collections import defaultdict
  import astor
  import pandas
  from pandasai.helpers.path import find_project_root
  from pandasai.helpers.skills_manager import SkillsManager
  from pandasai.helpers.sql import extract_table_names
  from .node_visitors import AssignmentVisitor, CallVisitor
  from .save_chart import add_save_chart
  from .optional import import_dependency
  from ..exceptions import BadImportError, MaliciousQueryError, NoResultFoundError, InvalidConfigError
  from ..constants import WHITELISTED_BUILTINS, WHITELISTED_LIBRARIES
  from typing import Union, List, Generator, Any
  from ..helpers.logger import Logger
  from ..schemas.df_config import Config
  import logging
  import traceback
label_desc: Use image node_id 20 for calling the CodeManager obj's underlying member method code with example usage: obj._extract_filters(code) and returns: filters