class_docstr: A thread-safe queue implementation for multiple producers and consumers.
  
  Provide `release()` to exit producer threads cooperatively for resource release.
docstr: Put an item into the queue.
  
  Block if necessary until a free slot is available in queue.
  This method is called by producer threads.
  
  Returns:
      True if the caller thread should exit immediately.
docstr_tok: ["Put","an","item","into","the","queue",".","Block","if","necessary","until","a","free","slot","is","available","in","queue",".","This","method","is","called","by","producer","threads",".","Returns",":","True","if","the","caller","thread","should","exit","immediately","."]
code: def put(self, item: Any) -> bool:
      """Put an item into the queue.
  
      Block if necessary until a free slot is available in queue.
      This method is called by producer threads.
  
      Returns:
          True if the caller thread should exit immediately.
      """
      self._producer_semaphore.acquire()
      with self._mutex:
          if self._threads_exit:
              return True
          else:
              self._queue.append(item)
      self._consumer_semaphore.release()
      return False
  
imports: import importlib
  import logging
  import os
  import pathlib
  import random
  import sys
  import threading
  import time
  import urllib.parse
  from collections import deque
  from types import ModuleType
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union
  import numpy
  import ray
  from ray._private.utils import _get_pyarrow_version
  from ray.data._internal.arrow_ops.transform_pyarrow import unify_schemas
  from ray.data.context import WARN_PREFIX, DataContext
label_desc: Use image node_id 2 for calling the Queue obj's underlying member method code with example usage: obj.put(item) and returns: False, True