When generating API stubs with the scaffold utility using, e.g., `python -m localstack.aws.scaffold sns`,
the scaffold creates method names from operation names, which are ugly when acronyms (subsequent uppercase characters that belong together).

Example:
`CreateSMSSandboxPhoneNumber` -> `create_s_m_s_sandbox_phone_number`

it would be nicer to have `create_sms_sandbox_phone_number`

This is a limitation of this method: https://github.com/localstack/localstack/blob/1888e66b85d7e6a8ee457bc7a732984fcf7aa830/localstack/utils/common.py#L978-L979
return run_safe(run, print_error=False, **kwargs)
def run_for_max_seconds(max_secs, _function, *args, **kwargs):
    """Run the given function for a maximum of `max_secs` seconds - continue running
    in a background thread if the function does not finish in time."""
    def _worker(*_args):
        try:
            fn_result = _function(*args, **kwargs)
        except Exception as e:
            fn_result = e
        fn_result = True if fn_result is None else fn_result
        q.put(fn_result)
        return fn_result
    start = now()
    q = Queue()
    start_worker_thread(_worker)
    for i in range(max_secs * 2):
        result = None
        try:
            result = q.get_nowait()
        except Exception:
            pass
        if result is not None:
            if isinstance(result, Exception):
                raise result
            return result
        if now() - start >= max_secs:
            return
        time.sleep(0.5)
def do_run(cmd: str, run_cmd: Callable, cache_duration_secs: float):