A client calls flaky external services. At most max_concurrent calls may be in flight at once (a semaphore), and a failed call is retried after an exponentially growing wait. Simulate the run on a logical clock and report how each task ended.
Implement run_with_retries(tasks, max_concurrent, base_delay, max_retries) and return a list with one tuple (name, status, attempts, end_time) per task, in the input order.
tasks: a list of (name, duration, outcomes). Every attempt of the task takes duration time units (a positive integer). outcomes[a] is True if attempt number a (0-based) succeeds and False if it fails; attempts beyond the end of outcomes succeed.max_concurrent: positive integer, the number of slots. A slot is held only while an attempt runs, not while waiting to retry.base_delay: positive integer. After failed attempt a, if a < max_retries, the task becomes ready again at finish_time + base_delay * 2**a. Otherwise it ends with status "failed".status is "ok" or "failed", attempts is the number of attempts made, and end_time is the finish time of the last attempt.Scheduling rules:
tasks.