class_docstr: Initializes structures necessary for a worker process to receive,
  compute and send back tasks.
class_docstr_tok: ["Initializes","structures","necessary","for","a","worker","process","to","receive",",","compute","and","send","back","tasks","."]
docstr: Returns scheduled task and shm_chunk where results should be placed
docstr_tok: ["Returns","scheduled","task","and","shm_chunk","where","results","should","be","placed"]
code: def get_task(
      self,
  ) -> Tuple[Optional[ScheduledTask], Optional[BufShmChunk]]:
      """
      Returns scheduled task and shm_chunk where results should be placed
      """
      scheduled_meta = self.task_receiver.get_task()
      if scheduled_meta is None:
          return None, None
      shm_chunk = self.shm_chunks[scheduled_meta.shm_chunk_id]
      scheduled = read_shm_message(shm_chunk, scheduled_meta)
      return scheduled, shm_chunk
  
imports: from typing import List, Optional, Tuple
  import threading
  import traceback
  import socket
  from collections import deque
  from multiprocessing import reduction
  from nvidia.dali._utils.external_source_impl import SourceKind, _is_generator_function
  from nvidia.dali._multiproc.shared_batch import SharedBatchWriter, SharedBatchMeta, BufShmChunk, assert_valid_data_type, read_shm_message, write_shm_message
  from nvidia.dali._multiproc.messages import CompletedTask, WorkerArgs, ShmMessageDesc, ScheduledTask
  from nvidia.dali._multiproc.shared_queue import Dispatcher
label_desc: Use image node_id 5 for calling the WorkerContext obj's underlying member method code with example usage: obj.get_task() and returns: scheduled,  shm_chunk, None,  None