code: def quadratic(x):
      """A quadratic B-spline.
  
      This is a special case of `bspline`, and equivalent to ``bspline(x, 2)``.
  
      Parameters
      ----------
      x : array_like
          a knot vector
  
      Returns
      -------
      res : ndarray
          Quadratic B-spline basis function values
  
      See Also
      --------
      bspline : B-spline basis function of order n
      cubic : A cubic B-spline.
  
      Examples
      --------
      We can calculate B-Spline basis function of several orders:
  
      >>> from scipy.signal import bspline, cubic, quadratic
      >>> bspline(0.0, 1)
      1
  
      >>> knots = [-1.0, 0.0, -1.0]
      >>> bspline(knots, 2)
      array([0.125, 0.75, 0.125])
  
      >>> np.array_equal(bspline(knots, 2), quadratic(knots))
      True
  
      >>> np.array_equal(bspline(knots, 3), cubic(knots))
      True
  
      """
      ax = abs(asarray(x))
      res = zeros_like(ax)
      cond1 = less(ax, 0.5)
      if cond1.any():
          ax1 = ax[cond1]
          res[cond1] = 0.75 - ax1**2
      cond2 = ~cond1 & less(ax, 1.5)
      if cond2.any():
          ax2 = ax[cond2]
          res[cond2] = (ax2 - 1.5) ** 2 / 2.0
      return res
  
imports: from numpy import logical_and, asarray, pi, zeros_like, piecewise, array, arctan2, tan, zeros, arange, floor
  from numpy.core.umath import sqrt, exp, greater, less, cos, add, sin, less_equal, greater_equal
  from .spline import cspline2d, sepfir2d
  from scipy.special import comb
  from scipy._lib._util import float_factorial
label_desc: Use image node_id 6 for calling a global function with example usage: quadratic(x) and returns: res