File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -29,26 +29,25 @@ def country_filter(src, scopes):
2929 """
3030 if not scopes : # Handle empty scopes
3131 return src
32-
32+
3333 if isinstance (scopes , str ):
3434 return _country_filter (src , scopes , None )
35-
35+
3636 if isinstance (scopes , list ):
3737 if not scopes : # Empty list
3838 return src
39-
39+
4040 # Convert all scopes to lowercase for case-insensitive comparison
4141 normalized_scopes = [scope .lower () for scope in scopes ]
42-
42+
4343 # Filter entries where country matches any scope (case-insensitive)
4444 filtered_entries = [
45- entry for entry in src
46- if entry ["country" ].lower () in normalized_scopes
45+ entry for entry in src if entry ["country" ].lower () in normalized_scopes
4746 ]
48-
47+
4948 # Sort by country name for consistent ordering
5049 return sorted (filtered_entries , key = lambda x : x ["country" ])
51-
50+
5251 return []
5352
5453
@@ -87,4 +86,4 @@ def main():
8786
8887
8988if __name__ == "__main__" :
90- main ()
89+ main ()
You can’t perform that action at this time.
0 commit comments