def crop_bezier(seg, t0, t1):
assert t0 < t1<EOL>if t0 == <NUM_LIT:0>:<EOL><INDENT>cropped_seg = seg.split(t1)[<NUM_LIT:0>]<EOL><DEDENT>elif t1 == <NUM_LIT:1>:<EOL><INDENT>cropped_seg = seg.split(t0)[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>pt1 = seg.point(t1)<EOL>trimmed_seg = crop_bezier(seg, t0, <NUM_LIT:1>)<EOL>t1_adj = trimmed_seg.radialrange(pt1)[<NUM_LIT:0>][<NUM_LIT:1>]<EOL>cropped_seg = crop_bezier(trimmed_seg, <NUM_LIT:0>, t1_adj)<EOL><DEDENT>return cropped_seg<EOL>
returns a cropped copy of this segment which starts at self.point(t0)
    and ends at self.point(t1).