class_docstr: kqueue(2)-based event emitter.
  
  .. ADMONITION:: About ``kqueue(2)`` behavior and this implementation
  
            ``kqueue(2)`` monitors file system events only for
            open descriptors, which means, this emitter does a lot of
            book-keeping behind the scenes to keep track of open
            descriptors for every entry in the monitored directory tree.
  
            This also means the number of maximum open file descriptors
            on your system must be increased **manually**.
            Usually, issuing a call to ``ulimit`` should suffice::
  
                ulimit -n 1024
  
            Ensure that you pick a number that is larger than the
            number of files you expect to be monitored.
  
            ``kqueue(2)`` does not provide enough information about the
            following things:
  
            * The destination path of a file or directory that is renamed.
            * Creation of a file or directory within a directory; in this
              case, ``kqueue(2)`` only indicates a modified event on the
              parent directory.
  
            Therefore, this emitter takes a snapshot of the directory
            tree when ``kqueue(2)`` detects a change on the file system
            to be able to determine the above information.
  
  :param event_queue:
      The event queue to fill with events.
  :param watch:
      A watch object representing the directory to monitor.
  :type watch:
      :class:`watchdog.observers.api.ObservedWatch`
  :param timeout:
      Read events blocking timeout (in seconds).
  :type timeout:
      ``float``
class_docstr_tok: ["kqueue","(","2",")","-based","event","emitter",".","..","ADMONITION",":",":","About","``","kqueue","(","2",")","``","behavior","and","this","implementation","``","kqueue","(","2",")","``","monitors","file","system","events","only","for","open","descriptors",",","which","means",",","this","emitter","does","a","lot","of","book-keeping","behind","the","scenes","to","keep","track","of","open","descriptors","for","every","entry","in","the","monitored","directory","tree",".","This","also","means","the","number","of","maximum","open","file","descriptors","on","your","system","must","be","increased","*","*","manually","*","*",".","Usually",",","issuing","a","call","to","``","ulimit","``","should","suffice",":",":","ulimit","-n","1024","Ensure","that","you","pick","a","number","that","is","larger","than","the","number","of","files","you","expect","to","be","monitored",".","``","kqueue","(","2",")","``","does","not","provide","enough","information","about","the","following","things",":","*","The","destination","path","of","a","file","or","directory","that","is","renamed",".","*","Creation","of","a","file","or","directory","within","a","directory",";","in","this","case",",","``","kqueue","(","2",")","``","only","indicates","a","modified","event","on","the","parent","directory",".","Therefore",",","this","emitter","takes","a","snapshot","of","the","directory","tree","when","``","kqueue","(","2",")","``","detects","a","change","on","the","file","system","to","be","able","to","determine","the","above","information",".",":","param","event_queue",":","The","event","queue","to","fill","with","events",".",":","param","watch",":","A","watch","object","representing","the","directory","to","monitor",".",":","type","watch",":",":","class",":","`","watchdog.observers.api.ObservedWatch","`",":","param","timeout",":","Read","events","blocking","timeout","(","in","seconds",")",".",":","type","timeout",":","``","float","``"]
docstr: Queues events from the kevent list returned from the call to
  :meth:`select.kqueue.control`.
  
  .. NOTE:: Queues only the deletions, file modifications,
            attribute modifications. The other events, namely,
            file creation, directory modification, file rename,
            directory rename, directory creation, etc. are
            determined by comparing directory snapshots.
docstr_tok: ["Queues","events","from","the","kevent","list","returned","from","the","call","to",":","meth",":","`","select.kqueue.control","`",".","..","NOTE",":",":","Queues","only","the","deletions",",","file","modifications",",","attribute","modifications",".","The","other","events",",","namely",",","file","creation",",","directory","modification",",","file","rename",",","directory","rename",",","directory","creation",",","etc",".","are","determined","by","comparing","directory","snapshots","."]
code: def _queue_events_except_renames_and_dir_modifications(
      self, event_list
  ):
      """
      Queues events from the kevent list returned from the call to
      :meth:`select.kqueue.control`.
  
      .. NOTE:: Queues only the deletions, file modifications,
                attribute modifications. The other events, namely,
                file creation, directory modification, file rename,
                directory rename, directory creation, etc. are
                determined by comparing directory snapshots.
      """
      files_renamed = set()
      dirs_renamed = set()
      dirs_modified = set()
  
      for kev in event_list:
          descriptor = self._descriptors.get_for_fd(kev.ident)
          src_path = descriptor.path
  
          if is_deleted(kev):
              if descriptor.is_directory:
                  self.queue_event(DirDeletedEvent(src_path))
              else:
                  self.queue_event(FileDeletedEvent(src_path))
          elif is_attrib_modified(kev):
              if descriptor.is_directory:
                  self.queue_event(DirModifiedEvent(src_path))
              else:
                  self.queue_event(FileModifiedEvent(src_path))
          elif is_modified(kev):
              if descriptor.is_directory:
                  # When a directory is modified, it may be due to
                  # sub-file/directory renames or new file/directory
                  # creation. We determine all this by comparing
                  # snapshots later.
                  dirs_modified.add(src_path)
              else:
                  self.queue_event(FileModifiedEvent(src_path))
          elif is_renamed(kev):
              # Kqueue does not specify the destination names for renames
              # to, so we have to process these after taking a snapshot
              # of the directory.
              if descriptor.is_directory:
                  dirs_renamed.add(src_path)
              else:
                  files_renamed.add(src_path)
      return files_renamed, dirs_renamed, dirs_modified
  
imports: from __future__ import with_statement
  from wandb_watchdog.utils import platform
  import threading
  import errno
  import sys
  import stat
  import os
  from wandb_watchdog.observers.api import BaseObserver, EventEmitter, DEFAULT_OBSERVER_TIMEOUT, DEFAULT_EMITTER_TIMEOUT
  from wandb_watchdog.utils.dirsnapshot import DirectorySnapshot
  from wandb_watchdog.events import DirMovedEvent, DirDeletedEvent, DirCreatedEvent, DirModifiedEvent, FileMovedEvent, FileDeletedEvent, FileCreatedEvent, FileModifiedEvent, EVENT_TYPE_MOVED, EVENT_TYPE_DELETED, EVENT_TYPE_CREATED
label_desc: Use image node_id 6 for calling the KqueueEmitter obj's underlying member method code with example usage: obj._queue_events_except_renames_and_dir_modifications(event_list) and returns: files_renamed,  dirs_renamed,  dirs_modified