def _check_session(self, user=None):
        if user is None:
            user, _ = self._get(PATHS['mgmt'], 'session')

        user = next(user)
        Connection.__setattr__(self, 'user_id',
                               int(user['id']))
        Connection.__setattr__(self, 'username',
                               user['name'])
        Connection.__setattr__(self, 'session_id',
                               self.session.cookies['adama_session'])
Set session parameters username, user_id, session_id.
dataset/ETHPy150Open MediaMath/t1-python/terminalone/connection.py/Connection._check_session