code: def test_demo_data():
      d1 = demo_data("a", "b", "x")
      assert sorted(d1.keys()) == ["a", "b", "x"]
      assert d1["a"] == ["a1", "a1", "a2", "a2", "a1", "a1", "a2", "a2"]
      assert d1["b"] == ["b1", "b2", "b1", "b2", "b1", "b2", "b1", "b2"]
      assert d1["x"].dtype == np.dtype(float)
      assert d1["x"].shape == (8,)
  
      d2 = demo_data("x", "y")
      assert sorted(d2.keys()) == ["x", "y"]
      assert len(d2["x"]) == len(d2["y"]) == 5
  
      assert len(demo_data("x", min_rows=10)["x"]) == 10
      assert len(demo_data("a", "b", "x", min_rows=10)["x"]) == 12
      assert (
          len(demo_data("a", "b", "x", min_rows=10, nlevels=3)["x"])
          == 18
      )
  
      import pytest
  
      pytest.raises(PatsyError, demo_data, "a", "b", "__123")
      pytest.raises(TypeError, demo_data, "a", "b", asdfasdf=123)
  
imports: import itertools
  import numpy
  from patsy import PatsyError
  from patsy.categorical import C
  from patsy.util import no_pickling, assert_no_pickling
label_desc: Use image node_id 4 for calling a global function with example usage: test_demo_data() without return types