Small helper function to remove bids from internal storage; normally b/c they're about to sent to Prebid Cache for processing.
@param {Array[Object]} bidResponses list of bids to remove
330357
function removeBidsFromStorage(bidResponses) {
  for (let i = 0; i < bidResponses.length; i++) {
    bidCacheRegistry.removeBid(bidResponses[i]);
  }
}
1127653
function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded) {
  let addBid = true;

  const bidderRequest = getBidRequest(bidResponse.requestId, [bidRequests]);
  const videoMediaType =
  bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video');
  const context = videoMediaType && deepAccess(videoMediaType, 'context');

  if (config.getConfig('cache.url') && context !== OUTSTREAM) {
    if (!bidResponse.videoCacheKey) {
      addBid = false;
      callPrebidCache(auctionInstance, bidResponse, afterBidAdded, bidderRequest);
    } else if (!bidResponse.vastUrl) {
      utils.logError('videoCacheKey specified but not required vastUrl for video bid');
      addBid = false;
    }
  }
  if (addBid) {
    addBidToAuction(auctionInstance, bidResponse);
    afterBidAdded();
  }
}
292338
function(_bid,_error){
        var _batch = _xcache[_bid];
        if (!_batch) return;
        _u._$forIn(
            _batch.h,function(v,k){
                __onError(_bid,k,_error);
            }
        );
    }
84114
async def remove_offer(self, **params):
		
		if params.get("message"):
			params = json.loads(params.get("message", "{}"))
		
		if not params:
			return {"error":400, "reason":"Missed required fields"}

		# Check if required fields exists
		cid = int(params.get("cid", 0))
		buyer_address = params.get("buyer_address")
		coinid = params.get("coinid")

		try:
			coinid = coinid.replace("TEST", "")
		except:
			pass
	
		# Check if required fileds 
		if not all([cid, buyer_address]):
			return {"error":400, "reason":"Missed required fields"}
		
		# Try to find offer with account id and cid	
		offer = await self.get_offer(cid=cid, buyer_address=buyer_address, coinid=coinid)
		if "error" in offer.keys():
			return offer

		# Remove offer
		database = client[coinid]
		offer_collection = database[settings.OFFER]
		await offer_collection.delete_one(
							{"account_id":offer["account_id"],
							"cid":cid})
		return {"result": "ok"}
489824
function(response) {
        if (response) {
            this.destroyRequest(response.priv);
        } else {
            for (var key in this.pendingRequests) {
                this.destroyRequest(this.pendingRequests[key]);
            }
        }
    }
1162977
function del(key, cb) {
  return type(key) != 'array'
    ? localForage.removeItem(key).then(wrap(cb), cb)
    : Promise.all(key.map(del)).then(wrap(cb), cb);
}
1370389
function (serverResponse, bidRequest) {
    const bidResponses = [];
    // For this adapter, serverResponse is a list
    serverResponse.body.forEach(response => {
      const bid = createBid(response);
      if (bid) {
        bidResponses.push(bid);
      }
    });
    return bidResponses;
  }
858257
function removeAtIndex(arr, index) {
    var item = arr[index];
    arr.splice(index, 1);
    return item;
}
659536
function (serverResponse, bidRequest) {
    const bids = [];
    utils._each(serverResponse.body.bid, function (bidObject) {
      if (!bidObject.price || bidObject.price === null ||
        bidObject.hasOwnProperty('errorCode') ||
        (!bidObject.adm && !bidObject.native)) {
        return;
      }

      const bid = {};

      if (bidObject.native) {
        // Native
        bid.native = getNormalizedNativeAd(bidObject.native);
        if (bidObject.nurl) {
          bid.native.impressionTrackers.unshift(bidObject.nurl);
        }
        bid.mediaType = NATIVE;
      } else {
        // Banner
        let nurl = '';
        if (bidObject.nurl && bidObject.nurl.length > 0) {
          nurl = `<img src="${bidObject.nurl}" width="0" height="0" style="display:none">`;
        }
        bid.ad = `${nurl}<script>${bidObject.adm}</script>`;
        bid.mediaType = BANNER;
      }

      // Common properties
      bid.adId = bidObject.id;
      bid.cpm = parseFloat(bidObject.price);
      bid.creativeId = bidObject.crid;
      bid.currency = bidObject.currency ? bidObject.currency.toUpperCase() : 'USD';

      // Deal ID. Composite ads can have multiple line items and the ID of the first
      // dealID line item will be used.
      if (utils.isNumber(bidObject.lid) && bidObject.buying_type === 'deal_id') {
        bid.dealId = bidObject.lid;
      } else if (Array.isArray(bidObject.lid) &&
        Array.isArray(bidObject.buying_type) &&
        bidObject.lid.length === bidObject.buying_type.length) {
        let isDeal = false;
        bidObject.buying_type.forEach((bt, i) => {
          if (isDeal) return;
          if (bt === 'deal_id') {
            isDeal = true;
            bid.dealId = bidObject.lid[i];
          }
        });
      }

      bid.height = bidObject.h;
      bid.netRevenue = bidObject.isNet ? bidObject.isNet : false;
      bid.requestId = bidObject.id;
      bid.ttl = 300;
      bid.width = bidObject.w;

      if (!bid.width || !bid.height) {
        bid.width = 1;
        bid.height = 1;
        if (bidRequest.sizes) {
          bid.width = bidRequest.sizes[0][0];
          bid.height = bidRequest.sizes[0][1];
        }
      }

      bids.push(bid);
    });
    return bids;
  }
949135
function removeDuplicates(items) {
    var temp = {}, result = [], x, i = items.length;
    while (i--) {
      x = getData(items[i], 'id', true);
      if (!temp.hasOwnProperty(x)) {
        temp[x] = 1;
        result.push(items[i]);
      }
    }
    return result;
  }
242108
function purgeResource(resource, archive) {
        if (!resource.purge) { return true; }

        var criteria = resource.purge();
        var deferred = Q.defer();

        archive.bind(resource.name);
        archive[resource.name].remove(criteria, function (err, results) {
            err ? deferred.reject(err) : deferred.resolve(results);
        });
        return deferred.promise;
    }
1270171
function(response, err) {
						clearTimeout(that.timeout);
						var p = [];
						if(Array.isArray(response.proposals)) {
							p = response.proposals;
						}
			        	deferred.resolve(sortProposals(p, args));
					}
690799
function clearAndDoTasks(arr) {

		var tasks = arr.slice(0),
		    i;

		// Clear the original array
		arr.length = 0;

		for (i = 0; i < tasks.length; i++) {
			tasks[i]();
		}
	}
501184
function(response) {
      delete self._requestState[transactionId];
      if (typeof callback === 'function') {
        // negative response
        if (response.error) {
          var owner = response.answerRecords[0].nb.entries[0].address;
          callback(null, false, owner);

        // positive response
        } else {
          // ignore as this should not happen for 'broadcast' nodes
        }
      }
    }
166440
function(serverResponse, {bidderRequest}) {
    serverResponse = serverResponse.body;
    const bids = [];
    if (!serverResponse || serverResponse.error) {
      let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`;
      if (serverResponse && serverResponse.error) { errorMessage += `: ${serverResponse.error}`; }
      utils.logError(errorMessage);
      return bids;
    }

    if (serverResponse.tags) {
      serverResponse.tags.forEach(serverBid => {
        const rtbBid = getRtbBid(serverBid);
        if (rtbBid) {
          if (rtbBid.cpm !== 0 && includes(this.supportedMediaTypes, rtbBid.ad_type)) {
            const bid = newBid(serverBid, rtbBid, bidderRequest);
            bid.mediaType = parseMediaType(rtbBid);
            bids.push(bid);
          }
        }
      });
    }
    return bids;
  }
460828
function(serverResponse) {
    let responseBody = serverResponse.body;
    const bids = [];
    if (responseBody && responseBody.no_bid !== 1) {
      let size = parseSize(responseBody.size);
      let bid = {
        requestId: responseBody.bid_id,
        ttl: BID_RESPONSE_TTL_SEC,
        netRevenue: IS_NET_REVENUE,
        currency: responseBody.currency,
        creativeId: responseBody.creative_id,
        cpm: responseBody.cpm,
        width: size[0],
        height: size[1]
      };
      if (responseBody.vast_url) {
        bid.mediaType = 'video';
        bid.vastUrl = responseBody.vast_url;
      } else {
        bid.mediaType = 'banner';
        bid.ad = responseBody.ad;
      }
      bids.push(bid);
    }
    return bids;
  }
1231380
function(serverResponse, bidRequest) {
    const bidResponses = [];
    let response = serverResponse.body;
    if (!isResponseValid(response)) {
      return bidResponses;
    }

    const bidResponse = {
      requestId: bidRequest.bidId,
      cpm: response.cpm,
      width: response.width,
      height: response.height,
      creativeId: response.creativeId,
      currency: response.currency ? response.currency : 'USD',
      netRevenue: response.netRevenue ? response.netRevenue : true,
      ttl: response.ttl ? response.ttl : 86400
    };

    if (response.hasOwnProperty('dealId')) {
      bidResponse.dealId = response.dealId;
    }

    if (response.content_type.indexOf('vast') > -1) {
      if (typeof response.vastUrl !== 'undefined') {
        bidResponse.vastUrl = response.vastUrl;
      } else {
        bidResponse.vastXml = response.content;
      }
      bidResponse.mediaType = VIDEO;
    } else {
      bidResponse.ad = response.content;
      bidResponse.mediaType = BANNER;
    }

    bidResponses.push(bidResponse);
    return bidResponses;
  }