code: def test_last_week_of_month_on_offset(self, n, weekday, date, tz):
      # GH 19036, GH 18977 _adjust_dst was incorrect for LastWeekOfMonth
      offset = LastWeekOfMonth(n=n, weekday=weekday)
      ts = Timestamp(date, tz=tz)
      slow = (ts + offset) - offset == ts
      fast = offset.is_on_offset(ts)
      assert fast == slow
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  import pytest
  from pandas._libs.tslibs import Timestamp
  from pandas._libs.tslibs.offsets import Day, LastWeekOfMonth, Week, WeekOfMonth
  import pandas._testing
  from pandas.tests.tseries.offsets.common import WeekDay, assert_is_on_offset, assert_offset_equal
label_desc: Use image node_id 4 for calling the TestLastWeekOfMonth obj's underlying member method code with example usage: obj.test_last_week_of_month_on_offset(n, weekday, date, tz) without return types