code: def test_crs_with_specific_constraint():
      from patsy.highlevel import (
          incr_dbuilder,
          build_design_matrices,
          dmatrix,
      )
  
      x = (-1.5) ** np.arange(20)
      # Hard coded R values for smooth: s(x, bs="cr", k=5)
      # R> knots <- smooth$xp
      knots_R = np.array(
          [
              -2216.837820053100585937,
              -50.456909179687500000,
              -0.250000000000000000,
              33.637939453125000000,
              1477.891880035400390625,
          ]
      )
      # R> centering.constraint <- t(qr.X(attr(smooth, "qrc")))
      centering_constraint_R = np.array(
          [
              [
                  0.064910676323168478574,
                  1.4519875239407085132,
                  -2.1947446912471946234,
                  1.6129783104357671153,
                  0.064868180547550072235,
              ]
          ]
      )
      # values for which we want a prediction
      new_x = np.array([-3000.0, -200.0, 300.0, 2000.0])
      result1 = dmatrix(
          "cr(new_x, knots=knots_R[1:-1], "
          "lower_bound=knots_R[0], upper_bound=knots_R[-1], "
          "constraints=centering_constraint_R)"
      )
  
      data_chunked = [{"x": x[:10]}, {"x": x[10:]}]
      new_data = {"x": new_x}
      builder = incr_dbuilder(
          "cr(x, df=4, constraints='center')",
          lambda: iter(data_chunked),
      )
      result2 = build_design_matrices([builder], new_data)[0]
  
      assert np.allclose(result1, result2, 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 20 for calling a global function with example usage: test_crs_with_specific_constraint() without return types