code: def test_index_selection_example(transformer):
      with alt.data_transformers.enable(transformer):
          source = data.cars()
          brush = alt.selection_point(name="index")
  
          chart = (
              alt.Chart(source)
              .mark_point()
              .encode(
                  x="Horsepower:Q",
                  y="Miles_per_Gallon:Q",
                  color=alt.condition(
                      brush, "Cylinders:O", alt.value("grey")
                  ),
              )
              .add_params(brush)
          )
  
          widget = alt.JupyterChart(chart)
  
          if transformer == "vegafusion":
              widget.local_tz = "UTC"
              assert widget.spec == chart.to_dict(format="vega")
          else:
              assert widget.spec == chart.to_dict()
  
          # There should be one selection and zero params
          assert len(widget.selections.trait_values()) == 1
          assert len(widget.params.trait_values()) == 0
  
          # Check initial interval selection
          selection = widget.selections.index
          assert isinstance(selection, IndexSelection)
          assert selection.value == []
          assert selection.store == []
  
          # Simulate Vega signal update
          store = [
              {"unit": "", "_vgsid_": 220},
              {"unit": "", "_vgsid_": 330},
              {"unit": "", "_vgsid_": 341},
          ]
  
          widget._vl_selections = {
              "index": {
                  "value": {
                      "_vgsid_": "Set(220,330,341)",
                      "vlPoint": {
                          "or": [
                              {"_vgsid_": 220},
                              {"_vgsid_": 330},
                              {"_vgsid_": 341},
                          ]
                      },
                  },
                  "store": store,
              }
          }
  
          selection = widget.selections.index
          assert isinstance(selection, IndexSelection)
          assert selection.value == [219, 329, 340]
          assert selection.store == store
  
file_path: altair/tests/test_jupyter_chart.py
imports: import altair
  from altair.jupyter.jupyter_chart import IntervalSelection, IndexSelection, PointSelection
  from vega_datasets import data
  import pandas
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_index_selection_example(transformer) without return types