code: def test_weekly(self, calendar_name, base_terms):
      downsampled_terms = tuple(
          t.downsample("week_start") for t in base_terms
      )
      all_terms = base_terms + downsampled_terms
  
      #    December 2013
      # Mo Tu We Th Fr Sa Su
      #                    1
      #  2  3  4  5  6  7  8
      #  9 10 11 12 13 14 15
      # 16 17 18 19 20 21 22
      # 23 24 25 26 27 28 29
      # 30 31
  
      #     January 2014
      # Mo Tu We Th Fr Sa Su
      #        1  2  3  4  5
      #  6  7  8  9 10 11 12
      # 13 14 15 16 17 18 19
      # 20 21 22 23 24 25 26
      # 27 28 29 30 31
  
      # This region intersects with the last full week of 2013, the week
      # shared by 2013 and 2014, and the first full week of 2014.
      tmp = self.trading_sessions[calendar_name]
      all_sessions = tmp[tmp.slice_indexer("2013-12-27", "2014-01-12")]
      end_session = all_sessions[-1]
  
      week0 = all_sessions[
          all_sessions.slice_indexer("2013-12-27", "2013-12-29")
      ]
      week1 = all_sessions[
          all_sessions.slice_indexer("2013-12-30", "2014-01-05")
      ]
      week2 = all_sessions[
          all_sessions.slice_indexer("2014-01-06", "2014-01-12")
      ]
  
      # Simulate requesting computation where the unaltered lookback would
      # land exactly on the first date in week 2.  We shouldn't request any
      # additional rows for the regular terms or the downsampled terms.
      for i in range(3):
          start_session = week2[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 week 2.  The downsampled terms
      # should request one more extra row.
      for i in range(3):
          start_session = week2[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 week 1.  The downsampled terms
      # should request enough extra rows to push us back to the first date of
      # week 1.
      for i in range(3):
          start_session = week2[i]
          self.check_extra_row_calculations(
              downsampled_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + len(week1),
          )
          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 week0.  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(3):
          start_session = week1[i]
          self.check_extra_row_calculations(
              downsampled_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + len(week0),
          )
          self.check_extra_row_calculations(
              base_terms,
              all_sessions,
              start_session,
              end_session,
              min_extra_rows=i + 1,
              expected_extra_rows=i + 1,
          )
  
imports: from functools import partial
  import pandas
  from pandas.util.testing import assert_frame_equal
  from zipline.errors import NoFurtherDataError
  from zipline.pipeline import Pipeline, CustomFactor, CustomFilter, CustomClassifier, SimplePipelineEngine
  from zipline.pipeline.data.testing import TestingDataSet
  from zipline.pipeline.domain import CA_EQUITIES, EquitySessionDomain, GB_EQUITIES, US_EQUITIES
  from zipline.pipeline.factors import SimpleMovingAverage
  from zipline.pipeline.filters.smoothing import All
  from zipline.testing import ZiplineTestCase, parameter_space, ExplodingObject
  from zipline.testing.fixtures import WithTradingSessions, WithSeededRandomPipelineEngine, WithAssetFinder
  from zipline.utils.classproperty import classproperty
  from zipline.utils.input_validation import _qualified_name
  from zipline.utils.numpy_utils import int64_dtype
label_desc: Use image node_id 4 for calling the ComputeExtraRowsTestCase obj's underlying member method code with example usage: obj.test_weekly(calendar_name, base_terms) without return types