code: def test_coerce_outside_ns_bounds(invalid_date, errors):
      arr = np.array([invalid_date], dtype="object")
      kwargs = {"values": arr, "errors": errors}
  
      if errors == "raise":
          msg = (
              "^Out of bounds nanosecond timestamp: .*, at position 0$"
          )
  
          with pytest.raises(OutOfBoundsDatetime, match=msg):
              tslib.array_to_datetime(**kwargs)
      else:  # coerce.
          result, _ = tslib.array_to_datetime(**kwargs)
          expected = np.array([iNaT], dtype="M8[ns]")
  
          tm.assert_numpy_array_equal(result, expected)
  
imports: from datetime import date, datetime, timedelta, timezone
  from dateutil.tz.tz import tzoffset
  import numpy
  import pytest
  from pandas._libs import NaT, iNaT, tslib
  from pandas._libs.tslibs.dtypes import NpyDatetimeUnit
  from pandas._libs.tslibs.np_datetime import OutOfBoundsDatetime
  from pandas import Timestamp
  import pandas._testing
label_desc: Use image node_id 6 for calling a global function with example usage: test_coerce_outside_ns_bounds(invalid_date, errors) without return types