code: def run(self):
      with self._wait_condition:
          if not self._is_interrupted():
              self._state = Daemon.DaemonState.WORKING
      try:
          while not self._is_interrupted():
              with self._wait_condition:
                  if self._state == Daemon.DaemonState.PAUSING:
                      self._state = Daemon.DaemonState.PAUSED
                      self._wait_condition.notify_all()
                      self._wait_condition.wait_for(
                          lambda: self._state
                          != Daemon.DaemonState.PAUSED
                      )
  
              if self._state == Daemon.DaemonState.WORKING:
                  self.work()
                  with self._wait_condition:
                      if (
                          self._sleep_time > 0
                          and self._state == Daemon.DaemonState.WORKING
                      ):
                          self._wait_condition.wait(
                              timeout=self._sleep_time
                          )
      finally:
          with self._wait_condition:
              self._state = Daemon.DaemonState.STOPPED
              self._wait_condition.notify_all()
  
file_path: neptune-client/src/neptune/internal/threading/daemon.py
imports: import abc
  import functools
  import threading
  from enum import Enum
  from neptune.common.exceptions import NeptuneConnectionLostException
  from neptune.internal.utils.logger import logger
label_desc: Use image node_id 9 for calling the Daemon obj's underlying member method code with example usage: obj.run() without return types