code: def test_parquet_version_timestamp_differences():
      i_s = (
          pd.Timestamp("2010-01-01").value / 1000000000
      )  # := 1262304000
  
      d_s = np.arange(i_s, i_s + 10, 1, dtype="int64")
      d_ms = d_s * 1000
      d_us = d_ms * 1000
      d_ns = d_us * 1000
  
      a_s = pa.array(d_s, type=pa.timestamp("s"))
      a_ms = pa.array(d_ms, type=pa.timestamp("ms"))
      a_us = pa.array(d_us, type=pa.timestamp("us"))
      a_ns = pa.array(d_ns, type=pa.timestamp("ns"))
  
      all_versions = ["1.0", "2.4", "2.6"]
  
      names = ["ts:s", "ts:ms", "ts:us", "ts:ns"]
      table = pa.Table.from_arrays([a_s, a_ms, a_us, a_ns], names)
  
      # Using Parquet version 1.0 and 2.4, seconds should be coerced to milliseconds
      # and nanoseconds should be coerced to microseconds by default
      expected = pa.Table.from_arrays([a_ms, a_ms, a_us, a_us], names)
      _check_roundtrip(table, expected, version="1.0")
      _check_roundtrip(table, expected, version="2.4")
  
      # Using Parquet version 2.6, seconds should be coerced to milliseconds
      # and nanoseconds should be retained by default
      expected = pa.Table.from_arrays([a_ms, a_ms, a_us, a_ns], names)
      _check_roundtrip(table, expected, version="2.6")
  
      # For either Parquet version coercing to milliseconds or microseconds
      # is allowed
      expected = pa.Table.from_arrays([a_ms, a_ms, a_ms, a_ms], names)
      for ver in all_versions:
          _check_roundtrip(
              table, expected, coerce_timestamps="ms", version=ver
          )
  
      expected = pa.Table.from_arrays([a_us, a_us, a_us, a_us], names)
      for ver in all_versions:
          _check_roundtrip(
              table, expected, version=ver, coerce_timestamps="us"
          )
  
      # TODO: after pyarrow allows coerce_timestamps='ns', tests like the
      # following should pass ...
  
      # Using Parquet version 1.0, coercing to nanoseconds is not allowed
      # expected = None
      # with pytest.raises(NotImplementedError):
      #     _roundtrip_table(table, coerce_timestamps='ns')
  
      # Using Parquet version 2.0, coercing to nanoseconds is allowed
      # expected = pa.Table.from_arrays([a_ns, a_ns, a_ns, a_ns], names)
      # _check_roundtrip(table, expected, version='2.6', coerce_timestamps='ns')
  
      # For either Parquet version, coercing to nanoseconds is allowed
      # if Int96 storage is used
      expected = pa.Table.from_arrays([a_ns, a_ns, a_ns, a_ns], names)
      for ver in all_versions:
          _check_roundtrip(
              table,
              expected,
              version=ver,
              use_deprecated_int96_timestamps=True,
          )
  
file_path: arrow/python/pyarrow/tests/parquet/test_datetime.py
imports: import datetime
  import io
  import warnings
  import numpy
  import pytest
  import pyarrow
  from pyarrow.tests.parquet.common import _check_roundtrip
label_desc: Use image node_id 11 for calling a global function with example usage: test_parquet_version_timestamp_differences() without return types