class_docstr: Object to encapsulate the code related to handle the data requests passing to executor and its returned values
class_docstr_tok: ["Object","to","encapsulate","the","code","related","to","handle","the","data","requests","passing","to","executor","and","its","returned","values"]
docstr: Returns a docs matrix from a list of DataRequest objects.
  
  :param requests: List of DataRequest objects
  :return: docs matrix and doc: list of DocumentArray objects
docstr_tok: ["Returns","a","docs","matrix","from","a","list","of","DataRequest","objects",".",":","param","requests",":","List","of","DataRequest","objects",":","return",":","docs","matrix","and","doc",":","list","of","DocumentArray","objects"]
code: def _get_docs_matrix_from_request(
      requests: List["DataRequest"],
  ) -> Tuple[
      Optional[List["DocumentArray"]],
      Optional[Dict[str, "DocumentArray"]],
  ]:
      """
      Returns a docs matrix from a list of DataRequest objects.
  
      :param requests: List of DataRequest objects
      :return: docs matrix and doc: list of DocumentArray objects
      """
      docs_map = {}
      docs_matrix = []
      for req in requests:
          docs_matrix.append(req.docs)
          docs_map[req.last_executor] = req.docs
  
      # to unify all length=0 DocumentArray (or any other results) will simply considered as None
      # otherwise, the executor has to handle [None, None, None] or [DocArray(0), DocArray(0), DocArray(0)]
      len_r = sum(len(r) for r in docs_matrix)
      if len_r == 0:
          docs_matrix = None
  
      return docs_matrix, docs_map
  
imports: import argparse
  import asyncio
  import functools
  import json
  import os
  import tempfile
  import threading
  import uuid
  import warnings
  from typing import TYPE_CHECKING, AsyncIterator, Dict, Generator, List, Optional, Tuple, Union
  from google.protobuf.struct_pb2 import Struct
  from jina._docarray import DocumentArray, docarray_v2
  from jina.constants import __default_endpoint__
  from jina.excepts import BadConfigSource, RuntimeTerminated
  from jina.helper import get_full_version
  from jina.importer import ImportExtensions
  from jina.proto import jina_pb2
  from jina.serve.executors import BaseExecutor
  from jina.serve.instrumentation import MetricsTimer
  from jina.serve.runtimes.worker.batch_queue import BatchQueue
  from jina.types.request.data import DataRequest, SingleDocumentRequest
label_desc: Use image node_id 20 for calling the WorkerRequestHandler obj's underlying member method code with example usage: obj._get_docs_matrix_from_request(requests) and returns: docs_matrix,  docs_map