code: def test_quarterly(self, calendar_name, base_terms):
      downsampled_terms = tuple(
          t.downsample("quarter_start") for t in base_terms
      )
      all_terms = base_terms + downsampled_terms
  
      # This region intersects with Q4 2013, Q1 2014, and Q2 2014.
      tmp = self.trading_sessions[calendar_name]
      all_sessions = tmp[tmp.slice_indexer("2013-12-15", "2014-04-30")]
      end_session = all_sessions[-1]
  
      months = all_sessions.month
      Q4_2013 = all_sessions[months == 12]
      Q1_2014 = all_sessions[
          (months == 1) | (months == 2) | (months == 3)
      ]
      Q2_2014 = all_sessions[months == 4]
  
      # Simulate requesting computation where the unaltered lookback would
      # land exactly on the first date in Q2 2014.  We shouldn't request any
      # additional rows for the regular terms or the downsampled terms.
      for i in range(0, 15, 5):
          start_session = Q2_2014[i]
          self.check_extra_row_calculations(
              all_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i,
              expected_extra_rows=i,
          )
  
      # Simulate requesting computation where the unaltered lookback would
      # land exactly on the second date in Q2 2014.
      # The downsampled terms should request one more extra row.
      for i in range(0, 15, 5):
          start_session = Q2_2014[i + 1]
          self.check_extra_row_calculations(
              downsampled_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i,
              expected_extra_rows=i + 1,
          )
          self.check_extra_row_calculations(
              base_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i,
              expected_extra_rows=i,
          )
  
      # Simulate requesting computation where the unaltered lookback would
      # land exactly on the last date in Q1 2014.  The downsampled terms
      # should request enough extra rows to push us back to the first date of
      # Q1 2014.
      for i in range(0, 15, 5):
          start_session = Q2_2014[i]
          self.check_extra_row_calculations(
              downsampled_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + len(Q1_2014),
          )
          self.check_extra_row_calculations(
              base_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + 1,
          )
  
      # Simulate requesting computation where the unaltered lookback would
      # land exactly on the last date in Q4 2013.  The downsampled terms
      # should request enough extra rows to push us back to the first known
      # date, which is in the middle of december 2013.
      for i in range(0, 15, 5):
          start_session = Q1_2014[i]
          self.check_extra_row_calculations(
              downsampled_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + len(Q4_2013),
          )
          self.check_extra_row_calculations(
              base_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + 1,
          )
  
imports: import pandas
  from pandas.util.testing import assert_frame_equal
  from catalyst.pipeline import Pipeline, CustomFactor, CustomFilter, CustomClassifier
  from catalyst.pipeline.data.testing import TestingDataSet
  from catalyst.pipeline.factors.equity import SimpleMovingAverage
  from catalyst.pipeline.filters.smoothing import All
  from catalyst.testing import CatalystTestCase, parameter_space
  from catalyst.testing.fixtures import WithTradingSessions, WithSeededRandomPipelineEngine
  from catalyst.utils.input_validation import _qualified_name
  from catalyst.utils.numpy_utils import int64_dtype
label_desc: Use image node_id 2 for calling the ComputeExtraRowsTestcase obj's underlying member method code with example usage: obj.test_quarterly(calendar_name, base_terms) without return types