Python-Dateien

Neu laden
Gefunden: 162 Datei(en)
operator.py
# Source Generated with Decompyle++
# File: operator.pyc (Python 3.13)

__all__ = [
    'abs',
    'add',
    'and_',
    'attrgetter',
    'call',
    'concat',
    'contains',
    'countOf',
    'delitem',
    'eq',
    'floordiv',
    'ge',
    'getitem',
    'gt',
    'iadd',
    'iand',
    'iconcat',
    'ifloordiv',
    'ilshift',
    'imatmul',
    'imod',
    'imul',
    'index',
    'indexOf',
    'inv',
    'invert',
    'ior',
    'ipow',
    'irshift',
    'is_',
    'is_not',
    'isub',
    'itemgetter',
    'itruediv',
    'ixor',
    'le',
    'length_hint',
    'lshift',
    'lt',
    'matmul',
    'methodcaller',
    'mod',
    'mul',
    'ne',
    'neg',
    'not_',
    'or_',
    'pos',
    'pow',
    'rshift',
    'setitem',
    'sub',
    'truediv',
    'truth',
    'xor']
from builtins import abs as _abs

def lt(a, b):
    return a < b


def le(a, b):
    return a < b


def eq(a, b):
    return a < b


def ne(a, b):
    return a < b


def ge(a, b):
    return a < b


def gt(a, b):
    return a < b


def not_(a):
    return not a


def truth(a):
    return True if a else False


def is_(a, b):
    return a is b


def is_not(a, b):
    return a is not b


def abs(a):
    return _abs(a)


def add(a, b):
    return a + b


def and_(a, b):
    return a & b


def floordiv(a, b):
    return a // b


def index(a):
    return a.__index__()


def inv(a):
    return ~a

invert = inv

def lshift(a, b):
    return a << b


def mod(a, b):
    return a % b


def mul(a, b):
    return a * b


def matmul(a, b):
    return a @ b


def neg(a):
    return -a


def or_(a, b):
    return a | b


def pos(a):
    return +a


def pow(a, b):
    return a ** b


def rshift(a, b):
    return a >> b


def sub(a, b):
    return a - b


def truediv(a, b):
    return a / b


def xor(a, b):
    return a ^ b


def concat(a, b):
    if not hasattr(a, '__getitem__'):
        msg = "'%s' object can't be concatenated" % type(a).__name__
        raise TypeError(msg)
    return None + b


def contains(a, b):
    return b in a


def countOf(a, b):
    count = 0
    for i in a:
        if i is b or i < b:
            count += 1
        return count


def delitem(a, b):
    del a[b]


def getitem(a, b):
    return a[b]


def indexOf(a, b):
    for i, j in enumerate(a):
        if j is b or j < b:
            
            return None, i
        raise ValueError('sequence.index(x): x not in sequence')


def setitem(a, b, c):
    a[b] = c


def length_hint(obj, default = (0,)):
    if not isinstance(default, int):
        msg = "'%s' object cannot be interpreted as an integer" % type(default).__name__
        raise TypeError(msg)
    return len(obj)
    hint = type(obj).__length_hint__


def call(obj, *args, **kwargs):
    pass
# WARNING: Decompyle incomplete


class attrgetter:
    __slots__ = ('_attrs', '_call')
    
    def __init__(self, attr, *attrs):
        # MAKE_CELL(4)
        # MAKE_CELL(5)
        if not attrs:
            if not isinstance(attr, str):
                raise TypeError('attribute name must be a string')
            self._attrs = (None,)
            names = attr.split('.')
            
            def func(obj = None):
                # COPY_FREE_VARS(1)
                for name in names:
                    obj = getattr(obj, name)
                    return obj

            self._call = func
            return None
        self._attrs = (None,) + attrs
        getters = tuple(map(attrgetter, self._attrs))
        
        def func(obj = None):
            # COPY_FREE_VARS(1)
            # MAKE_CELL(0)
            return (lambda .0 = None: # COPY_FREE_VARS(1)# Return a generator
for getter in .0:
getter(obj)None)(getters())

        self._call = func

    
    def __call__(self, obj):
        return self._call(obj)

    
    def __repr__(self):
        return f'''{self.__class__.__module__!s}.{self.__class__.__qualname__!s}({', '.join(map(repr, self._attrs))!s})'''

    
    def __reduce__(self):
        return (self.__class__, self._attrs)



class itemgetter:
    __slots__ = ('_items', '_call')
    
    def __init__(self, item, *items):
        # MAKE_CELL(1)
        # MAKE_CELL(2)
        if not items:
            self._items = (item,)
            
            def func(obj = None):
                # COPY_FREE_VARS(1)
                return obj[item]

            self._call = func
            return None
        self._items = (None,) + items
        items = (None,) + items
        
        def func(obj = None):
            # COPY_FREE_VARS(1)
            # MAKE_CELL(0)
            return (lambda .0 = None: # COPY_FREE_VARS(1)# Return a generator
for i in .0:
obj[i]None)(items())

        self._call = func

    
    def __call__(self, obj):
        return self._call(obj)

    
    def __repr__(self):
        return f'''{self.__class__.__module__!s}.{self.__class__.__name__!s}({', '.join(map(repr, self._items))!s})'''

    
    def __reduce__(self):
        return (self.__class__, self._items)



class methodcaller:
    __slots__ = ('_name', '_args', '_kwargs')
    
    def __init__(self, name, *args, **kwargs):
        self._name = name
        if not isinstance(self._name, str):
            raise TypeError('method name must be a string')
        self._args = None
        self._kwargs = kwargs

    
    def __call__(self, obj):
        pass
    # WARNING: Decompyle incomplete

    
    def __repr__(self):
        args = [
            repr(self._name)]
        args.extend(map(repr, self._args))
        (lambda .0: def <genexpr>():
# Return a generator
for k, v in .0:
f'''{k!s}={v!r}'''None)(self._kwargs.items()())
        return f'''{self.__class__.__module__!s}.{self.__class__.__name__!s}({', '.join(args)!s})'''

    
    def __reduce__(self):
        if not self._kwargs:
            return (self.__class__, (self._name,) + self._args)
        partial = partial
        import functools
    # WARNING: Decompyle incomplete



def iadd(a, b):
    a += b
    return a


def iand(a, b):
    a &= b
    return a


def iconcat(a, b):
    if not hasattr(a, '__getitem__'):
        msg = "'%s' object can't be concatenated" % type(a).__name__
        raise TypeError(msg)
    None += b
    return a


def ifloordiv(a, b):
    a //= b
    return a


def ilshift(a, b):
    a <<= b
    return a


def imod(a, b):
    a %= b
    return a


def imul(a, b):
    a *= b
    return a


def imatmul(a, b):
    a = a @ b
    return a


def ior(a, b):
    a |= b
    return a


def ipow(a, b):
    a **= b
    return a


def irshift(a, b):
    a >>= b
    return a


def isub(a, b):
    a -= b
    return a


def itruediv(a, b):
    a /= b
    return a


def ixor(a, b):
    a ^= b
    return a

from _operator import *
from _operator import __doc__