Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __and__(self, x):
# Combine results
if isinstance(self, And):
self.subtree['must'].append(x.subtree)
return self
elif isinstance(x, And):
x.subtree['must'].append(self.subtree)
return x
return And(self, x)
def __and__(self, x):
# Combine results
if isinstance(self, And):
self.subtree['must'].append(x.subtree)
return self
elif isinstance(x, And):
x.subtree['must'].append(self.subtree)
return x
return And(self, x)
def __and__(self, x):
# Combine results
if isinstance(self, And):
self.subtree['must'].append(x.subtree)
return self
elif isinstance(x, And):
x.subtree['must'].append(self.subtree)
return x
return And(self, x)
def __init__(self, *args):
[isinstance(x, Filter) for x in args]
super(And, self).__init__()
self._filter = {'bool': {'must': [x.build() for x in args]}}