code: def toggle_object_status(self, objname):
          
          o = getattr(self.system, objname)
          o.status = not o.status
          self.system.flush()
          return o.status
docs: Toggle boolean-valued sensor status between ``True`` and ``False``.