docstr: Collect split adjustments for future quarters. Re-apply adjustments
  that would be overwritten by overwrites. Merge split adjustments with
  overwrites into the given dictionary of splits for the given sid.
  
  Parameters
  ----------
  adjustments_for_sid : dict[str -> dict[int -> list]]
      The dictionary of adjustments to which splits need to be added.
      Initially it contains only overwrites.
  requested_qtr_data : pd.DataFrame
      The requested quarter data for each calendar date per sid.
  dates : pd.DatetimeIndex
      The calendar dates for which estimates data is requested.
  sid : int
      The sid for which adjustments need to be collected.
  sid_idx : int
      The index of `sid` in the adjusted array.
  sid_estimates : pd.DataFrame
      The raw estimates data for the given sid.
  split_adjusted_asof_idx : int
      The index in `dates` as-of which the data is split adjusted.
  pre_adjustments : tuple(list(float), list(int), pd.DatetimeIndex)
      The adjustment values and indexes in `dates` for
      adjustments that happened before the split-asof-date.
  post_adjustments : tuple(list(float), list(int), pd.DatetimeIndex)
      The adjustment values, indexes in `dates`, and timestamps for
      adjustments that happened after the split-asof-date.
  requested_split_adjusted_columns : list of str
      List of requested split adjusted column names.
