code: def parse_tf_serving_input(inp_dict, schema=None):
      """
      Args:
          inp_dict: A dict deserialized from a JSON string formatted as described in TF's
              serving API doc
              (https://www.tensorflow.org/tfx/serving/api_rest#request_format_2)
          schema: MLflow schema used when parsing the data.
      """
  
      # pylint: disable=broad-except
      if "signature_name" in inp_dict:
          raise MlflowInvalidInputException(
              '"signature_name" parameter is currently not supported'
          )
  
      if not (
          list(inp_dict.keys()) == ["instances"]
          or list(inp_dict.keys()) == ["inputs"]
      ):
          raise MlflowInvalidInputException(
              'One of "instances" and "inputs" must be specified (not both or any other keys).'
              f"Received: {list(inp_dict.keys())}"
          )
  
      # Read the JSON
      try:
          # objects & arrays schema for List[Dict] and Dict[List] are different
          # so the conversion for `instances` below changes the schema.
          # e.g.
          # [{"col1": 1, "col2": 2}, {"col1": 3, "col2": 4}] -> {"col1": [1, 3], "col2": [2, 4]}
          # Schema([ColSpec(long, "col1"), ColSpec(long, "col2")]) ->
          # Schema([ColSpec(Array(long), "col1"), ColSpec(Array(long), "col2")])
          # To avoid this, we shouldn't use `instances` for such data.
          if "instances" in inp_dict:
              return parse_instances_data(inp_dict, schema)
          else:
              # items already in column format, convert values to tensor
              return _cast_schema_type(inp_dict["inputs"], schema)
      except MlflowException as e:
          raise e
      except Exception as e:
          # Add error into message to provide details for serving usage
          raise MlflowInvalidInputException(
              "Ensure that the input is a valid JSON-formatted string.\n"
              f"Error: {e!r}"
          ) from e
  
imports: import base64
  import datetime
  import importlib
  import json
  import os
  from collections import defaultdict
  from copy import deepcopy
  from functools import partial
  from json import JSONEncoder
  from typing import Any, Dict, Optional
  from google.protobuf.descriptor import FieldDescriptor
  from google.protobuf.json_format import MessageToJson, ParseDict
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import BAD_REQUEST
label_desc: Use image node_id 14 for calling a global function with example usage: parse_tf_serving_input(inp_dict, schema) and returns: parse_instances_data, _cast_schema_type