code: def get_events_by_ses(self, events, num_ses):
          
          numpy.random.seed(self.serial)
          sess = numpy.random.choice(num_ses, len(events)) + 1
          events_by_ses = collections.defaultdict(list)
          for ses, event in zip(sess, events):
              events_by_ses[ses].append(event)
          for ses in events_by_ses:
              events_by_ses[ses] = numpy.array(events_by_ses[ses])
          return events_by_ses
docs: :returns: a dictionary ses index -> events array