Skip to content

Commit

Permalink
fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-17 authored and rlouf committed Feb 12, 2025
1 parent 6c598c3 commit 774fe56
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions outlines/types/countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

def get_country_flags():
"""Generate Unicode flags for all ISO 3166-1 alpha-2 country codes in Alpha2 Enum."""
base = ord('🇦')
return {code.name: chr(base + ord(code.name[0]) - ord('A')) + chr(base + ord(code.name[1]) - ord('A')) for code in Alpha2}
base = ord("🇦")
return {
code.name: chr(base + ord(code.name[0]) - ord("A"))
+ chr(base + ord(code.name[1]) - ord("A"))
for code in Alpha2
}


ALPHA_2_CODE = [(country.alpha2, country.alpha2) for country in countries]
Alpha2 = Enum("Alpha_2", ALPHA_2_CODE) # type:ignore
Expand All @@ -23,4 +28,4 @@ def get_country_flags():

flag_mapping = get_country_flags()
FLAG = [(flag, flag) for code, flag in flag_mapping.items()]
Flag = Enum("Flag", FLAG) # type:ignore
Flag = Enum("Flag", FLAG) # type:ignore

0 comments on commit 774fe56

Please sign in to comment.