"""simple docstring"""


import os

import requests

a							='https://www.amdoren.com/api/currency.php'


# Currency and their description
a							='\nAED	United Arab Emirates Dirham\nAFN	Afghan Afghani\nALL	Albanian Lek\nAMD	Armenian Dram\nANG	Netherlands Antillean Guilder\nAOA	Angolan Kwanza\nARS	Argentine Peso\nAUD	Australian Dollar\nAWG	Aruban Florin\nAZN	Azerbaijani Manat\nBAM	Bosnia & Herzegovina Convertible Mark\nBBD	Barbadian Dollar\nBDT	Bangladeshi Taka\nBGN	Bulgarian Lev\nBHD	Bahraini Dinar\nBIF	Burundian Franc\nBMD	Bermudian Dollar\nBND	Brunei Dollar\nBOB	Bolivian Boliviano\nBRL	Brazilian Real\nBSD	Bahamian Dollar\nBTN	Bhutanese Ngultrum\nBWP	Botswana Pula\nBYN	Belarus Ruble\nBZD	Belize Dollar\nCAD	Canadian Dollar\nCDF	Congolese Franc\nCHF	Swiss Franc\nCLP	Chilean Peso\nCNY	Chinese Yuan\nCOP	Colombian Peso\nCRC	Costa Rican Colon\nCUC	Cuban Convertible Peso\nCVE	Cape Verdean Escudo\nCZK	Czech Republic Koruna\nDJF	Djiboutian Franc\nDKK	Danish Krone\nDOP	Dominican Peso\nDZD	Algerian Dinar\nEGP	Egyptian Pound\nERN	Eritrean Nakfa\nETB	Ethiopian Birr\nEUR	Euro\nFJD	Fiji Dollar\nGBP	British Pound Sterling\nGEL	Georgian Lari\nGHS	Ghanaian Cedi\nGIP	Gibraltar Pound\nGMD	Gambian Dalasi\nGNF	Guinea Franc\nGTQ	Guatemalan Quetzal\nGYD	Guyanaese Dollar\nHKD	Hong Kong Dollar\nHNL	Honduran Lempira\nHRK	Croatian Kuna\nHTG	Haiti Gourde\nHUF	Hungarian Forint\nIDR	Indonesian Rupiah\nILS	Israeli Shekel\nINR	Indian Rupee\nIQD	Iraqi Dinar\nIRR	Iranian Rial\nISK	Icelandic Krona\nJMD	Jamaican Dollar\nJOD	Jordanian Dinar\nJPY	Japanese Yen\nKES	Kenyan Shilling\nKGS	Kyrgystani Som\nKHR	Cambodian Riel\nKMF	Comorian Franc\nKPW	North Korean Won\nKRW	South Korean Won\nKWD	Kuwaiti Dinar\nKYD	Cayman Islands Dollar\nKZT	Kazakhstan Tenge\nLAK	Laotian Kip\nLBP	Lebanese Pound\nLKR	Sri Lankan Rupee\nLRD	Liberian Dollar\nLSL	Lesotho Loti\nLYD	Libyan Dinar\nMAD	Moroccan Dirham\nMDL	Moldovan Leu\nMGA	Malagasy Ariary\nMKD	Macedonian Denar\nMMK	Myanma Kyat\nMNT	Mongolian Tugrik\nMOP	Macau Pataca\nMRO	Mauritanian Ouguiya\nMUR	Mauritian Rupee\nMVR	Maldivian Rufiyaa\nMWK	Malawi Kwacha\nMXN	Mexican Peso\nMYR	Malaysian Ringgit\nMZN	Mozambican Metical\nNAD	Namibian Dollar\nNGN	Nigerian Naira\nNIO	Nicaragua Cordoba\nNOK	Norwegian Krone\nNPR	Nepalese Rupee\nNZD	New Zealand Dollar\nOMR	Omani Rial\nPAB	Panamanian Balboa\nPEN	Peruvian Nuevo Sol\nPGK	Papua New Guinean Kina\nPHP	Philippine Peso\nPKR	Pakistani Rupee\nPLN	Polish Zloty\nPYG	Paraguayan Guarani\nQAR	Qatari Riyal\nRON	Romanian Leu\nRSD	Serbian Dinar\nRUB	Russian Ruble\nRWF	Rwanda Franc\nSAR	Saudi Riyal\nSBD	Solomon Islands Dollar\nSCR	Seychellois Rupee\nSDG	Sudanese Pound\nSEK	Swedish Krona\nSGD	Singapore Dollar\nSHP	Saint Helena Pound\nSLL	Sierra Leonean Leone\nSOS	Somali Shilling\nSRD	Surinamese Dollar\nSSP	South Sudanese Pound\nSTD	Sao Tome and Principe Dobra\nSYP	Syrian Pound\nSZL	Swazi Lilangeni\nTHB	Thai Baht\nTJS	Tajikistan Somoni\nTMT	Turkmenistani Manat\nTND	Tunisian Dinar\nTOP	Tonga Paanga\nTRY	Turkish Lira\nTTD	Trinidad and Tobago Dollar\nTWD	New Taiwan Dollar\nTZS	Tanzanian Shilling\nUAH	Ukrainian Hryvnia\nUGX	Ugandan Shilling\nUSD	United States Dollar\nUYU	Uruguayan Peso\nUZS	Uzbekistan Som\nVEF	Venezuelan Bolivar\nVND	Vietnamese Dong\nVUV	Vanuatu Vatu\nWST	Samoan Tala\nXAF	Central African CFA franc\nXCD	East Caribbean Dollar\nXOF	West African CFA franc\nXPF	CFP Franc\nYER	Yemeni Rial\nZAR	South African Rand\nZMW	Zambian Kwacha\n'





