def finish(<EOL>self,<EOL>width=<NUM_LIT:1>,<EOL>color=None,<EOL>fill=None,<EOL>roundCap=False,<EOL>dashes=None,<EOL>even_odd=False,<EOL>morph=None,<EOL>closePath=True<EOL>):
if self.draw_cont == "<STR_LIT>":            <EOL><INDENT>return<EOL><DEDENT>color_str = ColorCode(color, "<STR_LIT:c>")  <EOL>fill_str = ColorCode(fill, "<STR_LIT:f>")  <EOL>if width != <NUM_LIT:1>:<EOL><INDENT>self.draw_cont += "<STR_LIT>" % width<EOL><DEDENT>if roundCap:<EOL><INDENT>self.draw_cont += "<STR_LIT>" % (roundCap, roundCap)<EOL><DEDENT>if dashes is not None and len(dashes) > <NUM_LIT:0>:<EOL><INDENT>self.draw_cont += "<STR_LIT>" % dashes<EOL><DEDENT>if closePath:<EOL><INDENT>self.draw_cont += "<STR_LIT>"<EOL>self.lastPoint = None<EOL><DEDENT>if color is not None:<EOL><INDENT>self.draw_cont += color_str<EOL><DEDENT>if fill is not None:<EOL><INDENT>self.draw_cont += fill_str<EOL>if not even_odd:<EOL><INDENT>self.draw_cont += "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>self.draw_cont += "<STR_LIT>"<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.draw_cont += "<STR_LIT>"<EOL><DEDENT>if CheckMorph(morph):<EOL><INDENT>m1 = Matrix(<NUM_LIT:1>, <NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:1>, morph[<NUM_LIT:0>].x + self.x,<EOL>self.height - morph[<NUM_LIT:0>].y - self.y)<EOL>mat = ~m1 * morph[<NUM_LIT:1>] * m1<EOL>self.draw_cont = "<STR_LIT>" % JM_TUPLE(mat) + self.draw_cont<EOL><DEDENT>self.totalcont += "<STR_LIT>" + self.draw_cont + "<STR_LIT>"<EOL>self.draw_cont = "<STR_LIT>"<EOL>self.lastPoint = None<EOL>return<EOL>
Finish the current drawing segment.

        Notes:
            Apply stroke and fill colors, dashes, line style and width, or
            morphing. Also determines whether any open path should be closed
            by a connecting line to its start point.