code: def get_sessions(user_id: str, dbmanager: DBManager) -> List[dict]:
      """
      Load sessions for a specific user from the database, sorted by timestamp.
  
      :param user_id: The ID of the user whose sessions are to be loaded
      :param dbmanager: The DBManager instance to interact with the database
      :return: A list of dictionaries, each representing a session
      """
      query = "SELECT * FROM sessions WHERE user_id = ?"
      args = (user_id,)
      result = dbmanager.query(query=query, args=args, return_json=True)
      # Sort by timestamp ascending
      result = sorted(
          result, key=lambda k: k["timestamp"], reverse=True
      )
      for row in result:
          row["flow_config"] = json.loads(row["flow_config"])
      return result
  
imports: import json
  import logging
  import sqlite3
  import threading
  import os
  from typing import Any, List, Dict, Optional, Tuple
  from ..datamodel import AgentFlowSpec, AgentWorkFlowConfig, Gallery, Message, Session, Skill
label_desc: Use image node_id 3 for calling a global function with example usage: get_sessions(user_id, dbmanager) and returns: result