SILENT KILLERPanel

Current Path: > > opt > > alt > python313 > lib64 > > > python3.13


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt//alt/python313/lib64///python3.13

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
_pyrepl Directory - -
asyncio Directory - -
collections Directory - -
concurrent Directory - -
config-3.13-x86_64-linux-gnu Directory - -
ctypes Directory - -
curses Directory - -
dbm Directory - -
email Directory - -
encodings Directory - -
ensurepip Directory - -
html Directory - -
http Directory - -
importlib Directory - -
json Directory - -
lib-dynload Directory - -
logging Directory - -
multiprocessing Directory - -
pathlib Directory - -
pydoc_data Directory - -
re Directory - -
site-packages Directory - -
sqlite3 Directory - -
sysconfig Directory - -
tomllib Directory - -
unittest Directory - -
urllib Directory - -
venv Directory - -
wsgiref Directory - -
xml Directory - -
xmlrpc Directory - -
zipfile Directory - -
zoneinfo Directory - -
LICENSE.txt File 13809 bytes June 11 2025 15:36:57.
__future__.py File 5218 bytes June 23 2025 14:28:17.
__hello__.py File 227 bytes June 23 2025 14:28:17.
_aix_support.py File 4021 bytes June 23 2025 14:28:16.
_android_support.py File 6895 bytes June 23 2025 14:28:03.
_apple_support.py File 2256 bytes June 23 2025 14:28:16.
_collections_abc.py File 32264 bytes June 23 2025 14:28:03.
_colorize.py File 2848 bytes June 23 2025 14:28:03.
_compat_pickle.py File 8735 bytes June 23 2025 14:28:15.
_compression.py File 5681 bytes June 23 2025 14:28:03.
_ios_support.py File 2672 bytes June 23 2025 14:28:16.
_markupbase.py File 14653 bytes June 23 2025 14:28:03.
_opcode_metadata.py File 9265 bytes June 23 2025 14:28:16.
_osx_support.py File 22023 bytes June 23 2025 14:28:16.
_py_abc.py File 6189 bytes June 23 2025 14:28:16.
_pydatetime.py File 91990 bytes June 23 2025 14:28:17.
_pydecimal.py File 227283 bytes June 23 2025 14:28:02.
_pyio.py File 93693 bytes June 23 2025 14:28:04.
_pylong.py File 11830 bytes June 23 2025 14:28:03.
_sitebuiltins.py File 3128 bytes June 23 2025 14:28:03.
_strptime.py File 29383 bytes June 23 2025 14:28:16.
_sysconfigdata__linux_x86_64-linux-gnu.py File 67303 bytes June 23 2025 14:37:34.
_sysconfigdata_d_linux_x86_64-linux-gnu.py File 67285 bytes June 23 2025 14:31:05.
_threading_local.py File 4363 bytes June 23 2025 14:28:03.
_weakrefset.py File 5893 bytes June 23 2025 14:28:03.
abc.py File 6538 bytes June 23 2025 14:28:03.
antigravity.py File 500 bytes June 23 2025 14:28:03.
argparse.py File 101661 bytes June 23 2025 14:28:16.
ast.py File 65339 bytes June 23 2025 14:28:16.
base64.py File 21643 bytes June 23 2025 14:28:03.
bdb.py File 35343 bytes June 23 2025 14:28:15.
bisect.py File 3423 bytes June 23 2025 14:28:02.
bz2.py File 11969 bytes June 23 2025 14:28:16.
cProfile.py File 6637 bytes June 23 2025 14:28:02.
calendar.py File 26077 bytes June 23 2025 14:28:16.
cmd.py File 15316 bytes June 23 2025 14:28:02.
code.py File 13170 bytes June 23 2025 14:28:03.
codecs.py File 36928 bytes June 23 2025 14:28:03.
codeop.py File 5828 bytes June 23 2025 14:28:03.
colorsys.py File 4062 bytes June 23 2025 14:28:03.
compileall.py File 20665 bytes June 23 2025 14:28:03.
configparser.py File 53831 bytes June 23 2025 14:28:03.
contextlib.py File 27801 bytes June 23 2025 14:28:03.
contextvars.py File 129 bytes June 23 2025 14:28:15.
copy.py File 8975 bytes June 23 2025 14:28:03.
copyreg.py File 7614 bytes June 23 2025 14:28:16.
csv.py File 19178 bytes June 23 2025 14:28:03.
dataclasses.py File 64545 bytes June 23 2025 14:28:16.
datetime.py File 268 bytes June 23 2025 14:28:17.
decimal.py File 2798 bytes June 23 2025 14:28:16.
difflib.py File 83368 bytes June 23 2025 14:28:03.
dis.py File 40962 bytes June 23 2025 14:28:03.
doctest.py File 109333 bytes June 23 2025 14:28:03.
enum.py File 85578 bytes June 23 2025 14:28:03.
filecmp.py File 10652 bytes June 23 2025 14:28:03.
fileinput.py File 15717 bytes June 23 2025 14:28:03.
fnmatch.py File 6180 bytes June 23 2025 14:28:03.
fractions.py File 40021 bytes June 23 2025 14:28:02.
ftplib.py File 34735 bytes June 23 2025 14:28:03.
functools.py File 39123 bytes June 23 2025 14:28:17.
genericpath.py File 6247 bytes June 23 2025 14:28:17.
getopt.py File 7488 bytes June 23 2025 14:28:16.
getpass.py File 6233 bytes June 23 2025 14:28:02.
gettext.py File 21534 bytes June 23 2025 14:28:16.
glob.py File 19720 bytes June 23 2025 14:28:03.
graphlib.py File 9648 bytes June 23 2025 14:28:02.
gzip.py File 24633 bytes June 23 2025 14:28:16.
hashlib.py File 9446 bytes June 23 2025 14:28:17.
heapq.py File 23024 bytes June 23 2025 14:28:02.
hmac.py File 7716 bytes June 23 2025 14:28:04.
imaplib.py File 54040 bytes June 23 2025 14:28:16.
inspect.py File 128276 bytes June 23 2025 14:28:15.
io.py File 3582 bytes June 23 2025 14:28:03.
ipaddress.py File 81635 bytes June 23 2025 14:28:16.
keyword.py File 1073 bytes June 23 2025 14:28:16.
linecache.py File 7284 bytes June 23 2025 14:28:03.
locale.py File 79033 bytes June 23 2025 14:28:15.
lzma.py File 13399 bytes June 23 2025 14:28:16.
mailbox.py File 81644 bytes June 23 2025 14:28:15.
mimetypes.py File 23851 bytes June 23 2025 14:28:15.
modulefinder.py File 23792 bytes June 23 2025 14:28:03.
netrc.py File 6922 bytes June 23 2025 14:28:04.
ntpath.py File 32806 bytes June 23 2025 14:28:03.
nturl2path.py File 2374 bytes June 23 2025 14:28:16.
numbers.py File 11467 bytes June 23 2025 14:28:17.
opcode.py File 2825 bytes June 23 2025 14:28:17.
operator.py File 10980 bytes June 23 2025 14:28:15.
optparse.py File 60369 bytes June 23 2025 14:28:16.
os.py File 41635 bytes June 23 2025 14:28:03.
pdb.py File 90938 bytes June 23 2025 14:28:03.
pickle.py File 66957 bytes June 23 2025 14:28:03.
pickletools.py File 94052 bytes June 23 2025 14:28:03.
pkgutil.py File 18281 bytes June 23 2025 14:28:03.
platform.py File 47359 bytes June 23 2025 14:28:03.
plistlib.py File 29794 bytes June 23 2025 14:28:02.
poplib.py File 14604 bytes June 23 2025 14:28:02.
posixpath.py File 18360 bytes June 23 2025 14:28:03.
pprint.py File 24158 bytes June 23 2025 14:28:03.
profile.py File 23153 bytes June 23 2025 14:28:03.
pstats.py File 29296 bytes June 23 2025 14:28:03.
pty.py File 6137 bytes June 23 2025 14:28:02.
py_compile.py File 7837 bytes June 23 2025 14:28:16.
pyclbr.py File 11396 bytes June 23 2025 14:28:02.
pydoc.py File 110078 bytes June 23 2025 14:28:03.
queue.py File 13481 bytes June 23 2025 14:28:16.
quopri.py File 7197 bytes June 23 2025 14:28:16.
random.py File 37006 bytes June 23 2025 14:28:02.
reprlib.py File 7192 bytes June 23 2025 14:28:03.
rlcompleter.py File 7918 bytes June 23 2025 14:28:17.
runpy.py File 12885 bytes June 23 2025 14:28:02.
sched.py File 6351 bytes June 23 2025 14:28:16.
secrets.py File 1984 bytes June 23 2025 14:28:04.
selectors.py File 19457 bytes June 23 2025 14:28:03.
shelve.py File 8810 bytes June 23 2025 14:28:16.
shlex.py File 13353 bytes June 23 2025 14:28:17.
shutil.py File 57463 bytes June 23 2025 14:28:16.
signal.py File 2495 bytes June 23 2025 14:28:15.
site.py File 25568 bytes June 23 2025 14:28:15.
smtplib.py File 43545 bytes June 23 2025 14:28:03.
socket.py File 37759 bytes June 23 2025 14:28:17.
socketserver.py File 28065 bytes June 23 2025 14:28:17.
sre_compile.py File 231 bytes June 23 2025 14:28:03.
sre_constants.py File 232 bytes June 23 2025 14:28:03.
sre_parse.py File 229 bytes June 23 2025 14:28:03.
ssl.py File 52706 bytes June 23 2025 14:28:15.
stat.py File 6147 bytes June 23 2025 14:28:16.
statistics.py File 61831 bytes June 23 2025 14:28:03.
string.py File 11786 bytes June 23 2025 14:28:16.
stringprep.py File 12917 bytes June 23 2025 14:28:03.
struct.py File 257 bytes June 23 2025 14:28:03.
subprocess.py File 89486 bytes June 23 2025 14:28:02.
symtable.py File 14207 bytes June 23 2025 14:28:16.
tabnanny.py File 11545 bytes June 23 2025 14:28:16.
tarfile.py File 114095 bytes June 23 2025 14:28:03.
tempfile.py File 32366 bytes June 23 2025 14:28:02.
textwrap.py File 19939 bytes June 23 2025 14:28:03.
this.py File 1003 bytes June 23 2025 14:28:03.
threading.py File 55244 bytes June 23 2025 14:28:15.
timeit.py File 13477 bytes June 23 2025 14:28:03.
token.py File 2489 bytes June 23 2025 14:28:03.
tokenize.py File 21568 bytes June 23 2025 14:28:16.
trace.py File 29728 bytes June 23 2025 14:28:02.
traceback.py File 66524 bytes June 23 2025 14:28:16.
tracemalloc.py File 18047 bytes June 23 2025 14:28:16.
tty.py File 2035 bytes June 23 2025 14:28:02.
types.py File 11207 bytes June 23 2025 14:28:02.
typing.py File 132718 bytes June 23 2025 14:28:16.
uuid.py File 29141 bytes June 23 2025 14:28:03.
warnings.py File 26948 bytes June 23 2025 14:28:03.
wave.py File 23236 bytes June 23 2025 14:28:03.
weakref.py File 21513 bytes June 23 2025 14:28:16.
webbrowser.py File 24298 bytes June 23 2025 14:28:16.
zipapp.py File 8618 bytes June 23 2025 14:28:03.
zipimport.py File 32890 bytes June 23 2025 14:28:16.

