code: def purgeLayout(self):
          
          uids = map(api.get_uid, self.getAnalyses())
          layout = filter(lambda slot: slot.get("analysis_uid", None) in uids,
                          self.getLayout())
          self.setLayout(layout)
docs: Purges the layout of not assigned analyses