code: def test_delta_to_nanoseconds_td64_MY_raises():
      msg = (
          "delta_to_nanoseconds does not support Y or M units, "
          "as their duration in nanoseconds is ambiguous"
      )
  
      td = np.timedelta64(1234, "Y")
  
      with pytest.raises(ValueError, match=msg):
          delta_to_nanoseconds(td)
  
      td = np.timedelta64(1234, "M")
  
      with pytest.raises(ValueError, match=msg):
          delta_to_nanoseconds(td)
  
file_path: pandas/pandas/tests/tslibs/test_timedeltas.py
imports: import re
  import numpy
  import pytest
  from pandas._libs.tslibs.timedeltas import array_to_timedelta64, delta_to_nanoseconds, ints_to_pytimedelta
  from pandas import Timedelta, offsets
  import pandas._testing
label_desc: Use image node_id 3 for calling a global function with example usage: test_delta_to_nanoseconds_td64_MY_raises() without return types