def 			lowerCamelCase_ (					__lowerCAmelCase = "USD"   ,    __lowerCAmelCase = "INR"   ,    __lowerCAmelCase = 1.0   ,    __lowerCAmelCase = ""				)							->					str:




						'''simple docstring'''



						lowerCamelCase__					=locals()
						# from is a reserved keyword
						lowerCamelCase__					=params.pop("from_"				)
						lowerCamelCase__					=requests.get(__lowerCAmelCase   ,    params=__lowerCAmelCase				).json()
						return str(res["amount"]				) if res["error"] == 0 else res["error_message"]


if __name__ == "__main__":
	a							=os.getenv('CI', '')
	a							=os.getenv('AMDOREN_API_KEY', '')

	if not API_KEY and not TESTING:
		raise KeyError(
		    'API key must be provided in the \'AMDOREN_API_KEY\' environment variable.'
		)

	print(
	    convert_currency(
	        input('Enter from currency: ').strip(),
	        input('Enter to currency: ').strip(),
	        float(input('Enter the amount: ').strip()),
	        API_KEY,
	    )
	)



import os
import warnings
from pathlib import Path
from typing import Optional, Union

from .dynamic_module_utils import custom_object_save
from .tokenization_utils_base import PreTrainedTokenizerBase
from .utils import PushToHubMixin, copy_func, direct_transformers_import, logging


UpperCAmelCase							= logging.get_logger(__name__)

# Dynamically import the Transformers module to grab the attribute classes of the processor form their names.
UpperCAmelCase							= direct_transformers_import(Path(__file__).parent)


UpperCAmelCase							= {
    '''AutoTokenizer''': '''PreTrainedTokenizerBase''',
    '''AutoFeatureExtractor''': '''FeatureExtractionMixin''',
    '''AutoImageProcessor''': '''ImageProcessingMixin''',
}




