code: def test_add_filters():
      filters = []
      with ExitStack() as stack:
          stack.enter_context(
              mock.patch(
                  "dtale.predefined_filters.PREDEFINED_FILTERS", filters
              )
          )
          predefined_filters.set_filters(
              [
                  {
                      "name": "A and B > 2",
                      "column": "A",
                      "description": "Filter A with B greater than 2",
                      "handler": lambda df, val: df[
                          (df["A"] == val) & (df["B"] > 2)
                      ],
                      "input_type": "input",
                  }
              ]
          )
          assert len(predefined_filters.get_filters()) == 1
          predefined_filters.add_filters(
              [
                  {
                      "name": "A and (B % 2) == 0",
                      "column": "A",
                      "description": "Filter A with B mod 2 equals zero (is even)",
                      "handler": lambda df, val: df[
                          (df["A"] == val) & (df["B"] % 2 == 0)
                      ],
                      "input_type": "select",
                  }
              ]
          )
          assert len(predefined_filters.get_filters()) == 2
          with pytest.raises(ValueError) as error:
              predefined_filters.add_filters(
                  [
                      {
                          "name": "A and (B % 2) == 0",
                          "column": "A",
                          "description": "Filter A with B mod 2 equals zero (is even)",
                          "handler": lambda df, val: df[
                              (df["A"] == val) & (df["B"] % 2 == 0)
                          ],
                          "input_type": "select",
                      }
                  ]
              )
              assert (
                  "A predefined_filters filter already exists for A and (B % 2) == 0"
                  in str(error.value)
              )
  
file_path: dtale/tests/dtale/test_predefined_filters.py
imports: import mock
  import pytest
  import pandas
  import dtale.global_state
  import dtale.predefined_filters
  from dtale.query import handle_predefined
  from tests import ExitStack
label_desc: Use image node_id 2 for calling a global function with example usage: test_add_filters() without return types