REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.63 KB
Close
/opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/plugins/generic/burster/utils.py
Text
Base64
# 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
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
storage
DIR
-
drwxr-xr-x
2026-06-03 07:00:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-06-03 07:00:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
adjust.py
7.36 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
common.py
4.56 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
config.py
7.96 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
history.py
9.79 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lves_tracker.py
8.92 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lve_sm.py
18.40 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
notify.py
1.64 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
overload.py
3.23 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
profiler.py
10.30 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.py
1.63 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_logs.py
597 B
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
8.53 KB
lrw-r--r--
2026-05-20 17:45:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).