code: def test_duration():
      arr = np.array([0, 3600000000000], dtype="timedelta64[ns]")
  
      units = ["us", "ms", "s"]
  
      for i, unit in enumerate(units):
          dtype = "timedelta64[{}]".format(unit)
          arrow_arr = pa.array(arr.astype(dtype))
          expected = datetime.timedelta(seconds=60 * 60)
          assert isinstance(arrow_arr[1].as_py(), datetime.timedelta)
          assert arrow_arr[1].as_py() == expected
          assert (
              arrow_arr[1].value * 1000 ** (i + 1)
              == expected.total_seconds() * 1e9
          )
  
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 25 for calling a global function with example usage: test_duration() without return types