code: def test_timestamp_nanos_nopandas():
      # ARROW-5450
      pytest.importorskip("pytz")
      import pytz
  
      tz = "America/New_York"
      ty = pa.timestamp("ns", tz=tz)
  
      # 2000-01-01 00:00:00 + 1 microsecond
      s = pa.scalar(946684800000000000 + 1000, type=ty)
  
      tzinfo = pytz.timezone(tz)
      expected = datetime.datetime(
          2000, 1, 1, microsecond=1, tzinfo=tzinfo
      )
      expected = tzinfo.fromutc(expected)
      result = s.as_py()
      assert result == expected
      assert result.year == 1999
      assert result.hour == 19
  
      # Non-zero nanos yields ValueError
      s = pa.scalar(946684800000000001, type=ty)
      with pytest.raises(ValueError):
          s.as_py()
  
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 22 for calling a global function with example usage: test_timestamp_nanos_nopandas() without return types