'In order to determine which estimate we care about for a particular
sid, we need to look at all estimates that we have for that sid and
their associated event dates.
We define q1 < q2, and thus event1 < event2 since event1 occurs
during q1 and event2 occurs during q2 and we assume that there can
only be 1 event per quarter. We assume that there can be multiple
estimates per quarter leading up to the event. We assume that estimates
will not surpass the relevant event date. We will look at 2 estimates
for an event before the event occurs, since that is the simplest
scenario that covers the interesting edge cases:
- estimate values changing
- a release date changing
- estimates for different quarters interleaving
Thus, we generate all possible inter-leavings of 2 estimates per
quarter-event where estimate1 < estimate2 and all estimates are < the
relevant event and assign each of these inter-leavings to a
different sid.'

@classmethod
def make_events(cls):

    sid_estimates = []
    sid_releases = []
    it = enumerate(itertools.permutations((cls.q1_knowledge_dates + cls.q2_knowledge_dates), 4))
    for (sid, (q1e1, q1e2, q2e1, q2e2)) in it:
        if ((q1e1 < q1e2) and (q2e1 < q2e2) and (q1e1 < cls.q1_release_dates[0]) and (q1e2 < cls.q1_release_dates[0])):
            sid_estimates.append(cls.create_estimates_df(q1e1, q1e2, q2e1, q2e2, sid))
            sid_releases.append(cls.create_releases_df(sid))
    return pd.concat((sid_estimates + sid_releases)).reset_index(drop=True)
