Yields as soon as any hypothesis is available
178807
def recognize_continuous(max_samples, buffer)
      process_audio(buffer, max_samples).tap do
        if hypothesis = decoder.hypothesis
          decoder.end_utterance

          yield hypothesis

          decoder.start_utterance
        end
      end
    end
150046
def predict(self, X):
        """"""
        return self.__cost(self.__unroll(self.__thetas), 0, np.matrix(X))
354162
def on_success(&block)
      on do |_, value, reason|
        block.call(value) unless reason
      end
    end
1090943
def until_any(*futures, **kwargs):
    
    timeout = kwargs.get('timeout', None)
    ioloop = kwargs.get('ioloop', None) or tornado.ioloop.IOLoop.current()
    any_future = tornado_Future()

    def handle_done(done_future):
        if not any_future.done():
            try:
                any_future.set_result(done_future.result())
            except Exception:
                any_future.set_exc_info(done_future.exc_info())
            # (NM) Nasty hack to remove handle_done from the callback list to prevent a
            # memory leak where one of the futures resolves quickly, particularly when
            # used together with AsyncState.until_state(). Also addresses Jira issue
            # CM-593
            for f in futures:
                if f._callbacks:
                    try:
                        f._callbacks.remove(handle_done)
                    except ValueError:
                        pass

    for f in futures:
        f.add_done_callback(handle_done)
        if any_future.done():
            break

    if timeout:
        return with_timeout(ioloop.time() + timeout, any_future, ioloop)
    else:
        return any_future
513962
def iter(self, count=0, func=sum):
        '''
        '''
        while True:
            yield self.roll(count, func)
353708
def visit_yieldfrom(self, node):
        
        yi_val = (" " + node.value.accept(self)) if node.value else ""
        expr = "yield from" + yi_val
        if node.parent.is_statement:
            return expr

        return "(%s)" % (expr,)
1330750
def get(self, timeout=None):
        """"""
        self.wait(timeout)
        if self._state==self.FULFILLED:
            return self.value
        else:
            raise ValueError("Calculation didn't yield a value")
230788
def blow(self):
        """"""

        if self.verbose > 1:
            print_('\t' + self._id + ' Running ')

        # Mask for values to move
        phi = self.phi

        if self._prime:
            xp, x = self.values
        else:
            x, xp = self.values

        if self.verbose > 1:
            print_('\t' + 'Current value ' + str(x))

        sigma = max(phi * abs(xp - x))

        x = x + phi * sigma * rnormal()

        if self.verbose > 1:
            print_('\t' + 'Proposed value = ' + str(x))

        self.hastings_factor = self._g(
            x,
            xp,
            sigma) - self._g(
                self.stochastic.value,
                xp,
                sigma)

        self.stochastic.value = x
814948
function settlePromise (p, state, value) {
        // 2.1.2
        // 2.1.3
        if (p._s !== $pending) return;

        // 2.1.1.1
        p._s = state;
        p._v = value;

        var i = 0,
            len = p._c;

        // 2.2.2
        // 2.2.3
        while (i < len) {
            // 2.2.4
            scheduleHandler(p, p[i++]);
        }

        return p;
    }
980350
def iterrepos(self):
        
        for repo, items in self.repo_items_hash.iteritems():
            if items:
                yield (repo, items)
949648
def generator(self, t):
        """"""
        return np.power(-np.log(t), self.theta)
1196407
def generator(self, t):
        """"""
        a = (np.exp(-self.theta * t) - 1) / (np.exp(-self.theta) - 1)
        return -np.log(a)
779215
def ready_to_split(self):
        
        # Never split if we're a leaf that predicts adequately.
        threshold = self._tree.leaf_threshold
        if self._tree.data.is_continuous_class:
            var = self._class_cdist.variance
            if var is not None and threshold is not None \
            and var <= threshold:
                return False
        else:
            best_prob = self._class_ddist.best_prob
            if best_prob is not None and threshold is not None \
            and best_prob >= threshold:
                return False
            
        return self._tree.auto_grow \
            and not self.attr_name \
            and self.n >= self._tree.splitting_n
247287
def batch(self):
        
        if self._no_kc:
            raise ValueError("Already in a batch")
        self._no_kc = True
        yield
        self._no_kc = False
1218649
async def ticker(delay, to):
    """"""
    for i in range(to):
        yield i
        await asyncio.sleep(delay)
825070
def feed(self, data=''):
        '''
        
        '''
        self.streaming = True
        self.pending += data
        for i in self:
            yield i
484463
def _call(self, x):
        """"""
        # Since the proximal projects onto our feasible set we can simply
        # check if it changes anything
        proj = self.proximal(1)(x)
        return np.inf if x.dist(proj) > 0 else 0