(arg)
| 224 | # expand them into individual key/value items, eg: |
| 225 | # {"country": ["US", "AU"], "foo": 1} -> "country:AU", "country:US", "foo:1" |
| 226 | def expand(arg): |
| 227 | for k, v in arg.items(): |
| 228 | for item in as_list(v): |
| 229 | yield "%s:%s" % (k, item) |
| 230 | |
| 231 | if isinstance(arg, dict): |
| 232 | return "|".join(sorted(expand(arg))) |