(codes: set = None, sort: bool = True)
return cs
Converts country codes into a list of code/name tuples suitable for choices on a form. If a set of country codes
    is not provided, we use the set of all countries.
Converts country codes into a list of code/name tuples suitable for choices on a form. If a set of country codes
    is not provided, we use the set of all countries.
Converts country codes into a list of code / name tuples suitable for choices on a form . If a set of country codes is not provided we use the set of all countries .
def choices(codes: set = None, sort: bool = True) -> tuple:
    """
    Converts country codes into a list of code/name tuples suitable for choices on a form. If a set of country codes
    is not provided, we use the set of all countries.
    """
    cs = tuple((c, NAMES[c]) for c in codes) if codes else tuple((c, n) for c, n in NAMES.items())

    if sort:
        cs = sorted(cs, key=lambda x: x[1])
    return cs
def choices ( codes : set = None , sort : bool = True ) -> tuple : cs = tuple ( ( c , NAMES [ c ] ) for c in codes ) if codes else tuple ( ( c , n ) for c , n in NAMES . items ( ) ) if sort : cs = sorted ( cs , key = lambda x : x [ 1 ] ) return cs