code: def get_X_spline(x, knots, n_bases=10, spline_order=3, add_intercept=True):
      
      if len(x.shape) is not 1:
          raise ValueError("x has to be 1 dimentional")
  
      tck = [knots, np.zeros(n_bases), spline_order]
  
      X = np.zeros([len(x), n_bases])
  
      for i in range(n_bases):
          vec = np.zeros(n_bases)
          vec[i] = 1.0
          tck[1] = vec
  
          X[:, i] = si.splev(x, tck, der=0)
  
      if add_intercept is True:
          ones = np.ones_like(X[:, :1])
          X = np.hstack([ones, X])
  
      return X.astype(np.float32)
docs: Returns:
          np.array of shape [len(x), n_bases + (add_intercept)]
  
      # BSpline formula
      https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.BSpline.html#scipy.interpolate.BSpline
  
      Fortran code:
      https://github.com/scipy/scipy/blob/v0.19.0/scipy/interpolate/fitpack/splev.f