I am trying to understand a piece of this code from Mode\'s case study, where the goal is to assign individual "sessions" to user activity (this code) and then seg