class_docstr: Wrapper for custom entry_point
docstr: REQUEST_INPUT = {
      "requestId" : "111-222-3333",
      "parameters" : [ PARAMETER ]
  }
  
  PARAMETER = {
      "name" : parameter name
      "contentType": "http-content-types",
      "value": "val1"
  }
  
  :param batch:
  :return:
docstr_tok: ["REQUEST_INPUT","=","{","``","requestId","''",":","``","111-222-3333","''",",","``","parameters","''",":","[","PARAMETER","]","}","PARAMETER","=","{","``","name","''",":","parameter","name","``","contentType","''",":","``","http-content-types","''",",","``","value","''",":","``","val1","''","}",":","param","batch",":",":","return",":"]
code: def retrieve_data_for_inference(batch):
      """
  
      REQUEST_INPUT = {
          "requestId" : "111-222-3333",
          "parameters" : [ PARAMETER ]
      }
  
      PARAMETER = {
          "name" : parameter name
          "contentType": "http-content-types",
          "value": "val1"
      }
  
      :param batch:
      :return:
      """
      if batch is None:
          raise ValueError("Received invalid inputs")
  
      req_to_id_map = {}
      headers = []
      input_batch = []
      for batch_idx, request_batch in enumerate(batch):
          req_id = request_batch.get("requestId").decode("utf-8")
          parameters = request_batch["parameters"]
          model_in_headers = {}
  
          model_in = {}
          # Parameter level headers are updated here. multipart/form-data can have multiple headers.
          for parameter in parameters:
              model_in.update({parameter["name"]: parameter["value"]})
              model_in_headers.update(
                  {
                      parameter["name"]: {
                          "content-type": parameter["contentType"]
                      }
                  }
              )
  
          # Request level headers are populated here
          if request_batch.get("headers") is not None:
              for h in request_batch.get("headers"):
                  model_in_headers.update(
                      {
                          h["name"]
                          .decode("utf-8"): h["value"]
                          .decode("utf-8")
                      }
                  )
  
          headers.append(RequestProcessor(model_in_headers))
          input_batch.append(model_in)
          req_to_id_map[batch_idx] = req_id
  
      return headers, input_batch, req_to_id_map
  
file_path: serve/ts/service.py
imports: import logging
  import os
  import time
  from builtins import str
  import ts
  from ts.context import Context, RequestProcessor
  from ts.protocol.otf_message_handler import create_predict_response
  from ts.utils.util import PredictionException, get_yaml_config
label_desc: Use image node_id 3 for calling the Service obj's underlying member method code with example usage: obj.retrieve_data_for_inference(batch) and returns: headers,  input_batch,  req_to_id_map