code: def test_html_renderer_embed_options(chart, renderer="html"):
      """Test that embed_options in renderer metadata are correctly manifest in html"""
      # Short of parsing the javascript, it's difficult to parse out the
      # actions. So we use string matching
  
      def assert_has_options(chart, **opts):
          html = chart._repr_mimebundle_(None, None)["text/html"]
          for key, val in opts.items():
              assert json.dumps({key: val})[1:-1] in html
  
      with alt.renderers.enable(renderer):
          assert_has_options(chart, mode="vega-lite")
  
          with alt.renderers.enable(
              embed_options={"actions": {"export": True}}
          ):
              assert_has_options(
                  chart, mode="vega-lite", actions={"export": True}
              )
  
          with alt.renderers.set_embed_options(actions=True):
              assert_has_options(chart, mode="vega-lite", actions=True)
  
file_path: altair/tests/vegalite/v5/test_renderers.py
imports: import json
  import pytest
  import altair.vegalite.v5
label_desc: Use image node_id 2 for calling a global function with example usage: test_html_renderer_embed_options(chart, renderer) without return types