code: def test_numerics():
      # int64
      s = pa.scalar(1)
      assert isinstance(s, pa.Int64Scalar)
      assert repr(s) == "<pyarrow.Int64Scalar: 1>"
      assert str(s) == "1"
      assert s.as_py() == 1
  
      with pytest.raises(OverflowError):
          pa.scalar(-1, type="uint8")
  
      # float64
      s = pa.scalar(1.5)
      assert isinstance(s, pa.DoubleScalar)
      assert repr(s) == "<pyarrow.DoubleScalar: 1.5>"
      assert str(s) == "1.5"
      assert s.as_py() == 1.5
  
      # float16
      s = pa.scalar(np.float16(0.5), type="float16")
      assert isinstance(s, pa.HalfFloatScalar)
      # on numpy2 repr(np.float16(0.5)) == "np.float16(0.5)"
      # on numpy1 repr(np.float16(0.5)) == "0.5"
      assert (
          repr(s) == f"<pyarrow.HalfFloatScalar: {np.float16(0.5)!r}>"
      )
      assert str(s) == "0.5"
      assert s.as_py() == 0.5
  
imports: import datetime
  import decimal
  import pytest
  import sys
  import weakref
  import numpy
  import pyarrow
  import pyarrow.compute
  from pyarrow.tests import util
label_desc: Use image node_id 9 for calling a global function with example usage: test_numerics() without return types