code: def test_te_2smooths():
      from patsy.highlevel import incr_dbuilder, build_design_matrices
  
      x1 = (-1.5) ** np.arange(20)
      x2 = (1.6) ** np.arange(20)
      # Hard coded R results for smooth: te(x1, x2, bs=c("cs", "cc"), k=c(5,7))
      # Without centering constraint:
      dmatrix_R_nocons = np.array(
          [
              [
                  -4.4303024184609255207e-06,
                  7.9884438387230142235e-06,
                  9.7987758194797719025e-06,
                  -7.2894213245475212959e-08,
                  1.5907686862964493897e-09,
                  -3.2565884983072595159e-11,
                  0.0170749607855874667439,
                  -3.0788499835965849050e-02,
                  -3.7765754357352458725e-02,
                  2.8094376299826799787e-04,
                  -6.1310290747349201414e-06,
                  1.2551314933193442915e-07,
                  -0.26012671685838206770,
                  4.6904420337437874311e-01,
                  0.5753384627946153129230,
                  -4.2800085814700449330e-03,
                  9.3402525733484874533e-05,
                  -1.9121170389937518131e-06,
                  -0.0904312240489447832781,
                  1.6305991924427923334e-01,
                  2.0001237112941641638e-01,
                  -1.4879148887003382663e-03,
                  3.2470731316462736135e-05,
                  -6.6473404365914134499e-07,
                  2.0447857920168824846e-05,
                  -3.6870296695050991799e-05,
                  -4.5225801045409022233e-05,
                  3.3643990293641665710e-07,
                  -7.3421200200015877329e-09,
                  1.5030635073660743297e-10,
              ],
              [
                  -9.4006130602653794302e-04,
                  7.8681398069163730347e-04,
                  2.4573006857381437217e-04,
                  -1.4524712230452725106e-04,
                  7.8216741353106329551e-05,
                  -3.1304283003914264551e-04,
                  3.6231183382798337611064,
                  -3.0324832476174168328e00,
                  -9.4707559178211142559e-01,
                  5.5980126937492580286e-01,
                  -3.0145747744342332730e-01,
                  1.2065077148806895302e00,
                  -35.17561267504181188315,
                  2.9441339255948005160e01,
                  9.1948319320782125885216,
                  -5.4349184288245195873e00,
                  2.9267472035096449012e00,
                  -1.1713569391233907169e01,
                  34.0275626863976370373166,
                  -2.8480442582712722555e01,
                  -8.8947340548151565542e00,
                  5.2575353623762932642e00,
                  -2.8312249982592527786e00,
                  1.1331265795534763541e01,
                  7.9462158845078978420e-01,
                  -6.6508361863670617531e-01,
                  -2.0771242914526857892e-01,
                  1.2277550230353953542e-01,
                  -6.6115593588420035198e-02,
                  2.6461103043402139923e-01,
              ],
          ]
      )
      # With centering constraint:
      dmatrix_R_cons = np.array(
          [
              [
                  0.00329998606323867252343,
                  1.6537431155796576600e-04,
                  -1.2392262709790753433e-04,
                  6.5405304166706783407e-05,
                  -6.6764045799537624095e-05,
                  -0.1386431081763726258504,
                  0.124297283800864313830,
                  -3.5487293655619825405e-02,
                  -3.0527115315785902268e-03,
                  5.2009247643311604277e-04,
                  -0.00384203992301702674378,
                  -0.058901915802819435064,
                  0.266422358491648914036,
                  0.5739281693874087597607,
                  -1.3171008503525844392e-03,
                  8.2573456631878912413e-04,
                  6.6730833453016958831e-03,
                  -0.1467677784718444955470,
                  0.220757650934837484913,
                  0.1983127687880171796664,
                  -1.6269930328365173316e-03,
                  -1.7785892412241208812e-03,
                  -3.2702835436351201243e-03,
                  -4.3252183044300757109e-02,
                  4.3403766976235179376e-02,
                  3.5973406402893762387e-05,
                  -5.4035858568225075046e-04,
                  2.9565209382794241247e-04,
                  -2.2769990750264097637e-04,
              ],
              [
                  0.41547954838956052681098,
                  1.9843570584107707994e-02,
                  -1.5746590234791378593e-02,
                  8.3171184312221431434e-03,
                  -8.7233014052017516377e-03,
                  -15.9926770785086258541696,
                  16.503663226274017716833,
                  -6.6005803955894726265e-01,
                  1.3986092022708346283e-01,
                  -2.3516913533670955050e-01,
                  0.72251037497207359905360,
                  -9.827337059999853963177,
                  3.917078117294827688255,
                  9.0171773596973618936090,
                  -5.0616811270787671617e00,
                  3.0189990249009683865e00,
                  -1.0872720629943064097e01,
                  26.9308504460453121964747,
                  -21.212262927009287949431,
                  -9.1088328555582247503253,
                  5.2400156972500298025e00,
                  -3.0593641098325474736e00,
                  1.0919392118399086300e01,
                  -4.6564290223265718538e00,
                  4.8071307441606982991e00,
                  -1.9748377005689798924e-01,
                  5.4664183716965096538e-02,
                  -2.8871392916916285148e-02,
                  2.3592766838010845176e-01,
              ],
          ]
      )
      new_x1 = np.array([11.390625, 656.84083557128906250])
      new_x2 = np.array([16.777216000000006346, 1844.6744073709567147])
      new_data = {"x1": new_x1, "x2": new_x2}
      data_chunked = [
          {"x1": x1[:10], "x2": x2[:10]},
          {"x1": x1[10:], "x2": x2[10:]},
      ]
  
      builder = incr_dbuilder(
          "te(cr(x1, df=5), cc(x2, df=6)) - 1",
          lambda: iter(data_chunked),
      )
      dmatrix_nocons = build_design_matrices([builder], new_data)[0]
      assert np.allclose(
          dmatrix_nocons, dmatrix_R_nocons, rtol=1e-12, atol=0.0
      )
  
      builder = incr_dbuilder(
          "te(cr(x1, df=5), cc(x2, df=6), " "constraints='center') - 1",
          lambda: iter(data_chunked),
      )
      dmatrix_cons = build_design_matrices([builder], new_data)[0]
      assert np.allclose(
          dmatrix_cons, dmatrix_R_cons, rtol=1e-12, atol=0.0
      )
  
imports: import numpy
  from patsy.util import have_pandas, atleast_2d_column_default, no_pickling, assert_no_pickling, safe_string_eq
  from patsy.state import stateful_transform
label_desc: Use image node_id 23 for calling a global function with example usage: test_te_2smooths() without return types