def scoped_pcts
import cswap-bend-cli@0.1.0.0/swpick.bend as Swpickimport 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
201def scoped_pcts(+items: Json.Json, +wanted: List<&2, String>) -> List<&2, U32>:
202 match items:
203 case Json.JCons{s, t}:
204 scoped_pick(mem("all", wanted) || mem(String.to_lower(SSeq.field_str(s, "name")), wanted), pct_of(s), scoped_pcts(t, wanted))
205 case _:
206 []