class_docstr: Thread-safe implementation of an special queue where a
  put of the last-item put'd will be dropped.
  
  The implementation leverages locking already implemented in the base class
  redefining only the primitives.
  
  Queued items must be immutable and hashable so that they can be used
  as dictionary keys. You must implement **only read-only properties** and
  the :meth:`Item.__hash__()`, :meth:`Item.__eq__()`, and
  :meth:`Item.__ne__()` methods for items to be hashable.
  
  An example implementation follows::
  
      class Item(object):
          def __init__(self, a, b):
              self._a = a
              self._b = b
  
          @property
          def a(self):
              return self._a
  
          @property
          def b(self):
              return self._b
  
          def _key(self):
              return (self._a, self._b)
  
          def __eq__(self, item):
              return self._key() == item._key()
  
          def __ne__(self, item):
              return self._key() != item._key()
  
          def __hash__(self):
              return hash(self._key())
  
  based on the OrderedSetQueue below
class_docstr_tok: ["Thread-safe","implementation","of","an","special","queue","where","a","put","of","the","last-item","put","'d","will","be","dropped",".","The","implementation","leverages","locking","already","implemented","in","the","base","class","redefining","only","the","primitives",".","Queued","items","must","be","immutable","and","hashable","so","that","they","can","be","used","as","dictionary","keys",".","You","must","implement","*","*","only","read-only","properties","*","*","and","the",":","meth",":","`","Item.__hash__","(",")","`",",",":","meth",":","`","Item.__eq__","(",")","`",",","and",":","meth",":","`","Item.__ne__","(",")","`","methods","for","items","to","be","hashable",".","An","example","implementation","follows",":",":","class","Item","(","object",")",":","def","__init__","(","self",",","a",",","b",")",":","self._a","=","a","self._b","=","b","@","property","def","a","(","self",")",":","return","self._a","@","property","def","b","(","self",")",":","return","self._b","def","_key","(","self",")",":","return","(","self._a",",","self._b",")","def","__eq__","(","self",",","item",")",":","return","self._key","(",")","==","item._key","(",")","def","__ne__","(","self",",","item",")",":","return","self._key","(",")","!","=","item._key","(",")","def","__hash__","(","self",")",":","return","hash","(","self._key","(",")",")","based","on","the","OrderedSetQueue","below"]
code: def _put(self, item):
      if item != self._last_item:
          queue.Queue._put(self, item)
          self._last_item = item
      else:
          # `put` increments `unfinished_tasks` even if we did not put
          # anything into the queue here
          self.unfinished_tasks -= 1
  
file_path: wandb/wandb/vendor/watchdog_0_9_0/wandb_watchdog/utils/bricks.py
imports: import sys
  from collections.abc import MutableSet
  from .compat import queue
label_desc: Use image node_id 2 for calling the SkipRepeatsQueue obj's underlying member method code with example usage: obj._put(item) without return types