Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cov(expr1, expr2):
return Expr(OpCodes.COV, (expr1, expr2))
def __sub__(self, other):
return Expr(OpCodes.MINUS, (self, other))
def sd(expr):
return Expr(OpCodes.STDEV, (expr,))
def count(iterable=None):
if isinstance(iterable, Expr):
return Expr(OpCodes.COUNT, (iterable,))
elif iterable is None:
return Expr(OpCodes.COUNT0, ())
else:
return _builtin_sum((x is not None) for x in iterable)
def __rshift__(self, other):
return Expr(OpCodes.RSHIFT, (self, other))
def __gt__(self, other):
return Expr(OpCodes.GT, (self, other))
def remove(self, other):
return Expr(OpCodes.SETMINUS, (self, other))
def __ge__(self, other):
return Expr(OpCodes.GE, (self, other))
def last(iterable):
if isinstance(iterable, Expr):
return Expr(OpCodes.LAST, (iterable,))
else:
try:
for x in reversed(iterable):
return x
except TypeError:
# Some iterators may not be reversible
x = None
for x in iterable:
pass
return x
def __floordiv__(self, other):
return Expr(OpCodes.INTDIV, (self, other))