Reading File: //opt//alt/python313/lib64///python3.13/_android_support.py

import io
import sys
from threading import RLock
from time import sleep, time

# The maximum length of a log message in bytes, including the level marker and
# tag, is defined as LOGGER_ENTRY_MAX_PAYLOAD at
# https://cs.android.com/android/platform/superproject/+/android-14.0.0_r1:system/logging/liblog/include/log/log.h;l=71.
# Messages longer than this will be truncated by logcat. This limit has already
# been reduced at least once in the history of Android (from 4076 to 4068 between
# API level 23 and 26), so leave some headroom.
MAX_BYTES_PER_WRITE = 4000

# UTF-8 uses a maximum of 4 bytes per character, so limiting text writes to this
# size ensures that we can always avoid exceeding MAX_BYTES_PER_WRITE.
# However, if the actual number of bytes per character is smaller than that,
# then we may still join multiple consecutive text writes into binary
# writes containing a larger number of characters.
MAX_CHARS_PER_WRITE = MAX_BYTES_PER_WRITE // 4


# When embedded in an app on current versions of Android, there's no easy way to
# monitor the C-level stdout and stderr. The testbed comes with a .c file to
# redirect them to the system log using a pipe, but that wouldn't be convenient
# or appropriate for all apps. So we redirect at the Python level instead.
def init_streams(android_log_write, stdout_prio, stderr_prio):
    if sys.executable:
        return  # Not embedded in an app.

    global logcat
    logcat = Logcat(android_log_write)

    sys.stdout = TextLogStream(
        stdout_prio, "python.stdout", sys.stdout.fileno())
    sys.stderr = TextLogStream(
        stderr_prio, "python.stderr", sys.stderr.fileno())


