class_docstr: Implementation. Captures batches in KServe v2 protocol format, returns
  also in FServing v2 protocol format.
class_docstr_tok: ["Implementation",".","Captures","batches","in","KServe","v2","protocol","format",",","returns","also","in","FServing","v2","protocol","format","."]
docstr: Translates KServe request input to list of data expected by Torchserve.
  
  Parameters:
  data (json): KServe v2 request input json.
  {
    "inputs": [{
      "name": "input-0",
      "shape": [37],
      "datatype": "INT64",
      "data": [66, 108, 111, 111, 109]
    }]
  }
  
  Returns: list of data objects.
  [{
  'name': 'input-0',
  'shape': [5],
  'datatype': 'INT64',
  'data': [66, 108, 111, 111, 109]
  }]
docstr_tok: ["Translates","KServe","request","input","to","list","of","data","expected","by","Torchserve",".","Parameters",":","data","(","json",")",":","KServe","v2","request","input","json",".","{","``","inputs","''",":","[","{","``","name","''",":","``","input-0","''",",","``","shape","''",":","[","37","]",",","``","datatype","''",":","``","INT64","''",",","``","data","''",":","[","66",",","108",",","111",",","111",",","109","]","}","]","}","Returns",":","list","of","data","objects",".","[","{","'name","'",":","'input-0","'",",","'shape","'",":","[","5","]",",","'datatype","'",":","'INT64","'",",","'data","'",":","[","66",",","108",",","111",",","111",",","109","]","}","]"]
code: def parse_input(self, data):
      """Translates KServe request input to list of data expected by Torchserve.
  
      Parameters:
      data (json): KServe v2 request input json.
      {
        "inputs": [{
          "name": "input-0",
          "shape": [37],
          "datatype": "INT64",
          "data": [66, 108, 111, 111, 109]
        }]
      }
  
      Returns: list of data objects.
      [{
      'name': 'input-0',
      'shape': [5],
      'datatype': 'INT64',
      'data': [66, 108, 111, 111, 109]
      }]
  
      """
      logger.debug("Parsing input in KServe v2 format %s", data)
      inputs = self._batch_from_json(data)
      logger.debug("KServev2 parsed inputs %s", inputs)
      return inputs
  
file_path: serve/ts/torch_handler/request_envelope/kservev2.py
imports: import json
  import logging
  import numpy
  from .base import BaseEnvelope
label_desc: Use image node_id 1 for calling the KServev2Envelope obj's underlying member method code with example usage: obj.parse_input(data) and returns: inputs