class_docstr: Base class for PipelineLoaders that supports loading the next and previous
  value of an event field.
  
  Does not currently support adjustments.
  
  Parameters
  ----------
  events : pd.DataFrame
      A DataFrame representing events (e.g. share buybacks or
      earnings announcements) associated with particular companies.
  
      ``events`` must contain at least three columns::
          sid : int64
              The asset id associated with each event.
  
          event_date : datetime64[ns]
              The date on which the event occurred.
  
          timestamp : datetime64[ns]
              The date on which we learned about the event.
  
  next_value_columns : dict[BoundColumn -> str]
      Map from dataset columns to raw field names that should be used when
      searching for a next event value.
  
  previous_value_columns : dict[BoundColumn -> str]
      Map from dataset columns to raw field names that should be used when
      searching for a previous event value.
class_docstr_tok: ["Base","class","for","PipelineLoaders","that","supports","loading","the","next","and","previous","value","of","an","event","field",".","Does","not","currently","support","adjustments",".","Parameters","--","--","--","--","--","events",":","pd.DataFrame","A","DataFrame","representing","events","(","e.g",".","share","buybacks","or","earnings","announcements",")","associated","with","particular","companies",".","``","events","``","must","contain","at","least","three","columns",":",":","sid",":","int64","The","asset","id","associated","with","each","event",".","event_date",":","datetime64","[","ns","]","The","date","on","which","the","event","occurred",".","timestamp",":","datetime64","[","ns","]","The","date","on","which","we","learned","about","the","event",".","next_value_columns",":","dict","[","BoundColumn","-",">","str","]","Map","from","dataset","columns","to","raw","field","names","that","should","be","used","when","searching","for","a","next","event","value",".","previous_value_columns",":","dict","[","BoundColumn","-",">","str","]","Map","from","dataset","columns","to","raw","field","names","that","should","be","used","when","searching","for","a","previous","event","value","."]
code: def _load_events(self, name_map, indexer, columns, dates, sids, mask):
      def to_frame(array):
          return pd.DataFrame(array, index=dates, columns=sids)
  
      assert indexer.shape == (len(dates), len(sids))
  
      out = {}
      for c in columns:
          # Array holding the value for column `c` for every event we have.
          col_array = self.events[name_map[c]]
  
          if not len(col_array):
              # We don't have **any** events, so return col.missing_value
              # every day for every sid. We have to special case empty events
              # because in normal branch we depend on being able to index
              # with -1 for missing values, which fails if there are no
              # events at all.
              raw = np.full(
                  (len(dates), len(sids)),
                  c.missing_value,
                  dtype=c.dtype,
              )
          else:
              # Slot event values into sid/date locations using `indexer`.
              # This produces a 2D array of the same shape as `indexer`,
              # which must be (len(dates), len(sids))`.
              raw = col_array[indexer]
  
              # indexer will be -1 for locations where we don't have a known
              # value. Overwrite those locations with c.missing_value.
              raw[indexer < 0] = c.missing_value
  
          # Delegate the actual array formatting logic to a DataFrameLoader.
          loader = DataFrameLoader(c, to_frame(raw), adjustments=None)
          out[c] = loader.load_adjusted_array([c], dates, sids, mask)[c]
      return out
  
imports: import numpy
  import pandas
  from six import viewvalues
  from toolz import groupby, merge
  from .base import PipelineLoader
  from catalyst.pipeline.common import EVENT_DATE_FIELD_NAME, SID_FIELD_NAME, TS_FIELD_NAME
  from catalyst.pipeline.loaders.frame import DataFrameLoader
  from catalyst.pipeline.loaders.utils import next_event_indexer, previous_event_indexer
label_desc: Use image node_id 7 for calling the EventsLoader obj's underlying member method code with example usage: obj._load_events(name_map, indexer, columns, dates, sids, mask) and returns: out, pd