code: def _build_enqueuer(
      sequence: tf.keras.utils.Sequence,
      workers: int,
      use_multiprocessing: bool,
      max_queue_size: int,
      shard_rank: int,
      num_shards: int,
      repeat: bool,
      shuffle: bool,
      shuffle_seed: int,
      prior_batches_trained: int,
  ) -> _Enqueuer:
      sampler = _Sampler(
          len(sequence),
          shard_rank,
          num_shards,
          shuffle,
          shuffle_seed,
          prior_batches_trained,
      )
      if workers < 1:
          return _WorkerlessEnqueuer(sequence, sampler, repeat)
      enqueuer_cls = (
          _MultiprocessingEnqueuer
          if use_multiprocessing
          else _ThreadingEnqueuer
      )
      return enqueuer_cls(
          sequence, sampler, repeat, workers, max_queue_size
      )
  
imports: import abc
  import collections
  import multiprocessing
  import multiprocessing.queues
  import queue
  import threading
  from typing import Any, Deque, Dict, Iterator, Optional, Type, Union
  import numpy
  import tensorflow
  from determined.common import check
label_desc: Use image node_id 2 for calling a global function with example usage: _build_enqueuer(sequence, workers, use_multiprocessing, max_queue_size, shard_rank, num_shards, repeat, shuffle, shuffle_seed, prior_batches_trained) and returns: enqueuer_cls, _WorkerlessEnqueuer