def METHOD_NAME(
    *, db_session, external_id: str, project_id: int
) -> Optional[Service]:
    """Gets a service by external id (e.g. PagerDuty service id) and project id."""
    return (
        db_session.query(Service)
        .filter(Service.project_id == project_id)
        .filter(Service.external_id == external_id)
        .first()
    )