def addBlock(self, start, end, widgets=[]):

        lb = survey_LayoutBlocks()
        lb.setPosn(start, end)
        lb.setWidgets(widgets)
        length = len(self.contains)
        temp = []
        if length > 0 and self.contains[length - 1].startPosn == start:
            lb.contains.append(self.contains.pop())
        for element in self.temp:
            if element.startPosn[0] < start[0] or element.startPosn[1] < start[1]:
                temp.append(element)
            else:
                lb.contains.append(element)
        self.temp = []
        for element in temp:
            self.temp.append(element)
        if self.temp != []:
            self.temp.append(lb)
        else:
            self.contains.append(lb)

    # -------------------------------------------------------------------------
write variable declarations at the top of a function.
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/survey_LayoutBlocks.addBlock--crossover with--dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/mako/codegen.py/_GenerateRenderMethod.write_variable_declares