"""Helper utility functions.""" import pycountry def get_country_name(country_code: str) -> str: """ Convert ISO country code to full country name. Args: country_code: Two-letter ISO country code (e.g., 'US') Returns: Full country name or the original code if not found """ try: country = pycountry.countries.get(alpha_2=country_code) return country.name if country else country_code except (KeyError, AttributeError): return country_code def format_percentage(value: float, decimals: int = 2) -> float: """ Format a percentage value to specified decimal places. Args: value: The percentage value decimals: Number of decimal places (default: 2) Returns: Formatted percentage value """ return round(value, decimals)