docstr_tok: ["Collect","split","adjustments","for","future","quarters",".","Re-apply","adjustments","that","would","be","overwritten","by","overwrites",".","Merge","split","adjustments","with","overwrites","into","the","given","dictionary","of","splits","for","the","given","sid",".","Parameters","--","--","--","--","--","adjustments_for_sid",":","dict","[","str","-",">","dict","[","int","-",">","list","]","]","The","dictionary","of","adjustments","to","which","splits","need","to","be","added",".","Initially","it","contains","only","overwrites",".","requested_qtr_data",":","pd.DataFrame","The","requested","quarter","data","for","each","calendar","date","per","sid",".","dates",":","pd.DatetimeIndex","The","calendar","dates","for","which","estimates","data","is","requested",".","sid",":","int","The","sid","for","which","adjustments","need","to","be","collected",".","sid_idx",":","int","The","index","of","`","sid","`","in","the","adjusted","array",".","sid_estimates",":","pd.DataFrame","The","raw","estimates","data","for","the","given","sid",".","split_adjusted_asof_idx",":","int","The","index","in","`","dates","`","as-of","which","the","data","is","split","adjusted",".","pre_adjustments",":","tuple","(","list","(","float",")",",","list","(","int",")",",","pd.DatetimeIndex",")","The","adjustment","values","and","indexes","in","`","dates","`","for","adjustments","that","happened","before","the","split-asof-date",".","post_adjustments",":","tuple","(","list","(","float",")",",","list","(","int",")",",","pd.DatetimeIndex",")","The","adjustment","values",",","indexes","in","`","dates","`",",","and","timestamps","for","adjustments","that","happened","after","the","split-asof-date",".","requested_split_adjusted_columns",":","list","of","str","List","of","requested","split","adjusted","column","names","."]
code: def collect_split_adjustments(
      self,
      adjustments_for_sid,
      requested_qtr_data,
      dates,
      sid,
      sid_idx,
      sid_estimates,
      split_adjusted_asof_idx,
      pre_adjustments,
      post_adjustments,
      requested_split_adjusted_columns,
  ):
      """
      Collect split adjustments for future quarters. Re-apply adjustments
      that would be overwritten by overwrites. Merge split adjustments with
      overwrites into the given dictionary of splits for the given sid.
  
      Parameters
      ----------
      adjustments_for_sid : dict[str -> dict[int -> list]]
          The dictionary of adjustments to which splits need to be added.
          Initially it contains only overwrites.
      requested_qtr_data : pd.DataFrame
          The requested quarter data for each calendar date per sid.
      dates : pd.DatetimeIndex
          The calendar dates for which estimates data is requested.
      sid : int
          The sid for which adjustments need to be collected.
      sid_idx : int
          The index of `sid` in the adjusted array.
      sid_estimates : pd.DataFrame
          The raw estimates data for the given sid.
      split_adjusted_asof_idx : int
          The index in `dates` as-of which the data is split adjusted.
      pre_adjustments : tuple(list(float), list(int), pd.DatetimeIndex)
          The adjustment values and indexes in `dates` for
          adjustments that happened before the split-asof-date.
      post_adjustments : tuple(list(float), list(int), pd.DatetimeIndex)
          The adjustment values, indexes in `dates`, and timestamps for
          adjustments that happened after the split-asof-date.
      requested_split_adjusted_columns : list of str
          List of requested split adjusted column names.
      """
      (
          pre_adjustments_dict,
          post_adjustments_dict,
      ) = self._collect_adjustments(
          requested_qtr_data,
          sid,
          sid_idx,
          sid_estimates,
          split_adjusted_asof_idx,
          pre_adjustments,
          post_adjustments,
          requested_split_adjusted_columns,
      )
      for column_name in requested_split_adjusted_columns:
          for overwrite_ts in adjustments_for_sid[column_name]:
              # We need to cumulatively re-apply all adjustments up to the
              # split-adjusted-asof-date. We might not have any
              # pre-adjustments, so we should check for that.
              if (
                  overwrite_ts <= split_adjusted_asof_idx
                  and pre_adjustments_dict
              ):
                  for split_ts in pre_adjustments_dict[column_name]:
                      # The split has to have occurred during the span of
                      # the overwrite.
                      if split_ts < overwrite_ts:
                          # Create new adjustments here so that we can
                          # re-apply all applicable adjustments to ONLY
                          # the dates being overwritten.
                          adjustments_for_sid[column_name][
                              overwrite_ts
                          ].extend(
                              [
                                  Float64Multiply(
                                      0,
                                      overwrite_ts - 1,
                                      sid_idx,
                                      sid_idx,
                                      adjustment.value,
                                  )
                                  for adjustment in pre_adjustments_dict[
                                      column_name
                                  ][
                                      split_ts
                                  ]
                              ]
                          )
              # After the split-adjusted-asof-date, we need to re-apply all
              # adjustments that occur after that date and within the
              # bounds of the overwrite. They need to be applied starting
              # from the first date and until an end date. The end date is
              # the date of the newest information we get about
              # `requested_quarter` that is >= `split_ts`, or if there is no
              # new knowledge before `overwrite_ts`, then it is the date
              # before `overwrite_ts`.
              else:
                  # Overwrites happen at the first index of a new quarter,
                  # so determine here which quarter that is.
                  requested_quarter = requested_qtr_data[
                      SHIFTED_NORMALIZED_QTRS, sid
                  ].iloc[overwrite_ts]
  
                  for adjustment_value, date_index, timestamp in zip(
                      *post_adjustments
                  ):
                      if (
                          split_adjusted_asof_idx
                          < date_index
                          < overwrite_ts
                      ):
                          # Assume the entire overwrite contains stale data
                          upper_bound = overwrite_ts - 1
                          end_idx = (
                              self.determine_end_idx_for_adjustment(
                                  timestamp,
                                  dates,
                                  upper_bound,
                                  requested_quarter,
                                  sid_estimates,
                              )
                          )
                          adjustments_for_sid[column_name][
                              overwrite_ts
                          ].append(
                              Float64Multiply(
                                  0,
                                  end_idx,
                                  sid_idx,
                                  sid_idx,
                                  adjustment_value,
                              )
                          )
  
      self.merge_split_adjustments_with_overwrites(
          pre_adjustments_dict,
          post_adjustments_dict,
          adjustments_for_sid,
          requested_split_adjusted_columns,
      )
  
imports: from abc import abstractmethod, abstractproperty
  from interface import implements
  import numpy
  import pandas
  from six import viewvalues
  from toolz import groupby
  from zipline.lib.adjusted_array import AdjustedArray
  from zipline.lib.adjustment import Datetime641DArrayOverwrite, Datetime64Overwrite, Float641DArrayOverwrite, Float64Multiply, Float64Overwrite
  from zipline.pipeline.common import EVENT_DATE_FIELD_NAME, FISCAL_QUARTER_FIELD_NAME, FISCAL_YEAR_FIELD_NAME, SID_FIELD_NAME, TS_FIELD_NAME
  from zipline.pipeline.loaders.base import PipelineLoader
  from zipline.utils.numpy_utils import datetime64ns_dtype, float64_dtype
  from zipline.pipeline.loaders.utils import ffill_across_cols, last_in_date_group
label_desc: Use image node_id 1 for calling the NextSplitAdjustedEarningsEstimatesLoader obj's underlying member method code with example usage: obj.collect_split_adjustments(adjustments_for_sid, requested_qtr_data, dates, sid, sid_idx, sid_estimates, split_adjusted_asof_idx, pre_adjustments, post_adjustments, requested_split_adjusted_columns) without return types