'Evaluate a particular basis element of the BSpline,
or its derivative.
INPUTS:
x  -- x values at which to evaluate the basis element
i  -- which element of the BSpline to return
d  -- the order of derivative
OUTPUTS: y
y  -- value of d-th derivative of the i-th basis element
of the BSpline at specified x values'

def basis_element(self, x, i, d=0):

    x = np.asarray(x, np.float64)
    _shape = x.shape
    if (_shape == ()):
        x.shape = (1,)
    x.shape = (np.product(_shape, axis=0),)
    if (i < (self.tau.shape[0] - 1)):
        v = _hbspline.evaluate(x, self.tau, self.m, d, i, (i + 1))
    else:
        return np.zeros(x.shape, np.float64)
    if (i == (self.tau.shape[0] - self.m)):
        v = np.where(np.equal(x, self.tau[(-1)]), 1, v)
    v.shape = _shape
    return v
