[docs]defauthenticate()->Client:"""Authenticate using the Amadeus API"""try:fromamadeusimportClientexceptImportErrorase:raiseImportError("Cannot import amadeus. Please install the package with ""`pip install amadeus`.")fromeif"AMADEUS_CLIENT_ID"inos.environand"AMADEUS_CLIENT_SECRET"inos.environ:client_id=os.environ["AMADEUS_CLIENT_ID"]client_secret=os.environ["AMADEUS_CLIENT_SECRET"]else:logger.error("Error: The AMADEUS_CLIENT_ID and AMADEUS_CLIENT_SECRET environmental ""variables have not been set. Visit the following link on how to ""acquire these authorization tokens: ""https://developers.amadeus.com/register")returnNonehostname="test"# Default hostnameif"AMADEUS_HOSTNAME"inos.environ:hostname=os.environ["AMADEUS_HOSTNAME"]client=Client(client_id=client_id,client_secret=client_secret,hostname=hostname)returnclient