def smooth(polylines):
for c in polylines:<EOL><INDENT>if len(c) < <NUM_LIT:9>:<EOL><INDENT>continue<EOL><DEDENT>x = c[:, <NUM_LIT:0>]<EOL>y = c[:, <NUM_LIT:1>]<EOL>t = np.arange(x.shape[<NUM_LIT:0>], dtype=float)<EOL>t /= t[-<NUM_LIT:1>]<EOL>x = UnivariateSpline(t, x)(t)<EOL>y = UnivariateSpline(t, y)(t)<EOL>c[:, <NUM_LIT:0>] = x<EOL>c[:, <NUM_LIT:1>] = y<EOL><DEDENT>
smooth every polyline using spline interpolation