code: def _get_batch_requests(self, timeout=None):
          
          reqs = []
          s = time()
          while len(reqs) < self.batch_size and (time() - s) < timeout:
              try:
                  req = self.queue.get(block=False)
                  self.queue.task_done()
  
                  reqs.append(req)
              except Empty as ex:
                  if self.stop_flag:
                      break
                  else:
                      sleep(0.1)
  
          if not reqs:
              raise Empty
          elif len(reqs) <= 1:
              return reqs[0]
          else:
              logitems = []
              req = reqs[0]
              for req in reqs:
                  logitems.extend(req.get_log_items())
  
              ret = PutLogsRequest(self.project, self.log_store, req.topic, logitems=logitems)
              ret.__record__ = req.__record__
  
              return ret
docs: try to get request as fast as possible, once empty and stop falg or time-out, just return Empty