def simulate_user_history(session, user):
 total_sessions = random.randrange(10)
 previous_user_session = None
 for _ in range(total_sessions):
  user_session = simulate_user_session(session, user, previous_user_session)
  previous_user_session = user_session

def simulate_user_history ( session , user ) : total_sessions = random . randrange ( 10 ) previous_user_session = None for _ in range ( total_sessions ) : user_session = simulate_user_session ( session , user , previous_user_session ) previous_user_session = user_session
simulates the entire history of activity for a single user .