code: def test_chart_from_dict():
      base = alt.Chart("data.csv").mark_point().encode(x="x:Q", y="y:Q")
  
      charts = [
          base,
          base + base,
          base | base,
          base & base,
          base.facet("c:N"),
          (base + base).facet(row="c:N", data="data.csv"),
          base.repeat(["c", "d"]),
          (base + base).repeat(row=["c", "d"]),
      ]
  
      for chart in charts:
          chart_out = alt.Chart.from_dict(chart.to_dict())
          assert type(chart_out) is type(chart)
  
      # test that an invalid spec leads to a schema validation error
      with pytest.raises(jsonschema.ValidationError):
          alt.Chart.from_dict({"invalid": "spec"})
  
imports: import io
  import json
  import operator
  import os
  import pathlib
  import tempfile
  import jsonschema
  import pytest
  import pandas
  import altair.vegalite.v5
label_desc: Use image node_id 29 for calling a global function with example usage: test_chart_from_dict() without return types