class_docstr: A wrapper for `Inotify` that holds events for `delay` seconds. During
  this time, IN_MOVED_FROM and IN_MOVED_TO events are paired.
docstr: Read event from `inotify` and add them to `queue`. When reading a
  IN_MOVE_TO event, remove the previous added matching IN_MOVE_FROM event
  and add them back to the queue as a tuple.
docstr_tok: ["Read","event","from","`","inotify","`","and","add","them","to","`","queue","`",".","When","reading","a","IN_MOVE_TO","event",",","remove","the","previous","added","matching","IN_MOVE_FROM","event","and","add","them","back","to","the","queue","as","a","tuple","."]
code: def run(self):
      """Read event from `inotify` and add them to `queue`. When reading a
      IN_MOVE_TO event, remove the previous added matching IN_MOVE_FROM event
      and add them back to the queue as a tuple.
      """
      deleted_self = False
      while self.should_keep_running() and not deleted_self:
          inotify_events = self._inotify.read_events()
          for inotify_event in inotify_events:
              logger.debug("in-event %s", inotify_event)
              if inotify_event.is_moved_to:
  
                  def matching_from_event(event):
                      return (
                          not isinstance(event, tuple)
                          and event.is_moved_from
                          and event.cookie == inotify_event.cookie
                      )
  
                  from_event = self._queue.remove(matching_from_event)
                  if from_event is not None:
                      self._queue.put((from_event, inotify_event))
                  else:
                      logger.debug(
                          "could not find matching move_from event"
                      )
                      self._queue.put(inotify_event)
              else:
                  self._queue.put(inotify_event)
  
              if (
                  inotify_event.is_delete_self
                  and inotify_event.src_path == self._inotify.path
              ):
                  # Deleted the watched directory, stop watching for events
                  deleted_self = True
  
file_path: wandb/wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/inotify_buffer.py
imports: import logging
  from wandb_watchdog.utils import BaseThread
  from wandb_watchdog.utils.delayed_queue import DelayedQueue
  from wandb_watchdog.observers.inotify_c import Inotify
label_desc: Use image node_id 5 for calling the InotifyBuffer obj's underlying member method code with example usage: obj.run() and returns: unknown