class TextLogStream(io.TextIOWrapper):
    def __init__(self, prio, tag, fileno=None, **kwargs):
        # The default is surrogateescape for stdout and backslashreplace for
        # stderr, but in the context of an Android log, readability is more
        # important than reversibility.
        kwargs.setdefault("encoding", "UTF-8")
        kwargs.setdefault("errors", "backslashreplace")

        super().__init__(BinaryLogStream(prio, tag, fileno), **kwargs)
        self._lock = RLock()
        self._pending_bytes = []
        self._pending_bytes_count = 0

    def __repr__(self):
        return f"<TextLogStream {self.buffer.tag!r}>"

    def write(self, s):
        if not isinstance(s, str):
            raise TypeError(
                f"write() argument must be str, not {type(s).__name__}")

        # In case `s` is a str subclass that writes itself to stdout or stderr
        # when we call its methods, convert it to an actual str.
        s = str.__str__(s)

        # We want to emit one log message per line wherever possible, so split
        # the string into lines first. Note that "".splitlines() == [], so
        # nothing will be logged for an empty string.
        with self._lock:
            for line in s.splitlines(keepends=True):
                while line:
                    chunk = line[:MAX_CHARS_PER_WRITE]
                    line = line[MAX_CHARS_PER_WRITE:]
                    self._write_chunk(chunk)

        return len(s)

    # The size and behavior of TextIOWrapper's buffer is not part of its public
    # API, so we handle buffering ourselves to avoid truncation.
    def _write_chunk(self, s):
        b = s.encode(self.encoding, self.errors)
        if self._pending_bytes_count + len(b) > MAX_BYTES_PER_WRITE:
            self.flush()

        self._pending_bytes.append(b)
        self._pending_bytes_count += len(b)
        if (
            self.write_through
            or b.endswith(b"\n")
            or self._pending_bytes_count > MAX_BYTES_PER_WRITE
        ):
            self.flush()

    def flush(self):
        with self._lock:
            self.buffer.write(b"".join(self._pending_bytes))
            self._pending_bytes.clear()
            self._pending_bytes_count = 0

    # Since this is a line-based logging system, line buffering cannot be turned
    # off, i.e. a newline always causes a flush.
    @property
    def line_buffering(self):
        return True


