def fit(function, x, y):
 p0 = [guess_plateau(x, y), 4.0, guess_lag(x, y), 0.1, min(y)]
 (params, pcov) = curve_fit(function, x, y, p0=p0)
 return (params, pcov)

def fit ( function , x , y ) : p0 = [ guess_plateau ( x , y ) , 4.0 , guess_lag ( x , y ) , 0.1 , min ( y ) ] ( params , pcov ) = curve_fit ( function , x , y , p0 = p0 ) return ( params , pcov )
fit the provided functrion to the x and y values .