How do you handle API rate limiting and retries when writing automation scripts that interact with cloud providers?