class BinaryLogStream(io.RawIOBase):
    def __init__(self, prio, tag, fileno=None):
        self.prio = prio
        self.tag = tag
        self._fileno = fileno

    def __repr__(self):
        return f"<BinaryLogStream {self.tag!r}>"

    def writable(self):
        return True

    def write(self, b):
        if type(b) is not bytes:
            try:
                b = bytes(memoryview(b))
            except TypeError:
                raise TypeError(
                    f"write() argument must be bytes-like, not {type(b).__name__}"
                ) from None

        # Writing an empty string to the stream should have no effect.
        if b:
            logcat.write(self.prio, self.tag, b)
        return len(b)

    # This is needed by the test suite --timeout option, which uses faulthandler.
    def fileno(self):
        if self._fileno is None:
            raise io.UnsupportedOperation("fileno")
        return self._fileno


# When a large volume of data is written to logcat at once, e.g. when a test
# module fails in --verbose3 mode, there's a risk of overflowing logcat's own
# buffer and losing messages. We avoid this by imposing a rate limit using the
# token bucket algorithm, based on a conservative estimate of how fast `adb
# logcat` can consume data.
MAX_BYTES_PER_SECOND = 1024 * 1024

# The logcat buffer size of a device can be determined by running `logcat -g`.
# We set the token bucket size to half of the buffer size of our current minimum
# API level, because other things on the system will be producing messages as
# well.
BUCKET_SIZE = 128 * 1024

# https://cs.android.com/android/platform/superproject/+/android-14.0.0_r1:system/logging/liblog/include/log/log_read.h;l=39
PER_MESSAGE_OVERHEAD = 28


class Logcat:
    def __init__(self, android_log_write):
        self.android_log_write = android_log_write
        self._lock = RLock()
        self._bucket_level = 0
        self._prev_write_time = time()

    def write(self, prio, tag, message):
        # Encode null bytes using "modified UTF-8" to avoid them truncating the
        # message.
        message = message.replace(b"\x00", b"\xc0\x80")

        with self._lock:
            now = time()
            self._bucket_level += (
                (now - self._prev_write_time) * MAX_BYTES_PER_SECOND)

            # If the bucket level is still below zero, the clock must have gone
            # backwards, so reset it to zero and continue.
            self._bucket_level = max(0, min(self._bucket_level, BUCKET_SIZE))
            self._prev_write_time = now

            self._bucket_level -= PER_MESSAGE_OVERHEAD + len(tag) + len(message)
            if self._bucket_level < 0:
                sleep(-self._bucket_level / MAX_BYTES_PER_SECOND)

            self.android_log_write(prio, tag, message)

SILENT KILLER Tool