go through discovery and JOIN-REQ again in a next iteration
506445
protected boolean installViewIfValidJoinRsp(final Promise<JoinRsp> join_promise, boolean block_for_rsp) {
        boolean success=false;
        JoinRsp rsp=null;
        try {
            if(join_promise.hasResult())
                rsp=join_promise.getResult(1, true);
            else if(block_for_rsp)
                rsp=join_promise.getResult(gms.join_timeout, true);

            return success=rsp != null && isJoinResponseValid(rsp) && installView(rsp.getView(), rsp.getDigest());
        }
        finally {
            if(success)
                gms.sendViewAck(rsp.getView().getCreator());
        }
    }
253461
def _join_results(self, results, coarse, join):
    '''
    
    '''
    rval = OrderedDict()
    i_keys = set()
    for res in results:
      i_keys.update( res.keys() )
    for i_key in sorted(i_keys):
      if coarse:
        rval[i_key] = join( [res.get(i_key) for res in results] )
      else:
        rval[i_key] = OrderedDict()
        r_keys = set()
        for res in results:
          r_keys.update( res.get(i_key,{}).keys() )
        for r_key in sorted(r_keys):
          rval[i_key][r_key] = join( [res.get(i_key,{}).get(r_key) for res in results] )
    return rval
219788
function nextRequest() {
		// If there are no more middleware,
		// then resolve the middleware resolution
		if ( middleware.index == middleware.names.length ) {
			middleware.resolution.resolve();
		}

		// Attempt to invoke the next middleware
		middleware.next();
	}
275630
def rebuild_join_options!
      joins = (finder_options[:joins] || []) + (finder_options[:includes] || [])

      reflections.keys.each do |path|
        next if path.empty? or @join_table_joins.include?(path)

        existing_join = joins.find do |join|
          existing_path = join_to_path(join)
          min_length = [existing_path.length, path.length].min
          existing_path.first(min_length) == path.first(min_length)
        end

        if existing_join
          if join_to_path(existing_join).length < path.length
            joins[joins.index(existing_join)] = path_to_join(path)
          end
        else
          joins << path_to_join(path)
        end
      end

      case obligation_conditions.length
      when 0 then
        # No obligation conditions means we don't have to mess with joins or includes at all.
      when 1 then
        finder_options[:joins] = joins
        finder_options.delete( :include )
      else
        finder_options.delete( :joins )
        finder_options[:include] = joins
      end
    end
577410
def go_to_and_do(aws_config, current_config, path, current_path, callback, callback_args = None):
    
    try:
        key = path.pop(0)
        if not current_config:
            current_config = aws_config
        if not current_path:
            current_path = []
        keys = key.split('.')
        if len(keys) > 1:
            while True:
                key = keys.pop(0)
                if not len(keys):
                    break
                current_path.append(key)
                current_config = current_config[key]
        if key in current_config:
            current_path.append(key)
            for (i, value) in enumerate(list(current_config[key])):
                if len(path) == 0:
                    if type(current_config[key] == dict) and type(value) != dict and type(value) != list:
                        callback(aws_config, current_config[key][value], path, current_path, value, callback_args)
                    else:
                        callback(aws_config, current_config, path, current_path, value, callback_args)
                else:
                    tmp = copy.deepcopy(current_path)
                    try:
                        tmp.append(value)
                        go_to_and_do(aws_config, current_config[key][value], copy.deepcopy(path), tmp, callback, callback_args)
                    except:
                        tmp.pop()
                        tmp.append(i)
                        go_to_and_do(aws_config, current_config[key][i], copy.deepcopy(path), tmp, callback, callback_args)

    except Exception as e:
        printException(e)
        if i:
            printInfo('Index: %s' % str(i))
        printInfo('Path: %s' % str(current_path))
        printInfo('Key = %s' % str(key))
        printInfo('Value = %s' % str(value))
        printInfo('Path = %s' % path)
