code: def test_numeric_types(spark_numpy_types):
      spark_type, numpy_type = spark_numpy_types
  
      codec = ScalarCodec(spark_type())
      field = UnischemaField(
          name="field_int",
          numpy_dtype=numpy_type,
          shape=(),
          codec=codec,
          nullable=False,
      )
  
      min_val, max_val = (
          np.iinfo(numpy_type).min,
          np.iinfo(numpy_type).max,
      )
  
      assert (
          codec.decode(field, codec.encode(field, numpy_type(min_val)))
          == min_val
      )
      assert (
          codec.decode(field, codec.encode(field, numpy_type(max_val)))
          == max_val
      )
  
file_path: petastorm/petastorm/tests/test_codec_scalar.py
imports: from decimal import Decimal
  import numpy
  import pytest
  from pyspark.sql.types import StringType, ByteType, ShortType, IntegerType, LongType, DecimalType, BooleanType, FloatType
  from petastorm.codecs import ScalarCodec
  from petastorm.unischema import UnischemaField
label_desc: Use image node_id 3 for calling a global function with example usage: test_numeric_types(spark_numpy_types) without return types