code: def bspline(x, n):
      """B-spline basis function of order n.
  
      Notes
      -----
      Uses numpy.piecewise and automatic function-generator.
  
      """
      ax = -abs(asarray(x))
      # number of pieces on the left-side is (n+1)/2
      funclist, condfuncs = _bspline_piecefunctions(n)
      condlist = [func(ax) for func in condfuncs]
      return piecewise(ax, condlist, funclist)
  
imports: from __future__ import division, print_function, absolute_import
  from scipy._lib.six import xrange
  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, gamma
label_desc: Use image node_id 4 for calling a global function with example usage: bspline(x, n) and returns: piecewise