code: def test_transformed_data_exclude(to_reconstruct):
      source = data.wheat()
      bar = alt.Chart(source).mark_bar().encode(x="year:O", y="wheat:Q")
      rule = (
          alt.Chart(source)
          .mark_rule(color="red")
          .encode(y="mean(wheat):Q")
      )
      some_annotation = (
          alt.Chart(name="some_annotation")
          .mark_text(fontWeight="bold")
          .encode(
              text=alt.value("Just some text"),
              y=alt.datum(85),
              x=alt.value(200),
          )
      )
  
      chart = (bar + rule + some_annotation).properties(width=600)
      if to_reconstruct:
          # When reconstructing a Chart, Altair uses different classes
          # then what might have been originally used. See
          # https://github.com/hex-inc/vegafusion/issues/354 for more info.
          chart = alt.Chart.from_dict(chart.to_dict())
      datasets = chart.transformed_data(exclude=["some_annotation"])
  
      assert len(datasets) == 2
      assert len(datasets[0]) == 52
      assert "wheat_start" in datasets[0]
      assert len(datasets[1]) == 1
      assert "mean_wheat" in datasets[1]
  
file_path: altair/tests/test_transformed_data.py
imports: import pkgutil
  import pytest
  from vega_datasets import data
  import altair
  from altair.utils.execeval import eval_block
  from tests import examples_methods_syntax
label_desc: Use image node_id 3 for calling a global function with example usage: test_transformed_data_exclude(to_reconstruct) without return types