code: def get_content(datatype: str, data: InferTensorContents):
      if datatype == "BOOL":
          return list(data.bool_contents)
      elif datatype in ["UINT8", "UINT16", "UINT32"]:
          return list(data.uint_contents)
      elif datatype == "UINT64":
          return list(data.uint64_contents)
      elif datatype in ["INT8", "INT16", "INT32"]:
          return list(data.int_contents)
      elif datatype == "INT64":
          return list(data.int64_contents)
      elif datatype == "FP32":
          return list(data.fp32_contents)
      elif datatype == "FP64":
          return list(data.fp64_contents)
      elif datatype == "BYTES":
          return [
              base64.b64encode(data.bytes_contents[0]).decode("utf-8")
          ]
      else:
          raise InvalidInput("invalid content type")
  
file_path: serve/kubernetes/kserve/kserve_wrapper/gprc_utils.py
imports: import base64
  import json
  from typing import Union
  from inference_pb2 import PredictionResponse, PredictionsRequest
  from kserve.errors import InvalidInput
  from kserve.protocol.grpc.grpc_predict_v2_pb2 import InferTensorContents, ModelInferRequest
  from kserve.protocol.infer_type import InferOutput, InferRequest, InferResponse
label_desc: Use image node_id 1 for calling a global function with example usage: get_content(datatype, data) and returns: list, list, list, list, list, list, list, list