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

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/opt/alt/python37/lib64/python3.7/site-packages/pyrsistent/   drwxr-xr-x
Free 234.02 GB of 981.82 GB (23.84%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     _transformations.py (3.5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import re
import six
try:
    from inspect import Parameter, signature
except ImportError:
    signature = None
    try:
        from inspect import getfullargspec as getargspec
    except ImportError:
        from inspect import getargspec


def inc(x):
    """ Add one to the current value """
    return x + 1


def dec(x):
    """ Subtract one from the current value """
    return x - 1


def discard(evolver, key):
    """ Discard the element and returns a structure without the discarded elements """
    try:
        del evolver[key]
    except KeyError:
        pass


# Matchers
def rex(expr):
    """ Regular expression matcher to use together with transform functions """
    r = re.compile(expr)
    return lambda key: isinstance(key, six.string_types) and r.match(key)


def ny(_):
    """ Matcher that matches any value """
    return True

# Support functions
def _chunks(l, n):
    for i in range(0, len(l), n):
        yield l[i:i + n]


def transform(structure, transformations):
    r = structure
    for path, command in _chunks(transformations, 2):
        r = _do_to_path(r, path, command)
    return r


def _do_to_path(structure, path, command):
    if not path:
        return command(structure) if callable(command) else command

    kvs = _get_keys_and_values(structure, path[0])
    return _update_structure(structure, kvs, path[1:], command)


def _items(structure):
    try:
        return structure.items()
    except AttributeError:
        # Support wider range of structures by adding a transform_items() or similar?
        return list(enumerate(structure))


def _get(structure, key, default):
    try:
        if hasattr(structure, '__getitem__'):
            return structure[key]

        return getattr(structure, key)

    except (IndexError, KeyError):
        return default


def _get_keys_and_values(structure, key_spec):
    from pyrsistent._pmap import pmap
    if callable(key_spec):
        # Support predicates as callable objects in the path
        arity = _get_arity(key_spec)
        if arity == 1:
            # Unary predicates are called with the "key" of the path
            # - eg a key in a mapping, an index in a sequence.
            return [(k, v) for k, v in _items(structure) if key_spec(k)]
        elif arity == 2:
            # Binary predicates are called with the key and the corresponding
            # value.
            return [(k, v) for k, v in _items(structure) if key_spec(k, v)]
        else:
            # Other arities are an error.
            raise ValueError(
                "callable in transform path must take 1 or 2 arguments"
            )

    # Non-callables are used as-is as a key.
    return [(key_spec, _get(structure, key_spec, pmap()))]


if signature is None:
    def _get_arity(f):
        argspec = getargspec(f)
        return len(argspec.args) - len(argspec.defaults or ())
else:
    def _get_arity(f):
        return sum(
            1
            for p
            in signature(f).parameters.values()
            if p.default is Parameter.empty
            and p.kind in (Parameter.POSITIONAL_ONLY, Parameter.POSITIONAL_OR_KEYWORD)
        )

def _update_structure(structure, kvs, path, command):
    e = structure.evolver()
    if not path and command is discard:
        # Do this in reverse to avoid index problems with vectors. See #92.
        for k, v in reversed(kvs):
            discard(e, k)
    else:
        for k, v in kvs:
            result = _do_to_path(v, path, command)
            if result is not v:
                e[k] = result

    return e.persistent()

:: 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.0091 ]--