code: def test_repeat():
      # wrapped repeat
      chart1 = (
          alt.Chart("data.csv")
          .mark_point()
          .encode(
              x=alt.X(alt.repeat(), type="quantitative"),
              y="y:Q",
          )
          .repeat(["A", "B", "C", "D"], columns=2)
      )
  
      dct1 = chart1.to_dict()
  
      assert dct1["repeat"] == ["A", "B", "C", "D"]
      assert dct1["columns"] == 2
      assert dct1["spec"]["encoding"]["x"]["field"] == {
          "repeat": "repeat"
      }
  
      # explicit row/col repeat
      chart2 = (
          alt.Chart("data.csv")
          .mark_point()
          .encode(
              x=alt.X(alt.repeat("row"), type="quantitative"),
              y=alt.Y(alt.repeat("column"), type="quantitative"),
          )
          .repeat(row=["A", "B", "C"], column=["C", "B", "A"])
      )
  
      dct2 = chart2.to_dict()
  
      assert dct2["repeat"] == {
          "row": ["A", "B", "C"],
          "column": ["C", "B", "A"],
      }
      assert "columns" not in dct2
      assert dct2["spec"]["encoding"]["x"]["field"] == {"repeat": "row"}
      assert dct2["spec"]["encoding"]["y"]["field"] == {
          "repeat": "column"
      }
  
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 32 for calling a global function with example usage: test_repeat() without return types