Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, upstream, n, loop=None, **kwargs):
loop = loop or upstream.loop or IOLoop.current()
self.queue = Queue(maxsize=n)
Stream.__init__(self, upstream, loop=loop, **kwargs)
self.loop.add_callback(self.cb)
def __init__(self, upstream, predicate, **kwargs):
if predicate is None:
predicate = _truthy
self.predicate = predicate
Stream.__init__(self, upstream, **kwargs)
def __init__(self, upstream, interval, **kwargs):
self.interval = convert_interval(interval)
self.next = 0
Stream.__init__(self, upstream, **kwargs)
def __init__(self, upstream, loop=None):
loop = loop or upstream.loop or IOLoop.current()
self.condition = Condition()
self.next = []
Stream.__init__(self, upstream, loop=loop)
self.loop.add_callback(self.cb)
def __init__(self, *upstreams, **kwargs):
self.maxsize = kwargs.pop('maxsize', 10)
self.condition = Condition()
self.literals = [(i, val) for i, val in enumerate(upstreams)
if not isinstance(val, Stream)]
self.buffers = {upstream: deque()
for upstream in upstreams
if isinstance(upstream, Stream)}
upstreams2 = [upstream for upstream in upstreams if isinstance(upstream, Stream)]
Stream.__init__(self, upstreams=upstreams2, **kwargs)
def __init__(self, upstream, interval, loop=None, **kwargs):
loop = loop or upstream.loop or IOLoop.current()
self.interval = convert_interval(interval)
self.queue = Queue()
Stream.__init__(self, upstream, loop=loop, **kwargs)
self.loop.add_callback(self.cb)
def __init__(self, upstream, n, **kwargs):
self.n = n
self.buffer = []
Stream.__init__(self, upstream, **kwargs)
def __init__(self, lossless, *upstreams, **kwargs):
upstreams = (lossless,) + upstreams
self.last = [None for _ in upstreams]
self.missing = set(upstreams)
self.lossless = lossless
self.lossless_buffer = deque()
Stream.__init__(self, upstreams=upstreams, **kwargs)
def __init__(self, *upstreams, **kwargs):
emit_on = kwargs.pop('emit_on', None)
self.last = [None for _ in upstreams]
self.missing = set(upstreams)
if emit_on is not None:
if not isinstance(emit_on, Iterable):
emit_on = (emit_on, )
emit_on = tuple(
upstreams[x] if isinstance(x, int) else x for x in emit_on)
self.emit_on = emit_on
else:
self.emit_on = upstreams
Stream.__init__(self, upstreams=upstreams, **kwargs)