code: def test_primitive_chart_examples(
      filename, rows, cols, to_reconstruct
  ):
      source = pkgutil.get_data(
          examples_methods_syntax.__name__, filename
      )
      chart = eval_block(source)
      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())
      df = chart.transformed_data()
  
      assert len(df) == rows
      assert set(cols).issubset(set(df.columns))
  
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 1 for calling a global function with example usage: test_primitive_chart_examples(filename, rows, cols, to_reconstruct) without return types