def METHOD_NAME(*, db_session, project_id: int = None) -> List[Optional[CasePriority]]:
    """Returns all case priorities."""
    if project_id:
        return db_session.query(CasePriority).filter(CasePriority.project_id == project_id)
    return db_session.query(CasePriority)