[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.151.127: ~ $
import functools
from time import perf_counter, sleep
from typing import Callable, TypeVar

from pip._vendor.typing_extensions import ParamSpec

T = TypeVar("T")
P = ParamSpec("P")


def retry(
    wait: float, stop_after_delay: float
) -> Callable[[Callable[P, T]], Callable[P, T]]:
    """Decorator to automatically retry a function on error.

    If the function raises, the function is recalled with the same arguments
    until it returns or the time limit is reached. When the time limit is
    surpassed, the last exception raised is reraised.

    :param wait: The time to wait after an error before retrying, in seconds.
    :param stop_after_delay: The time limit after which retries will cease,
        in seconds.
    """

    def wrapper(func: Callable[P, T]) -> Callable[P, T]:

        @functools.wraps(func)
        def retry_wrapped(*args: P.args, **kwargs: P.kwargs) -> T:
            # The performance counter is monotonic on all platforms we care
            # about and has much better resolution than time.monotonic().
            start_time = perf_counter()
            while True:
                try:
                    return func(*args, **kwargs)
                except Exception:
                    if perf_counter() - start_time > stop_after_delay:
                        raise
                    sleep(wait)

        return retry_wrapped

    return wrapper

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
_jaraco_text.py File 3.27 KB 0644
_log.py File 1015 B 0644
appdirs.py File 1.63 KB 0644
compat.py File 2.34 KB 0644
compatibility_tags.py File 6.13 KB 0644
datetime.py File 242 B 0644
deprecation.py File 3.62 KB 0644
direct_url_helpers.py File 3.12 KB 0644
egg_link.py File 2.41 KB 0644
encoding.py File 1.14 KB 0644
entrypoints.py File 2.99 KB 0644
filesystem.py File 4.83 KB 0644
filetypes.py File 716 B 0644
glibc.py File 3.65 KB 0644
hashes.py File 4.86 KB 0644
logging.py File 11.33 KB 0644
misc.py File 22.98 KB 0644
packaging.py File 2.06 KB 0644
retry.py File 1.36 KB 0644
setuptools_build.py File 4.33 KB 0644
subprocess.py File 8.78 KB 0644
temp_dir.py File 9.09 KB 0644
unpacking.py File 11.67 KB 0644
urls.py File 1.56 KB 0644
virtualenv.py File 3.38 KB 0644
wheel.py File 4.39 KB 0644