code: def test_td64_summation_overflow():
      # GH#9442
      ser = Series(pd.date_range("20130101", periods=100000, freq="h"))
      ser[0] += pd.Timedelta("1s 1ms")
  
      # mean
      result = (ser - ser.min()).mean()
      expected = pd.Timedelta(
          (pd.TimedeltaIndex(ser - ser.min()).asi8 / len(ser)).sum()
      )
  
      # the computation is converted to float so
      # might be some loss of precision
      assert np.allclose(result._value / 1000, expected._value / 1000)
  
      # sum
      msg = "overflow in timedelta operation"
      with pytest.raises(ValueError, match=msg):
          (ser - ser.min()).sum()
  
      s1 = ser[0:10000]
      with pytest.raises(ValueError, match=msg):
          (s1 - s1.min()).sum()
      s2 = ser[0:1000]
      (s2 - s2.min()).sum()
  
file_path: pandas/pandas/tests/series/test_reductions.py
imports: import numpy
  import pytest
  import pandas
  from pandas import Series
  import pandas._testing
label_desc: Use image node_id 7 for calling a global function with example usage: test_td64_summation_overflow() without return types