code: def test_render_examples_to_chart(syntax_module):
      for filename in iter_examples_filenames(syntax_module):
          source = pkgutil.get_data(syntax_module.__name__, filename)
          chart = eval_block(source)
  
          if chart is None:
              raise ValueError(
                  f"Example file {filename} should define chart in its final "
                  "statement."
              )
  
          try:
              assert isinstance(chart.to_dict(), dict)
          except Exception as err:
              raise AssertionError(
                  f"Example file {filename} raised an exception when "
                  f"converting to a dict: {err}"
              ) from err
  
file_path: altair/tests/test_examples.py
imports: import io
  import pkgutil
  import pytest
  import altair
  from altair.utils.execeval import eval_block
  from tests import examples_arguments_syntax
  from tests import examples_methods_syntax
label_desc: Use image node_id 2 for calling a global function with example usage: test_render_examples_to_chart(syntax_module) without return types