class       __lowerCAmelCase     (				a_  ):



 '''simple docstring'''
 _lowerCamelCase  :		Optional[int] 			=       ['feature_extractor', 'tokenizer']
 # Names need to be attr_class for attr in attributes
 _lowerCamelCase  :		List[Any] 			=       None
 _lowerCamelCase  :		Optional[Any] 			=       None
 _lowerCamelCase  :		Tuple 			=       None

 def __init__(	self				:						Tuple				,	*lowerCamelCase				:						Optional[Any]				,	**lowerCamelCase				:						List[Any]     )       ->							str:
        # Sanitize args and kwargs
        for key in kwargs:
               if key not in self.attributes:
                      raise TypeError(f"Unexpected keyword argument {key}."     )
        for arg, attribute_name in zip(lowerCamelCase				,	self.attributes     ):
               if attribute_name in kwargs:
                      raise TypeError(f"Got multiple values for argument {attribute_name}."     )
               else:
                      _UpperCamelCase   :				Any       =     arg

        if len(lowerCamelCase     ) != len(self.attributes     ):
               raise ValueError(
                   f"This processor requires {len(self.attributes     )} arguments: {', '.join(self.attributes     )}. Got "
                   f"{len(lowerCamelCase     )} arguments instead."     )

        # Check each arg is of the proper class (this will also catch a user initializing in the wrong order)
        for attribute_name, arg in kwargs.items():
               _UpperCamelCase   :				Union[str, Any]       =     getattr(self				,	f"{attribute_name}_class"     )
               # Nothing is ever going to be an instance of "AutoXxx", in that case we check the base class.
               _UpperCamelCase   :				str       =     AUTO_TO_BASE_CLASS_MAPPING.get(lowerCamelCase				,	lowerCamelCase     )
               if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      _UpperCamelCase   :				int       =     tuple(getattr(lowerCamelCase				,	lowerCamelCase     ) for n in class_name if n is not None     )
               else:
                      _UpperCamelCase   :				Optional[int]       =     getattr(lowerCamelCase				,	lowerCamelCase     )

               if not isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      raise ValueError(
                          f"Received a {type(lowerCamelCase     ).__name__} for argument {attribute_name}, but a {class_name} was expected."     )

               setattr(self				,	lowerCamelCase				,	lowerCamelCase     )

 def __repr__(	self				:						Dict     )       ->							str:
        _UpperCamelCase   :				List[str]       =     [f"- {name}: {repr(getattr(self				,	lowerCamelCase     )     )}" for name in self.attributes]
        _UpperCamelCase   :				int       =     '\n'.join(lowerCamelCase     )
        return f"{self.__class__.__name__}:\n{attributes_repr}"

 def     __snake_case    (	self				:						Tuple				,	lowerCamelCase				:						int				,	lowerCamelCase				:						bool = False				,	**lowerCamelCase				:						Optional[Any]     )       ->							Any:
        os.makedirs(lowerCamelCase				,	exist_ok=lowerCamelCase     )

        if push_to_hub:
               _UpperCamelCase   :				Optional[int]       =     kwargs.pop('commit_message'				,	lowerCamelCase     )
               _UpperCamelCase   :				List[Any]       =     kwargs.pop('repo_id'				,	save_directory.split(os.path.sep     )[-1]     )
               _UpperCamelCase   :				Optional[int]       =     self._create_repo(lowerCamelCase				,	**lowerCamelCase     )
               _UpperCamelCase   :				List[str]       =     self._get_files_timestamps(lowerCamelCase     )
        # If we have a custom config, we copy the file defining it in the folder and set the attributes so it can be
        # loaded from the Hub.
        if self._auto_class is not None:
               _UpperCamelCase   :				Optional[int]       =     [getattr(self				,	lowerCamelCase     ) for attribute_name in self.attributes]
               _UpperCamelCase   :				int       =     [(a.init_kwargs if isinstance(lowerCamelCase				,	lowerCamelCase     ) else a) for a in attrs]
               custom_object_save(self				,	lowerCamelCase				,	config=lowerCamelCase     )

        for attribute_name in self.attributes:
               _UpperCamelCase   :				int       =     getattr(self				,	lowerCamelCase     )
               # Include the processor class in the attribute config so this processor can then be reloaded with the
               # `AutoProcessor` API.
               if hasattr(lowerCamelCase				,	'_set_processor_class'     ):
                      attribute._set_processor_class(self.__class__.__name__     )
               attribute.save_pretrained(lowerCamelCase     )

        if self._auto_class is not None:
               # We added an attribute to the init_kwargs of the tokenizers, which needs to be cleaned up.
               for attribute_name in self.attributes:
                      _UpperCamelCase   :				Optional[Any]       =     getattr(self				,	lowerCamelCase     )
                      if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                             del attribute.init_kwargs["auto_map"]

        if push_to_hub:
               self._upload_modified_files(
                   lowerCamelCase				,	lowerCamelCase				,	lowerCamelCase				,	commit_message=lowerCamelCase				,	token=kwargs.get('use_auth_token'     )				,	)

 @classmethod
 def     __snake_case    (	cls				:						Tuple				,	lowerCamelCase				:						Union[str, os.PathLike]				,	lowerCamelCase				:						Optional[Union[str, os.PathLike]] = None				,	lowerCamelCase				:						bool = False				,	lowerCamelCase				:						bool = False				,	lowerCamelCase				:						Optional[Union[str, bool]] = None				,	lowerCamelCase				:						str = "main"				,	**lowerCamelCase				:						Tuple				,	)       ->							Optional[Any]:
        _UpperCamelCase   :				Any       =     cache_dir
        _UpperCamelCase   :				Optional[int]       =     force_download
        _UpperCamelCase   :				int       =     local_files_only
        _UpperCamelCase   :				Dict       =     revision

        _UpperCamelCase   :				Optional[Any]       =     kwargs.pop('use_auth_token'				,	lowerCamelCase     )
        if use_auth_token is not None:
               warnings.warn(
                   'The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.'				,	lowerCamelCase     )
               if token is not None:
                      raise ValueError(
                          '`token` and `use_auth_token` are both specified. Please set only the argument `token`.'     )
               _UpperCamelCase   :				Optional[int]       =     use_auth_token

        if token is not None:
               # change to `token` in a follow-up PR
               _UpperCamelCase   :				List[Any]       =     token

        _UpperCamelCase   :				List[Any]       =     cls._get_arguments_from_pretrained(lowerCamelCase				,	**lowerCamelCase     )
        return cls(*lowerCamelCase     )

 @classmethod
 def     __snake_case    (	cls				:						Dict				,	lowerCamelCase				:						Optional[Any]="AutoProcessor"     )       ->							Optional[int]:
        if not isinstance(lowerCamelCase				,	lowerCamelCase     ):
               _UpperCamelCase   :				Tuple       =     auto_class.__name__

        import transformers.models.auto as auto_module

        if not hasattr(lowerCamelCase				,	lowerCamelCase     ):
               raise ValueError(f"{auto_class} is not a valid auto class."     )

        _UpperCamelCase   :				Union[str, Any]       =     auto_class

 @classmethod
 def     __snake_case    (	cls				:						int				,	lowerCamelCase				:						Any				,	**lowerCamelCase				:						List[Any]     )       ->							Optional[Any]:
        _UpperCamelCase   :				Optional[int]       =     []
        for attribute_name in cls.attributes:
               _UpperCamelCase   :				Dict       =     getattr(cls				,	f"{attribute_name}_class"     )
               if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      _UpperCamelCase   :				Any       =     tuple(getattr(lowerCamelCase				,	lowerCamelCase     ) if n is not None else None for n in class_name     )
                      _UpperCamelCase   :				List[Any]       =     kwargs.get('use_fast'				,	lowerCamelCase     )
                      if use_fast and classes[1] is not None:
                             _UpperCamelCase   :				Optional[int]       =     classes[1]
                      else:
                             _UpperCamelCase   :				Any       =     classes[0]
               else:
                      _UpperCamelCase   :				Any       =     getattr(lowerCamelCase				,	lowerCamelCase     )

               args.append(attribute_class.from_pretrained(lowerCamelCase				,	**lowerCamelCase     )     )
        return args

 @property
 def     __snake_case    (	self				:						List[Any]     )       ->							Optional[Any]:
        _UpperCamelCase   :				List[str]       =     getattr(self				,	self.attributes[0]     )
        return getattr(lowerCamelCase				,	'model_input_names'				,	lowerCamelCase     )







UpperCAmelCase							= copy_func(ProcessorMixin.push_to_hub)
if ProcessorMixin.push_to_hub.__doc__ is not None:
 UpperCAmelCase							= ProcessorMixin.push_to_hub.__doc__.format(
     object='''processor''', object_class='''AutoProcessor''', object_files='''processor files'''
 )



