class_docstr: Sampler object that creates an iterator for feeding batch data while training.
  
  Attributes:
      User: dict, all the users (keys) with items as values
      usernum: integer, total number of users
      itemnum: integer, total number of items
      batch_size (int): batch size
      maxlen (int): maximum input sequence length
      n_workers (int): number of workers for parallel execution
code: def __init__(
      self,
      User,
      usernum,
      itemnum,
      batch_size=64,
      maxlen=10,
      n_workers=1,
  ):
      self.result_queue = Queue(maxsize=n_workers * 10)
      self.processors = []
      for i in range(n_workers):
          self.processors.append(
              Process(
                  target=sample_function,
                  args=(
                      User,
                      usernum,
                      itemnum,
                      batch_size,
                      maxlen,
                      self.result_queue,
                      np.random.randint(2e9),
                  ),
              )
          )
          self.processors[-1].daemon = True
          self.processors[-1].start()
  
file_path: recommenders/recommenders/models/sasrec/sampler.py
imports: import numpy
  from multiprocessing import Process, Queue
label_desc: Use image node_id 1 to create a new WarpSampler object from inherited base classes: object with example: obj = WarpSampler(User, usernum, itemnum, batch_size, maxlen, n_workers)