code: def test_ndarray_codec(codec_factory):
      SHAPE = (10, 20, 3)
      for dtype in NUMERIC_DTYPES:
          expected = np.random.rand(*SHAPE).astype(dtype=dtype)
          codec = codec_factory()
          field = UnischemaField(
              name="test_name",
              numpy_dtype=dtype,
              shape=SHAPE,
              codec=codec,
              nullable=False,
          )
          actual = codec.decode(field, codec.encode(field, expected))
          np.testing.assert_equal(actual, expected)
          assert expected.dtype == actual.dtype
  
imports: import numpy
  import pytest
  from petastorm.codecs import NdarrayCodec, CompressedNdarrayCodec
  from petastorm.unischema import UnischemaField
label_desc: Use image node_id 1 for calling a global function with example usage: test_ndarray_codec(codec_factory) without return types