code: def test_numpy_encoding():
      data = [1, 2]
      floats = np.array(data).astype(np.float32)
      ints = floats.astype(np.int32)
      uints = floats.astype(np.uint32)
      list_of_uints = [np.int64(1), np.int64(2)]
  
      for np_data in [floats, ints, uints, list_of_uints]:
          assert (
              json.loads(
                  json.dumps(
                      jsonable_encoder(
                          np_data, custom_encoder=serve_encoders
                      )
                  )
              )
              == data
          )
      nested = {"a": np.array([1, 2])}
      assert json.loads(
          json.dumps(
              jsonable_encoder(nested, custom_encoder=serve_encoders)
          )
      ) == {"a": [1, 2]}
  
imports: import asyncio
  import json
  import os
  import time
  from unittest.mock import patch
  import numpy
  import pytest
  from fastapi.encoders import jsonable_encoder
  import ray
  from ray import serve
  from ray._private.resource_spec import HEAD_NODE_RESOURCE_NAME
  from ray._private.test_utils import wait_for_condition
  from ray.serve._private.test_utils import MockTimer
  from ray.serve._private.utils import MetricsPusher, calculate_remaining_timeout, get_all_live_placement_group_names, get_current_actor_id, get_head_node_id, is_running_in_asyncio_loop, merge_dict, msgpack_deserialize, msgpack_serialize, override_runtime_envs_except_env_vars, serve_encoders, snake_to_camel_case
  from ray.serve.tests.common.remote_uris import TEST_DAG_PINNED_URI, TEST_DEPLOY_GROUP_PINNED_URI
label_desc: Use image node_id 4 for calling a global function with example usage: test_numpy_encoding() without return types