code: def filter_dataframe(df: pd.DataFrame, conditions: list):
      # convert list of conditions to ast.
      # assumes that list was got from extract_comparison_conditions
      where_query = None
      for op, arg1, arg2 in conditions:
          item = ast.BinaryOperation(
              op=op, args=[ast.Identifier(arg1), ast.Constant(arg2)]
          )
          if where_query is None:
              where_query = item
          else:
              where_query = ast.BinaryOperation(
                  op="and", args=[where_query, item]
              )
  
      query = ast.Select(
          targets=[ast.Star()],
          from_table=ast.Identifier("df"),
          where=where_query,
      )
  
      return query_df(df, query)
  
file_path: mindsdb/mindsdb/integrations/utilities/sql_utils.py
imports: import pandas
  from mindsdb.api.executor.utilities.sql import query_df
  from mindsdb_sql.parser import ast
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb_sql.planner.utils import query_traversal
label_desc: Use image node_id 5 for calling a global function with example usage: filter_dataframe(df, conditions) and returns: query_df