Skip to content

Instantly share code, notes, and snippets.

@colonelpanic8
Created June 18, 2024 08:45
Show Gist options
  • Select an option

  • Save colonelpanic8/848c636190bd308a5444b3cd5cf706c7 to your computer and use it in GitHub Desktop.

Select an option

Save colonelpanic8/848c636190bd308a5444b3cd5cf706c7 to your computer and use it in GitHub Desktop.
from typing import Any
from sqlalchemy.orm import Session
from railbird import util
from railbird.datatypes import models
util, Session
try:
container: Any
session: Session
context["container"] # noqa: F821
except Exception:
context: dict
container = object()
session = Session()
context = None
context["shot_count"] = (
session.query(models.ShotModel)
.where(
models.ShotModel.annotation_any(
models.ShotModel.annotation_all(
"(l.3) True Positive - Likely Confounding", "(l.2) True Positive"
),
"(l.1) False Positive",
)
)
.count()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment