code: def test_parse_tf_serving_single_array():
      def assert_result(result, expected_result):
          assert (result == expected_result).all()
  
      # values for each column are properly converted to a tensor
      arr = [
          [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
          [[3, 2, 1], [6, 5, 4], [9, 8, 7]],
      ]
      tfserving_instances = {"instances": arr}
      tfserving_inputs = {"inputs": arr}
  
      # Without schema
      instance_result = parse_tf_serving_input(tfserving_instances)
      assert instance_result.shape == (2, 3, 3)
      assert_result(instance_result, np.array(arr, dtype="int64"))
  
      input_result = parse_tf_serving_input(tfserving_inputs)
      assert input_result.shape == (2, 3, 3)
      assert_result(input_result, np.array(arr, dtype="int64"))
  
      # Unnamed schema
      schema = Schema([TensorSpec(np.dtype("float32"), [-1])])
      instance_result = parse_tf_serving_input(
          tfserving_instances, schema
      )
      assert_result(instance_result, np.array(arr, dtype="float32"))
  
      input_result = parse_tf_serving_input(tfserving_inputs, schema)
      assert_result(input_result, np.array(arr, dtype="float32"))
  
      # named schema
      schema = Schema([TensorSpec(np.dtype("float32"), [-1], "a")])
      instance_result = parse_tf_serving_input(
          tfserving_instances, schema
      )
      assert isinstance(instance_result, dict)
      assert len(instance_result.keys()) == 1
      assert "a" in instance_result
      assert_result(
          instance_result["a"], np.array(arr, dtype="float32")
      )
  
      input_result = parse_tf_serving_input(tfserving_inputs, schema)
      assert isinstance(input_result, dict)
      assert len(input_result.keys()) == 1
      assert "a" in input_result
      assert_result(input_result["a"], np.array(arr, dtype="float32"))
  
imports: import base64
  import datetime
  import json
  import numpy
  import pandas
  import pytest
  from google.protobuf.text_format import Parse
  from mlflow.entities import Experiment, Metric
  from mlflow.entities.model_registry import ModelVersion, RegisteredModel
  from mlflow.exceptions import MlflowException
  from mlflow.protos.model_registry_pb2 import RegisteredModel
  from mlflow.protos.service_pb2 import Experiment
  from mlflow.protos.service_pb2 import Metric
  from mlflow.types import ColSpec, DataType, Schema, TensorSpec
  from mlflow.types.schema import Array, Object, Property
  from mlflow.types.utils import _infer_schema
  from mlflow.utils.proto_json_utils import MlflowFailedTypeConversion, _CustomJsonEncoder, _stringify_all_experiment_ids, cast_df_types_according_to_schema, dataframe_from_parsed_json, dataframe_from_raw_json, message_to_json, parse_dict, parse_tf_serving_input
  from tests.protos.test_message_pb2 import TestMessage
label_desc: Use image node_id 9 for calling a global function with example usage: test_parse_tf_serving_single_array() without return types