<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sessionize(user_events, cutoff=defaults.CUTOFF):
 """ Clusters user sessions from a sequence of user events. Note that, `event` data will simply be returned in the case of a revert. This function serves as a convenience wrapper around calls to :class:`~mw.lib.sessions.Cache`'s :meth:`~mw.lib.sessions.Cache.process` method. :Parameters: user_events : iter( (user, timestamp, event) ) an iterable over tuples of user, timestamp and event data. * user : `hashable` * timestamp : :class:`mw.Timestamp` * event : `mixed` cutoff : int the maximum time between events within a user session :Returns: a iterator over :class:`~mw.lib.sessions.Session` :Example: ('Willy on wheels', [{'rev_id': 1}, {'rev_id': 3}]) ('Walter', [{'rev_id': 2}, {'rev_id': 4}]) ('Willy on wheels', [{'rev_id': 5}]) """


    # Construct the session manager
    sessionizer = Sessionizer(cutoff)

    # Apply the events
    for user, timestamp, event in user_events:

        for session in sessionizer.process(user, timestamp, event):
            yield session

    # Yield the left-overs
    for session in sessionizer.get_active_sessions():
        yield session