def run_clean(self):

        def cleanup_smoke(svc, list_method=None, *list_params):
            list_method = list_method or "list"
            mthd = getattr(svc, list_method)
            try:
                svcname = svc.name
            except AttributeError:
                svcname = svc % "%s"
            try:
                ents = [ent for ent in mthd(*list_params)
                        if ent.name.startswith("SMOKE")]
            except Exception as e:
                self.logit("Error listing for service", svcname)
                self.logit("  Exception:", e)
                return
            if ents:
                try:
                    ent.delete()
                    self.logit("Deleting", svcname, "resource", ent.id)
                except Exception as e:
                    self.logit("Error deleting", svcname, "resource", ent.id)
                    self.logit("  Exception:", e)
            else:
                self.logit("No smoketest resources found in region",
                        self.region, "for service", svcname)

        cleanup_smoke(self.cnw)
        cleanup_smoke(self.cs)
        cleanup_smoke(self.cdb)
        cleanup_smoke(self.cf, "list_container_objects", "SMOKETEST_CONTAINER")
        cleanup_smoke(self.cf)
        cleanup_smoke(self.clb)
        cleanup_smoke(self.dns, "list_records", "SMOKETEST.example.edu")
        cleanup_smoke(self.dns)
        cleanup_smoke(self.cmn, "list_checks", "SMOKETEST_entity")
        cleanup_smoke(self.cmn, "list_entities")
        cleanup_smoke(self.cmn, "list_notifications")
        cleanup_smoke(self.cmn, "list_notification_plans")
        cleanup_smoke(self.cmn, "list_alarms", "SMOKETEST_entity")
        cleanup_smoke(self.cbs)
        return
dataset/ETHPy150Open rackspace/pyrax/tests/integrated/smoketest.py/SmokeTester.run_clean/swapped operands of `%`