'Fetch a batch of data without waiting'

def fetch_batch(self):

    (inp, f) = self.queue.get()
    nr_input_var = len(inp)
    (batched, futures) = ([[] for _ in range(nr_input_var)], [])
    for k in range(nr_input_var):
        batched[k].append(inp[k])
    futures.append(f)
    while (len(futures) < self.batch_size):
        try:
            (inp, f) = self.queue.get_nowait()
            for k in range(nr_input_var):
                batched[k].append(inp[k])
            futures.append(f)
        except queue.Empty:
            break
    return (batched, futures)
