code: def check_previous_event_indexer(
      self, events, all_dates, sid, indexer
  ):
      relevant_events = events[events.sid == sid]
      self.assertEqual(len(relevant_events), 2)
  
      ix1, ix2 = relevant_events.index
  
      # An event becomes a possible value once we're past both its event_date
      # and its timestamp.
      event1_first_eligible = max(
          relevant_events.loc[ix1, ["event_date", "timestamp"]],
      )
      event2_first_eligible = max(
          relevant_events.loc[ix2, ["event_date", "timestamp"]],
      )
  
      for date, computed_index in zip(all_dates, indexer):
          if date >= event2_first_eligible:
              # If we've seen event 2, it should win even if we've seen event
              # 1, because events are sorted by event_date.
              self.assertEqual(computed_index, ix2)
          elif date >= event1_first_eligible:
              # If we've seen event 1 but not event 2, event 1 should win.
              self.assertEqual(computed_index, ix1)
          else:
              # If we haven't seen either event, then we should have -1 as
              # sentinel.
              self.assertEqual(computed_index, -1)
  
imports: from datetime import time
  from itertools import product
  from unittest import skipIf
  import blaze
  import numpy
  import pandas
  import pytz
  from zipline.pipeline import Pipeline, SimplePipelineEngine
  from zipline.pipeline.common import EVENT_DATE_FIELD_NAME, TS_FIELD_NAME, SID_FIELD_NAME
  from zipline.pipeline.data import DataSet, Column
  from zipline.pipeline.domain import US_EQUITIES, EquitySessionDomain
  from zipline.pipeline.loaders.events import EventsLoader
  from zipline.pipeline.loaders.blaze.events import BlazeEventsLoader
  from zipline.pipeline.loaders.utils import next_event_indexer, previous_event_indexer
  from zipline.testing import ZiplineTestCase
  from zipline.testing.fixtures import WithAssetFinder, WithTradingSessions
  from zipline.testing.predicates import assert_equal
  from zipline.utils.numpy_utils import categorical_dtype, datetime64ns_dtype, float64_dtype, int64_dtype
  from zipline.utils.pandas_utils import new_pandas, skip_pipeline_new_pandas
label_desc: Use image node_id 3 for calling the EventIndexerTestCase obj's underlying member method code with example usage: obj.check_previous_event_indexer(events, all_dates, sid, indexer) without return types