def run_in_pace(self, func: Callable[[A], B], *args, **kwargs) -> B:
        """Run the given `func` on the given `args` and `kwargs` at pace with the
        endpoint-specified rpm. Failures will be retried `self.retries` times."""

        retries = self.retries + 1
        attempts = 0
        retry_delay = 2.0

        errors = []

        while retries > 0:
            try:
                self.pace_me()
                attempts += 1
                ret = func(*args, **kwargs)
                return ret

            except Exception as e:
                retries -= 1
                logger.error(
                    "%s request failed %s=%s. Retries remaining=%s.",
                    self.name,
                    type(e),
                    e,
                    retries,
                )
                errors.append(e)
                if not self._can_retry(e):
                    break

                if retries > 0:
                    sleep(retry_delay)
                    retry_delay *= 2

        raise RuntimeError(
            f"Endpoint {self.name} request failed {attempts} time(s): \n\t"
            + ("\n\t".join(map(str, errors)))
        )
Run the given `func` on the given `args` and `kwargs` at pace with the
        endpoint-specified rpm. Failures will be retried `self.retries` times.
src/core/trulens/core/feedback/endpoint.py