class_docstr: Base class to enqueue inputs.
  
  The task of an Enqueuer is to use parallelism to speed up preprocessing.
  This is done with processes or threads.
  
  Example:
  
  ```python
      enqueuer = PyDatasetEnqueuer(...)
      enqueuer.start()
      datas = enqueuer.get()
      for data in datas:
          # Use the inputs; training, evaluating, predicting.
          # ... stop sometime.
      enqueuer.stop()
  ```
  
  The `enqueuer.get()` should be an infinite stream of data.
code: def __init__(self, py_dataset, use_multiprocessing=False):
      self.py_dataset = py_dataset
      self.use_multiprocessing = use_multiprocessing
  
      global _SEQUENCE_COUNTER
      if _SEQUENCE_COUNTER is None:
          try:
              _SEQUENCE_COUNTER = multiprocessing.Value("i", 0)
          except OSError:
              # In this case the OS does not allow us to use
              # multiprocessing. We resort to an int
              # for enqueuer indexing.
              _SEQUENCE_COUNTER = 0
  
      if isinstance(_SEQUENCE_COUNTER, int):
          self.uid = _SEQUENCE_COUNTER
          _SEQUENCE_COUNTER += 1
      else:
          # Doing Multiprocessing.Value += x is not process-safe.
          with _SEQUENCE_COUNTER.get_lock():
              self.uid = _SEQUENCE_COUNTER.value
              _SEQUENCE_COUNTER.value += 1
  
      self.workers = 0
      self.executor_fn = None
      self.queue = None
      self.run_thread = None
      self.stop_signal = None
  
imports: import multiprocessing.dummy
  import queue
  import random
  import threading
  import time
  import warnings
  import weakref
  from contextlib import closing
  import numpy
  import tree
  from keras.api_export import keras_export
  from keras.trainers.data_adapters import data_adapter_utils
  from keras.trainers.data_adapters.data_adapter import DataAdapter
label_desc: Use image node_id 1 to create a new PyDatasetEnqueuer object  with example: obj = PyDatasetEnqueuer(py_dataset, use_multiprocessing)