code: def get_user_by_api_key_sync(
      db: Session, api_key: str
  ) -> Union[User, None]:
      return db.query(User).filter_by(api_key=api_key).first()
  
file_path: argilla/src/argilla/server/contexts/accounts.py
imports: from typing import TYPE_CHECKING, List, Union
  from uuid import UUID
  from passlib.context import CryptContext
  from sqlalchemy import exists, select
  from sqlalchemy.orm import Session, selectinload
  from argilla.server.models import User, Workspace, WorkspaceUser
  from argilla.server.security.model import UserCreate, WorkspaceCreate, WorkspaceUserCreate
label_desc: Use image node_id 2 for calling a global function with example usage: get_user_by_api_key_sync(db, api_key) and returns: db