def pcts

cswap-bend-cli@0.1.0.0 · swpick.bend:225

import cswap-bend-cli@0.1.0.0/swpick.bend as Swpick
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/store/seq.bend as SSeq

225# The percentages `relevant_windows` looks at: 5h, 7d and, with models, the
226# scoped windows named by them (or all of them for "all").
227def pcts(+row: Json.Json, +models: List<&2, String>) -> List<&2, U32>:
228  push_pct(window_pct(row, "five_hour"), push_pct(window_pct(row, "seven_day"),
229    sel_l(List.is_empty(&2, String, models), [], scoped_pcts(SSeq.unwrap_arr(SSeq.get_or("scoped", row, Json.JNull{})), lower_all(models)))))

Uses (12)

Used by (1)