$74 GRAYBYTE WORDPRESS FILE MANAGER $53

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster//utils.py
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2023 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
"""Utility stuff which is not directly related to the plugin domain itself."""""
import functools
import itertools
from typing import Any, Callable, Generator, Iterator, Iterable, TypeVar

from ._logs import logger

_T = TypeVar('_T')


# NOTE(vlebedev): Taken from https://docs.python.org/3/library/itertools.html#itertools.batched
# TODO(vlebedev): Remove once codebase is updated to Python >= 3.12
def batched(iterable: Iterable[_T], n: int) -> Iterator[tuple[_T, ...]]:
    """batched('ABCDEFG', 3) --> ABC DEF G

    Batch data into tuples of length n. The last batch may be shorter."""

    if n < 1:
        raise ValueError('n must be at least one')
    it = iter(iterable)
    while batch := tuple(itertools.islice(it, n)):
        yield batch


def repeast_last(upstream: Iterable[_T]) -> Iterator[_T]:
    for item in upstream:
        last = item
        yield item
    while True:
        try:
            yield last
        except NameError:
            return


def bootstrap_gen(func: Callable[..., Generator[Any, Any, Any]]):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        g = func(*args, **kwargs)
        g.send(None)
        return g
    return wrapper


def log_exceptions(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except Exception:
            logger.exception('Function %s failed!', func.__name__)
            raise
    return wrapper

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.25 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.25 PM
root / root
0755
storage
--
14 Aug 2025 9.25 PM
root / root
0755
__init__.py
8.529 KB
30 May 2025 5.30 PM
root / root
0644
_logs.py
0.583 KB
30 May 2025 5.30 PM
root / root
0644
adjust.py
7.362 KB
30 May 2025 5.30 PM
root / root
0644
common.py
4.559 KB
30 May 2025 5.30 PM
root / root
0644
config.py
7.96 KB
30 May 2025 5.30 PM
root / root
0644
history.py
9.795 KB
30 May 2025 5.30 PM
root / root
0644
lve_sm.py
18.402 KB
30 May 2025 5.30 PM
root / root
0644
lves_tracker.py
8.925 KB
30 May 2025 5.30 PM
root / root
0644
notify.py
1.64 KB
30 May 2025 5.30 PM
root / root
0644
overload.py
3.231 KB
30 May 2025 5.30 PM
root / root
0644
profiler.py
10.299 KB
30 May 2025 5.30 PM
root / root
0644
utils.py
1.626 KB
30 May 2025 5.30 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF