code: def test_spline_transformer_periodic_spline_backport():
      """Test that the backport of extrapolate="periodic" works correctly"""
      X = np.linspace(-2, 3.5, 10)[:, None]
      degree = 2
  
      # Use periodic extrapolation backport in SplineTransformer
      transformer = SplineTransformer(
          degree=degree,
          extrapolation="periodic",
          knots=[[-1.0], [0.0], [1.0]],
      )
      Xt = transformer.fit_transform(X)
  
      # Use periodic extrapolation in BSpline
      coef = np.array([[1.0, 0.0], [0.0, 1.0], [1.0, 0.0], [0.0, 1.0]])
      spl = BSpline(np.arange(-3, 4), coef, degree, "periodic")
      Xspl = spl(X[:, 0])
      assert_allclose(Xt, Xspl)
  
imports: import sys
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import sparse
  from scipy.interpolate import BSpline
  from scipy.sparse import random
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import KBinsDiscretizer, PolynomialFeatures, SplineTransformer
  from sklearn.preprocessing._csr_polynomial_expansion import _calc_expanded_nnz, _calc_total_nnz, _get_sizeof_LARGEST_INT_t
  from sklearn.utils._testing import assert_array_almost_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS, parse_version, sp_version
label_desc: Use image node_id 10 for calling a global function with example usage: test_spline_transformer_periodic_spline_backport() without return types