511645
function done(req, next, err, obj) {
    if (err) {
        req.error = {error: err.error || err.message};
    } else {
        req.provider = obj;
    }
    next();
}
12094
function (item, req, eachReq, res, next) {
          eachReq.item = item;
          eachReq[indexKey] = index;
          index++;
          next();
        }
587061
def doFind(self, WHAT={}, SORT=[], SKIP=None, MAX=None, LOP='AND', **params):
		""""""

		self._preFind(WHAT, SORT, SKIP, MAX, LOP)

		for key in params:
			self._addDBParam(key, params[key])

		try:
			return self._doAction('-find')
		except FMServerError as e:
			if e.args[0] in [401, 8]:
				return []
801092
def join(self, timeout=None, raise_error=False):
        """"""
        self._workers.join(timeout, raise_error)
444234
function()
    {
        if (this._join.length) {

            var results = this._results;

            // Functions we need to call, that return a promise, for the value
            // we're recieving after subsequent joins
            var joins = [];

            this._join.forEach(function(join) {

                var f = function(outer) {
                    var inner = join.inner.toArray();

                    return inner.then(function(inner) {
                        var next = [];
                        outer.forEach(function(o) {
                            var oKey = o[join.outerKey];

                            // find the corresponding thing
                            var i = _(inner).find(function(i) {
                                return i[join.innerKey] == oKey;
                            });

                            if (i)
                                next.push(join.selector(o, i));

                        });
                        return next;
                    });
                };

                joins.push(f);
            });

            // Execute all of the joins, in order, feeding the result into the
            // next join. When they all are done, complete the promise for this
            // result
            return joins.reduce(Q.when, Q(results)).then(function(last) {
                return last;
            });

        } else {
            return Q(this._results);
        }
    }
711580
def runQuery(self, *args, **kwargs):
        
        try:
            return self._connectionPool.runQuery(*args, **kwargs)
        except:
            d = defer.Deferred()
            d.errback()
            return d
471221
def run(self):
        """"""
        resp = _wait_until(obj=self.obj, att=self.att,
                desired=self.desired, callback=None,
                interval=self.interval, attempts=self.attempts,
                verbose=False, verbose_atts=None)
        self.callback(resp)
1108378
def on_next_request(self, py_db, request):
        '''
        
        '''
        arguments = request.arguments  # : :type arguments: NextArguments
        thread_id = arguments.threadId

        if py_db.get_use_libraries_filter():
            step_cmd_id = CMD_STEP_OVER_MY_CODE
        else:
            step_cmd_id = CMD_STEP_OVER

        self.api.request_step(py_db, thread_id, step_cmd_id)

        response = pydevd_base_schema.build_response(request)
        return NetCommand(CMD_RETURN, 0, response, is_json=True)
1058047
def find_one(cls, *args, **kwargs):
        """"""
        # ensure that maximum is supplied so that a big query is not happening
        # behind the scenes
        if 'maximum' not in kwargs:
            kwargs['maximum'] = 1

        try:
            # call find and extract the first iterated value from the result
            iterable = iter(cls.find(*args, **kwargs))
            return next(iterable)
        except StopIteration:
            # no result was found
            return None
240111
def get_collection(self, path):
        """"""
        while True:
            items = self.get(path)
            req = self.req
            for item in items:
                yield item
            if req.links and req.links['next'] and\
                    req.links['next']['rel'] == 'next':
                path = req.links['next']['url']
            else:
                break
1236181
def Join(self):
    """"""

    for _ in range(self.JOIN_TIMEOUT_DECISECONDS):
      if self._queue.empty() and not self.busy_threads:
        return
      time.sleep(0.1)

    raise ValueError("Timeout during Join() for threadpool %s." % self.name)
214310
function show(req, res, next) {
  db.users.find(req.params.user, function(err, user) {
    if(err) { return next(err); }
    res.json(user);
  });
}