HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/guppy/etc/etc.py
from io import StringIO


def reptable(tb):
    if not tb:
        return 0, []
    maxlens = [0]*len(tb[0])
    for r in tb:
        if r == '-':
            continue
        for i, e in enumerate(r):
            maxlens[i] = max(maxlens[i], len(str(e))+1)

    sumlens = len(maxlens)
    for s in maxlens:
        sumlens += s

    out = []
    for r in tb:
        if r == '-':
            out.append('-'*min(sumlens, 75))
        else:
            so = ''
            for i, e in enumerate(r):
                s = str(e)
                if s.startswith('!>'):
                    s = s[2:]
                    fillright = 1
                elif s.isdigit():
                    fillright = 1
                else:
                    fillright = 0
                ml = maxlens[i]-1
                fill = ' '*(ml - len(s))
                if fillright:
                    s = fill + s
                else:
                    s = s + fill
                so += s + ' '
            out.append(so)
    return maxlens, out


def ptable(tb, f=None):
    if f is None:
        import sys
        f = sys.stdout
    _, lines = reptable(tb)
    for line in lines:
        line = line.rstrip()
        print(line, file=f)


def strtable(tb):
    f = StringIO()
    ptable(tb, f)
    return f.getvalue()


def str2int(s, msg='Hexadecimal literal in the form [-]0x... expected'):
    # xxx clumsy -- there should be a builtin function for this !
    if s.startswith('-'):
        sign = -1
        s = s[1:]
    else:
        sign = 1
    if not s.startswith('0x'):
        raise ValueError(msg)
    s = s[2:]
    if s.endswith('l') or s.endswith('L'):
        s = s[:-1]
    return int(s, 16) * sign