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: Reduces a list of requests containing DocumentArrays into one request object. Changes are applied to the first
  request object in-place.
  
  Reduction consists in reducing every DocumentArray in `requests` sequentially using
  :class:`DocumentArray`.:method:`reduce`.
  The resulting DataRequest object contains Documents of all DocumentArrays inside requests.
  
  :param requests: List of DataRequest objects
  :return: the resulting DataRequest
docstr_tok: ["Reduces","a","list","of","requests","containing","DocumentArrays","into","one","request","object",".","Changes","are","applied","to","the","first","request","object","in-place",".","Reduction","consists","in","reducing","every","DocumentArray","in","`","requests","`","sequentially","using",":","class",":","`","DocumentArray","`",".",":","method",":","`","reduce","`",".","The","resulting","DataRequest","object","contains","Documents","of","all","DocumentArrays","inside","requests",".",":","param","requests",":","List","of","DataRequest","objects",":","return",":","the","resulting","DataRequest"]
code: def reduce_requests(requests: List["DataRequest"]) -> "DataRequest":
      """
      Reduces a list of requests containing DocumentArrays into one request object. Changes are applied to the first
      request object in-place.
  
      Reduction consists in reducing every DocumentArray in `requests` sequentially using
      :class:`DocumentArray`.:method:`reduce`.
      The resulting DataRequest object contains Documents of all DocumentArrays inside requests.
  
      :param requests: List of DataRequest objects
      :return: the resulting DataRequest
      """
      response_request = requests[0]
      for i, worker_result in enumerate(requests):
          if worker_result.status.code == jina_pb2.StatusProto.SUCCESS:
              response_request = worker_result
              break
      (
          docs_matrix,
          _,
      ) = WorkerRequestHandler._get_docs_matrix_from_request(requests)
  
      # Reduction is applied in-place to the first DocumentArray in the matrix
      da = WorkerRequestHandler.reduce(docs_matrix)
      WorkerRequestHandler.replace_docs(response_request, da)
  
      params = WorkerRequestHandler.get_parameters_dict_from_request(
          requests
      )
      WorkerRequestHandler.replace_parameters(response_request, params)
  
      return response_request
  
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 24 for calling the WorkerRequestHandler obj's underlying member method code with example usage: obj.reduce_requests(requests) and returns: response_request