code: def test_bunched_yearends():
      # GH#14774 cases with two fiscal year-ends in the same calendar-year
      fy = FY5253(n=1, weekday=5, startingMonth=12, variation="nearest")
      dt = Timestamp("2004-01-01")
      assert fy.rollback(dt) == Timestamp("2002-12-28")
      assert (-fy)._apply(dt) == Timestamp("2002-12-28")
      assert dt - fy == Timestamp("2002-12-28")
  
      assert fy.rollforward(dt) == Timestamp("2004-01-03")
      assert fy._apply(dt) == Timestamp("2004-01-03")
      assert fy + dt == Timestamp("2004-01-03")
      assert dt + fy == Timestamp("2004-01-03")
  
      # Same thing, but starting from a Timestamp in the previous year.
      dt = Timestamp("2003-12-31")
      assert fy.rollback(dt) == Timestamp("2002-12-28")
      assert (-fy)._apply(dt) == Timestamp("2002-12-28")
      assert dt - fy == Timestamp("2002-12-28")
  
imports: from datetime import datetime
  from dateutil.relativedelta import relativedelta
  import pytest
  from pandas import Timestamp
  import pandas._testing
  from pandas.tests.tseries.offsets.common import WeekDay, assert_is_on_offset, assert_offset_equal
  from pandas.tseries.offsets import FY5253, FY5253Quarter
label_desc: Use image node_id 6 for calling a global function with example usage: test_bunched_yearends() without return types