'Stamp a copy of the turtleshape onto the canvas and return its id.
No argument.
Stamp a copy of the turtle shape onto the canvas at the current
turtle position. Return a stamp_id for that stamp, which can be
used to delete it by calling clearstamp(stamp_id).
Example (for a Turtle instance named turtle):
>>> turtle.color("blue")
>>> turtle.stamp()
13
>>> turtle.fd(50)'

def stamp(self):

    screen = self.screen
    shape = screen._shapes[self.turtle.shapeIndex]
    ttype = shape._type
    tshape = shape._data
    if (ttype == 'polygon'):
        stitem = screen._createpoly()
        if (self._resizemode == 'noresize'):
            w = 1
            shape = tshape
        else:
            if (self._resizemode == 'auto'):
                lx = ly = max(1, (self._pensize / 5.0))
                w = self._pensize
                tiltangle = 0
            elif (self._resizemode == 'user'):
                (lx, ly) = self._stretchfactor
                w = self._outlinewidth
                tiltangle = self._tilt
            shape = [((lx * x), (ly * y)) for (x, y) in tshape]
            (t0, t1) = (math.sin(tiltangle), math.cos(tiltangle))
            shape = [(((t1 * x) + (t0 * y)), (((- t0) * x) + (t1 * y))) for (x, y) in shape]
        shape = self._polytrafo(shape)
        (fc, oc) = (self._fillcolor, self._pencolor)
        screen._drawpoly(stitem, shape, fill=fc, outline=oc, width=w, top=True)
    elif (ttype == 'image'):
        stitem = screen._createimage('')
        screen._drawimage(stitem, self._position, tshape)
    elif (ttype == 'compound'):
        stitem = []
        for element in tshape:
            item = screen._createpoly()
            stitem.append(item)
        stitem = tuple(stitem)
        (lx, ly) = self._stretchfactor
        w = self._outlinewidth
        for (item, (poly, fc, oc)) in zip(stitem, tshape):
            poly = [((lx * x), (ly * y)) for (x, y) in poly]
            poly = self._polytrafo(poly)
            screen._drawpoly(item, poly, fill=self._cc(fc), outline=self._cc(oc), width=w, top=True)
    self.stampItems.append(stitem)
    self.undobuffer.push(('stamp', stitem))
    return stitem
