code: def test_numpy_encoder():
      # Test Python builtin data type encoding.
      assert json.dumps(None, cls=NumpyEncoder) == "null"
      assert json.dumps({}, cls=NumpyEncoder) == "{}"
      assert json.dumps(1, cls=NumpyEncoder) == "1"
      assert json.dumps(1.0, cls=NumpyEncoder) == "1.0"
      assert json.dumps("a", cls=NumpyEncoder) == '"a"'
      assert (
          json.dumps([0, 1, 2, 3, 4], cls=NumpyEncoder)
          == "[0, 1, 2, 3, 4]"
      )
      assert (
          json.dumps((0, 1, 2, 3, 4), cls=NumpyEncoder)
          == "[0, 1, 2, 3, 4]"
      )
      assert (
          json.dumps({0, 1, 2, 3, 4}, cls=NumpyEncoder)
          == "[0, 1, 2, 3, 4]"
      )
      assert json.dumps({"a": "b"}, cls=NumpyEncoder) == '{"a": "b"}'
  
      # Test numpy data type encoding
      for dtype in [
          np.byte,
          np.ubyte,
          np.short,
          np.ushort,
          np.int32,
          np.int64,
          np.uint,
          np.longlong,
          np.ulonglong,
      ]:
          x = np.arange(5, dtype=dtype)
          assert json.dumps(x, cls=NumpyEncoder) == "[0, 1, 2, 3, 4]"
          for i in x:
              assert json.dumps(i, cls=NumpyEncoder) == f"{i}"
  
      for dtype in [np.half, np.single, np.double, np.longdouble]:
          x = np.arange(5, dtype=dtype)
          assert (
              json.dumps(x, cls=NumpyEncoder)
              == "[0.0, 1.0, 2.0, 3.0, 4.0]"
          )
          for i in x:
              assert json.dumps(i, cls=NumpyEncoder) == f"{i}"
  
imports: import functools
  import json
  import logging
  import numpy
  import pandas
  import pytest
  from fsspec.config import conf
  from ludwig.api import LudwigModel
  from ludwig.data.cache.types import CacheableDataframe
  from ludwig.data.dataset_synthesizer import build_synthetic_dataset_df
  from ludwig.utils.data_utils import add_sequence_feature_column, figure_data_format_dataset, get_abs_path, hash_dict, NumpyEncoder, PANDAS_DF, read_csv, read_html, read_parquet, sanitize_column_names, use_credentials
  from tests.integration_tests.utils import private_param
label_desc: Use image node_id 7 for calling a global function with example usage: test_numpy_encoder() without return types