Skip to content

Instantly share code, notes, and snippets.

@orzen
Created March 31, 2023 19:21
Show Gist options
  • Save orzen/6d63ac82023c9ea237851ce8d8eeed00 to your computer and use it in GitHub Desktop.
Save orzen/6d63ac82023c9ea237851ce8d8eeed00 to your computer and use it in GitHub Desktop.
Special stats: author_is_elon ???
(
"author_is_elon",
candidate =>
candidate
.getOrElse(AuthorIdFeature, None).contains(candidate.getOrElse(DDGStatsElonFeature, 0L))),
(
"author_is_power_user",
candidate =>
candidate
.getOrElse(AuthorIdFeature, None)
.exists(candidate.getOrElse(DDGStatsVitsFeature, Set.empty[Long]).contains)),
(
"author_is_democrat",
candidate =>
candidate
.getOrElse(AuthorIdFeature, None)
.exists(candidate.getOrElse(DDGStatsDemocratsFeature, Set.empty[Long]).contains)),
(
"author_is_republican",
candidate =>
candidate
.getOrElse(AuthorIdFeature, None)
.exists(candidate.getOrElse(DDGStatsRepublicansFeature, Set.empty[Long]).contains)),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment