The

@param {?Error} err - An Error instance / null that determines whether or not the parallel collection run
succeeded.
@param {Array} results - An array of collection run summary objects.
964806
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            `${result.collection.name} ran successfully.`);
    });
}
967885
def result_or_error(response):
    
    data = response.json()
    result = data.get('result')
    if result is not None:
        return result
    raise exceptions.ApiError(response, data)
253157
function(err, results) {

        if(options.headers) {
          // Set some headers so we can track what's going on
          var headers = {
            'X-Throttled': results.throttled,
            'X-Throttle-Remaining': Math.max(options.limit - results.count, 0)
          };
          if (results.expiresAt) {
            headers['X-Throttle-Reset'] = results.expiresAt;
          }
          res.set(headers);
        }

        if (err) {
          // Unknown error
          next(err);
          return;
        } else if (results.throttled) {

          if(logger) {
            // Log it
            logger.warn(
              '%s - ResponseThrottled for %s seconds - %s requests exceeded %s within %s seconds',
              ip,
              options.ban,
              results.count,
              options.limit,
              options.period);
          }

          // Let the client know this is forbidden
          res.status(403);

          // Create a human readable error
          var banLength = moment.duration(options.ban, 'seconds').humanize();
          next('Warning: Too many requests. You have been throttled for ' + banLength + '. ' +
            'Try again ' + moment(results.expiresAt).fromNow());
          return;
        } else {
          // All is good
          next();
          return;
        }
      }
557056
function haveResults(err, response, body) {
    var jsn;
    if (err) {
      callback(err);
      return;
    }
    //fs.writeFileSync('response.txt', JSON.stringify(response, null, '  '), 'utf8');
    if (response && response.statusCode !== 200) {
      callback('Resp Status: ' + response.statusCode);
      return;
    }
    try {
      jsn = JSON.parse(body);
    } catch(e) {
      callback('JSON Parse error:\n' + body);
      return;
    }
    if (!jsn.status || jsn.status !== 200) {
      callback('Status: ' + (jsn.status ? String(jsn.status) : '555') + ' ' + (jsn.message ? jsn.message : ''));
      return;
    }
    jsn.resultSetFiltered = jsn.resultSet.filter(function(itm) {
      return filter.indexOf(itm.tID) === -1;
    });
    callback(null, jsn, fname); // DONE - return results to caller
  }
321625
function(err, result) {
        var data=[];
    
        // default route name if not present in XML
        var now=new Date();
        data.name= 'ParseGPX' + now.toISOString(); 
    
        // search for gpx tag
        if (result['gpx'] === undefined) {
            console.log ("Fatal: Not a GPX route/track file [no <gpx></gpx> tag]");
            return (-1);
        }
        // search for track tag
        if (result['gpx']["trk"] !== undefined) {
            // console.log ("track=%s", JSON.stringify(result['gpx']["trk"]));
            data = {
                mode    : 'track',
                name    : result['gpx']["trk"][0].name,
                segment : result['gpx']["trk"][0]["trkseg"][0]['trkpt']
            };
        }
        // search for route tag
        if (result['gpx']["rte"] !== undefined) {
            //console.log ("route=%s", JSON.stringify(result['gpx']["rte"]));
            data = {
                mode    :'route',
                name    :result['gpx']["rte"][0].name,
                segment :result['gpx']["rte"][0]["rtept"]
            };
        }
        if (data.mode === undefined) {
           console.log ("Fatal Not a valid GPX route/track file <trk>|<rte> tag");
           return (-1);
        }
    
        // provide a default name if nothing found in gpxfile
        if (data.name === undefined) {
            now= new Date();
            route.name = 'GGsimulator://' + opts.gpxfile + "/" + now.toISOString();
        } else {
            route.name = 'GGsimulator://' + data.name;
        }
    
        switch (data.mode) {
            case "track":
            var spd, crs, alt,dat;
            for (var trackpts in data.segment)  {
                // console.log ("trackpts[%s]=%s", trackpts, JSON.stringify(data.segment[trackpts]));
                if (data.segment[trackpts]['name'] === undefined) nam= 'TrackPts-' + trackpts; 
                    else nam=data.segment[trackpts]['name'];
                
                lat=parseFloat (data.segment[trackpts]["$"].lat);
                lon=parseFloat (data.segment[trackpts]["$"].lon);
                spd=data.segment[trackpts]['sog'];
                crs=data.segment[trackpts]['course'];
                alt=data.segment[trackpts]['ele'];
                dat=data.segment[trackpts]['time'];
                //console.log ("name=%s  lat=%s lon=%s sog=%s course=%s alt=%s", nam, lat, lon, spd, crs, alt);
                route.waypts.push ({name: nam, lat: lat, lon: lon, date: dat});
                route.count++;
            }
            break;
        case 'route':
            var nam, lat, lon;
            for (var routepts in data.segment)  {
                // console.log ("routepts[%s]=%s", routepts, JSON.stringify(data.segment[routepts]));
                if (data.segment[routepts]['name'] === undefined)
                    nam= 'TrackPts-' + routepts;
                else
                    nam=data.segment[routepts]['name'];

                lat=parseFloat (data.segment[routepts]["$"].lat);
                lon=parseFloat (data.segment[routepts]["$"].lon);
                // console.log ("name=%s  lat=%s lon=%s", nam, lat, lon);
                route.waypts.push ({name: nam, lat: lat, lon: lon});
                route.count++;
            }
            break;
        }
    }
930483
function onRequestError(error, result, endCallback) {
      result.currentRetries++;
      async.parallel([
        async.apply(recrawlError, error, result),
        async.apply(retrySameUrl,error, result)
      ],function(error){
          endCallback(error);
      });

  }
644814
function retry(err) {
      if (retries < maxRetries) {
        return _Bluebird2['default'].delay(ms).then(function () {
          return loop(fn, retries + 1);
        });
      }

      return _Bluebird2['default'].reject(err);
    }
275238
function(d, err, result) {
    if (err) {
        d.reject(err);
    }
    else {
        d.resolve(result);
    }
}
663460
def errors
      return [] if success?
      @errors ||= Array.wrap(response[:errors]).map do |error|
        ErrorResult.new(error[:error])
      end
    end
247524
function(err, results) {
        if (err) {
            callback(err);
            return;
        }
        
        var keyFrequency = parseInt(results[0]);
        var docFrequency = parseInt(results[1]);
        var keyDocFrequency = results[2];

        // ensure that key frequency is relative to the given document (when appropriate)
        if (id && results.length == 4) {
            keyFrequency = parseInt(results[3]);
        }
        var tf = 1 + (Math.log(keyFrequency) / Math.LN10);
        var idf = Math.log(docFrequency / keyDocFrequency) / Math.LN10;

        var result = {};
        result.key = key;
        result.rawtf = keyFrequency;
        result.df = keyDocFrequency;
        result.n = docFrequency;
        result.idf = idf;
        result.tf = tf;
        result.tfidf = tf * idf;
        callback(null, result);
    }
659762
function handle(err, results) {
      if (err) {
        errors.push(err);
      }

      // add all responses to the array
      (Array.isArray(results) ? results : [results]).forEach(function each(value) {
        if (value && memcached.namespace.length) {
          var ns_key = Object.keys(value)[0]
            , newvalue = {};

          newvalue[ns_key.replace(memcached.namespace, '')] = value[ns_key];
          Utils.merge(responses, newvalue);
        } else {
          Utils.merge(responses, value);
        }
      });

      if (!--calls){
          callback(errors.length ? errors : undefined, responses);
      }
    }
1294055
function (err) {
                if (_.isNull(err)) {
                    // Call complete with all the args except for err
                    complete.apply(null, Array.prototype.slice.call(arguments, 1));
                } else {
                    error(err);
                }
            }
472974
function dispatchResult (error, data) {
    if (_cb.beforeAll) { _cb.beforeAll() }

    if (_cb.returnForAll) {
      _cb.returnForAll(error, data)
    } else if (!_isNullOrEmptyArray(error)) {
      var _error = _normalizeError(error)
      if (!_isNullOrEmptyArray(data)) {
        processErrorAndData(_error, data)
      } else {
        processError(_error)
      }
    } else {
      if (!_isNullOrEmptyArray(data)) {
        processData(data)
      } else {
        processNotFound()
      }
    }

    if (_cb.afterAll) { _cb.afterAll() }
  }
824294
function processResult(result) {
    return {
        whenErrorIs: (errorCode) => {
            if (
                errorCode === EAUDITNOLOCK &&
                packageLockHasNotBeenFound(result)
            ) {
                const summary = result.error.summary || '';
                result.error.summary = `package.json file is missing or is badly formatted. ${summary}`;
                return result;
            }
            return result;
        },
    };
}
108534
function( err ){
                if( err && ! err.errorInDelete ) return cb( err );

                // That's all!
                cb( null, queryDocs, total, grandTotal );
              }
220746
function(err,results) {
                            var _stdout = fs.createReadStream(results[1]);
                            var _stderr = fs.createReadStream(results[0]);
                            jobObj.emit("completed", _stdout, _stderr, jobObj);
                        }
788111
function hasErrors(results) {
  return  (results.dependencies && results.dependencies.length) ||
          (results.devDependencies && results.devDependencies.length)
}