def drawPatch(self, pos, turn, invert, type, draw, size, foreColor, backColor):
        path = self.PATH_SET[type]
        if not path:
            # blank patch
            invert = not invert
            path = [(0., 0.), (1., 0.), (1., 1.), (0., 1.), (0., 0.)]
        patch = ImagePath.Path(path)
        if invert:
            foreColor, backColor = backColor, foreColor

        mat = Matrix2D.rotateSquare(turn, pivot=(0.5, 0.5)) * \
              Matrix2D.translate(*pos) * \
              Matrix2D.scale(size, size)

        patch.transform(mat.for_PIL())
        draw.rectangle(
            (pos[0] * size, pos[1] * size, (pos[0] + 1) * size, (pos[1] + 1) * size), fill=backColor)
        draw.polygon(patch, fill=foreColor, outline=foreColor)

    # virtual functions
Return a generator of extensions
dataset/ETHPy150Open treeio/treeio/treeio/identities/identicon.py/IdenticonRendererBase.drawPatch--crossover with--dataset/ETHPy150Open openstack/python-openstacksdk/openstack/network/v2/_proxy.py/Proxy.extensions