code: def get_session_by_id(self, session_id: str):
      return (
          self.db.session.query(self.model)
          .filter(self.model.session_id == session_id)
          .scalar()
      )
  
imports: from __future__ import annotations
  from datetime import datetime, timedelta
  from unittest import mock
  import pytest
  from flask.sessions import SecureCookieSessionInterface
  from flask_appbuilder import SQLA
  from airflow import settings
  from airflow.security import permissions
  from airflow.www import app
  from tests.test_utils.api_connexion_utils import create_user, delete_role
  from tests.test_utils.www import check_content_in_response, check_content_not_in_response, client_with_login
label_desc: Use image node_id 5 for calling the TestResetUserSessions obj's underlying member method code with example usage: obj.get_session_by_id(session_id) and returns: self