<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count(cls, user_id):

 """ Count sessions with user_id """

        return cls.query.with_entities(
            cls.user_id).filter_by(user_id=user_id).count()