code: def run(self):
      while True:
          input_npy = np.zeros(
              self._batch_size,
              dtype=[
                  ("user_id_input", np.int32),
                  ("item_id_input", np.int32),
                  ("labels", np.float32),
              ],
          )
  
          if self._state + self._num_pos >= len(self._dataset.data):
              if not self._chronological:
                  self._state = 0
                  self._dataset.shuffle()
              else:
                  break
  
          for ind in range(self._num_pos):
              entry = self._dataset.data[self._state + ind]
              input_npy[ind] = (entry["user_id"], entry["item_id"], 1.0)
  
          for ind in range(self._batch_size - self._num_pos):
              user_ind = int(
                  random.random() * (len(self._user_list) - 1)
              )
              user_id = self._user_list[user_ind]
              neg_id = int(
                  random.random() * (self._dataset.max_item() - 1)
              )
  
              while (
                  neg_id
                  in self._dataset.get_interactions_by_user_gb_item(
                      user_id
                  )
              ):
                  neg_id = int(
                      random.random() * (self._dataset.max_item() - 1)
                  )
              input_npy[ind + self._num_pos] = (user_id, neg_id, 0.0)
  
          self._state += self._num_pos
          self._q.put(input_npy, block=True)
  
file_path: openrec/openrec/tf1/legacy/utils/samplers/pointwise_sampler.py
imports: import numpy
  import random
  from multiprocessing import Process
  from openrec.tf1.legacy.utils.samplers import Sampler
label_desc: Use image node_id 2 for calling the _PointwiseSampler obj's underlying member method code with example usage: obj.run() without return types