'Build a dict of Adjustment objects in the format expected by
AdjustedArray.
Returns a dict of the form:
# Integer index into `dates` for the date on which we should
# apply the list of adjustments.
1 : [
Float64Multiply(first_row=2, last_row=4, col=3, value=0.5),
Float64Overwrite(first_row=3, last_row=5, col=1, value=2.0),'

def format_adjustments(self, dates, assets):

    make_adjustment = partial(make_adjustment_from_labels, dates, assets)
    (min_date, max_date) = dates[[0, (-1)]]
    if (len(self.adjustments) == 0):
        return {}
    date_bounds = self.adjustment_apply_dates.slice_indexer(min_date, max_date)
    dates_filter = zeros(len(self.adjustments), dtype='bool')
    dates_filter[date_bounds] = True
    dates_filter &= (self.adjustment_end_dates >= min_date)
    sids_filter = self.adjustment_sids.isin(assets.values)
    adjustments_to_use = self.adjustments.loc[(dates_filter & sids_filter)].set_index('apply_date')
    out = {}
    previous_apply_date = object()
    for row in adjustments_to_use.itertuples():
        (apply_date, sid, value, kind, start_date, end_date) = row
        if (apply_date != previous_apply_date):
            row_loc = dates.get_loc(apply_date, method='bfill')
            current_date_adjustments = out[row_loc] = []
            previous_apply_date = apply_date
        current_date_adjustments.append(make_adjustment(start_date, end_date, sid, kind, value))
    return out
