def _fit_edges_polyfit(x, window_length, polyorder, deriv, delta, axis, y):
 halflen = (window_length // 2)
 _fit_edge(x, 0, window_length, 0, halflen, axis, polyorder, deriv, delta, y)
 n = x.shape[axis]
 _fit_edge(x, (n - window_length), n, (n - halflen), n, axis, polyorder, deriv, delta, y)

def _fit_edges_polyfit ( x , window_length , polyorder , deriv , delta , axis , y ) : halflen = ( window_length // 2 ) _fit_edge ( x , 0 , window_length , 0 , halflen , axis , polyorder , deriv , delta , y ) n = x . shape [ axis ] _fit_edge ( x , ( n - window_length ) , n , ( n - halflen ) , n , axis , polyorder , deriv , delta , y )
use polynomial interpolation of x at the low and high ends of the axis to fill in the halflen values in y .