Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def materialize_country_facets(cls, counts):
"""
Materialize country facet counts.
Returns:
dict: {label, value, count}
"""
facets = []
for abbr, count in counts:
country = countries.get(abbr)
if country:
facets.append(dict(
label = country.name,
value = abbr.upper(),
count = count,
))
return facets