def make_events(add_nulls):
 def gen_date_interleavings():
  for (e1, e2, t1, t2) in product(*([critical_dates] * 4)):
   if (e1 < e2):
    (yield (e1, e2, t1, t2))
 event_frames = []
 for (sid, (e1, e2, t1, t2)) in enumerate(gen_date_interleavings()):
  event_frames.append(make_events_for_sid(sid, [e1, e2], [t1, t2]))
 if add_nulls:
  for date in critical_dates:
   event_frames.append(make_null_event_date_events(np.arange((sid + 1)), timestamp=date))
 return pd.concat(event_frames, ignore_index=True)

def make_events ( add_nulls ) : def gen_date_interleavings ( ) : for ( e1 , e2 , t1 , t2 ) in product ( * ( [ critical_dates ] * 4 ) ) : if ( e1 < e2 ) : ( yield ( e1 , e2 , t1 , t2 ) ) event_frames = [ ] for ( sid , ( e1 , e2 , t1 , t2 ) ) in enumerate ( gen_date_interleavings ( ) ) : event_frames . append ( make_events_for_sid ( sid , [ e1 , e2 ] , [ t1 , t2 ] ) ) if add_nulls : for date in critical_dates : event_frames . append ( make_null_event_date_events ( np . arange ( ( sid + 1 ) ) , timestamp = date ) ) return pd . concat ( event_frames , ignore_index = True )
every event has at least three pieces of data associated with it: 1 .