code: def test_filter_transform_selection_predicates():
      selector1 = alt.selection_interval(name="s1")
      selector2 = alt.selection_interval(name="s2")
      base = alt.Chart("data.txt").mark_point()
  
      chart = base.transform_filter(selector1)
      assert chart.to_dict()["transform"] == [
          {"filter": {"param": "s1"}}
      ]
  
      chart = base.transform_filter(~selector1)
      assert chart.to_dict()["transform"] == [
          {"filter": {"not": {"param": "s1"}}}
      ]
  
      chart = base.transform_filter(selector1 & selector2)
      assert chart.to_dict()["transform"] == [
          {"filter": {"and": [{"param": "s1"}, {"param": "s2"}]}}
      ]
  
      chart = base.transform_filter(selector1 | selector2)
      assert chart.to_dict()["transform"] == [
          {"filter": {"or": [{"param": "s1"}, {"param": "s2"}]}}
      ]
  
      chart = base.transform_filter(selector1 | ~selector2)
      assert chart.to_dict()["transform"] == [
          {
              "filter": {
                  "or": [{"param": "s1"}, {"not": {"param": "s2"}}]
              }
          }
      ]
  
      chart = base.transform_filter(~selector1 | ~selector2)
      assert chart.to_dict()["transform"] == [
          {
              "filter": {
                  "or": [
                      {"not": {"param": "s1"}},
                      {"not": {"param": "s2"}},
                  ]
              }
          }
      ]
  
      chart = base.transform_filter(~(selector1 & selector2))
      assert chart.to_dict()["transform"] == [
          {
              "filter": {
                  "not": {"and": [{"param": "s1"}, {"param": "s2"}]}
              }
          }
      ]
  
imports: import io
  import json
  import operator
  import os
  import pathlib
  import tempfile
  import jsonschema
  import pytest
  import pandas
  import altair.vegalite.v5
label_desc: Use image node_id 18 for calling a global function with example usage: test_filter_transform_selection_predicates() without return types