def METHOD_NAME(self, buff):
    # do writing of init
    inits = getInitVals(self.params)
    inits['depth'] = -self.getPosInRoutine()
    # additional substitutions
    if self.params['units'].val == 'from exp settings':
        inits['units'].val = None
    if self.params['shape'] == 'regular polygon...':
        inits['vertices'] = self.params['nVertices']
    elif self.params['shape'] != 'custom polygon...':
        inits['vertices'] = self.params['shape']
    code = (
        "%(name)s = visual.Aperture(\n"
    )
    buff.writeIndentedLines(code % inits)
    buff.setIndentLevel(1, relative=True)
    code = (
            "win=win, name='%(name)s',\n"
            "units=%(units)s, size=%(size)s, pos=%(pos)s, ori=%(ori)s,\n"
            "shape=%(vertices)s, anchor=%(anchor)s\n,"
            "depth=%(depth)s\n"
    )
    buff.writeIndentedLines(code % inits)
    buff.setIndentLevel(-1, relative=True)
    code = (
            ")\n"
            "%(name)s.disable()  # disable until its actually used\n"
    )
    buff.writeIndentedLines(code % inits)