human
I am working on the file "FP-Bezier-Bspline.ipynb".
The first task is:
map(lambda s: deCasteljauF(b,s),  map(lambda j: j*1.0/(nr-1), xrange(nr)) means that the function
     deCasteljauF with fixed list of control points, b, and the variable parameter s is mapped to the list
     of  parameters $t_j$ defined above. Instead of defining the list of parameters through comprehension [j*1.0/(nr-1) for j in xrange(nr)]
     we created it calling the  higher order function map:
map(lambda j: j*1.0/(nr-1), xrange(nr))
Obvioulsly the FP versions of de Casteljau algorithm   and BezCurve are more compact
than the corresponding imperative versions, but they are not quite readable at the first sight.
To choose interactively the control points of a B&eacute;zier curve (and later of a B-spline curve) and  to plot the curve, we set now  the matplotlib nbagg backend, and  define the class BuildB, below:
Can you write Python code for it?
 ... Write me a the Python code you requested?
assistant
#Here is the Python code you requested.

%matplotlib notebook

import matplotlib.pyplot as plt

def Curve_plot(ctrl, func):
    # plot the control polygon and the corresponding curve discretized by the function func
    xc, yc = zip(*func(ctrl))
    xd, yd = zip(*ctrl)
    plt.plot(xd,yd , 'bo-', xc,yc, 'r') 

class BuildB(object): #Build a Bezier/B-spline Curve
    
    def __init__(self, xlims=[0,1], ylims=[0,1], func=BezCurve):
        self.ctrl=[]     # list of control points
        self.xlims=xlims # limits for x coordinate of control points
        self.ylims=ylims # limits for y coordinate
        self.func=func   # func - function that discretizes a curve defined by the control polygon ctrl
        
    def callback(self, event):  #select control points with  left  mouse button click
        if event.button==1 and event.inaxes:
            x,y = event.xdata,event.ydata
            self.ctrl.append((x,y))  
            plt.plot(x, y,  'bo') 
       
        elif event.button==3:  #press right  button to plot the curve
            Curve_plot(self.ctrl, self.func) 
            plt.draw() 
            
        else: pass
        
    def B_ax(self):#define axes lims

        fig = plt.figure(figsize=(6, 5))
        ax = fig.add_subplot(111)
        ax.set_xlim(self.xlims)
        ax.set_ylim(self.ylims)
        ax.grid('on')   
        ax.set_autoscale_on(False)
        fig.canvas.mpl_connect('button_press_event', self.callback)