<commit_before>/**
 * pubfood
 * Copyright (c) 2015 Yieldbot, Inc. - All rights reserved.
 */

'use strict';

//var util = require('../util');
//var BidProvider = require('../provider/bidprovider');
var Event = require('../event');
var Bid = require('../model/bid');

/**
 * BidMediator mediates provider bid requests.
 *
 * @class
 * @param {AuctionMediator} auctionMediator - auction mediator object
 * @memberof pubfood/mediator
 */
function BidMediator(auctionMediator) {
  this.auctionMediator = auctionMediator;
  this.operators = [];
  this.initDoneTimeout_ = 2000;
}

/**
 * Initialize the bidders.
 *
 * @param {object} slotMap
 * @return {undefined}
 */
BidMediator.prototype.initBids = function(auctionState) {
  // TODO: run request operators here

  var providers = auctionState.providers;
  for (var k in providers) {
    this.getBids_(providers[k].provider, providers[k].slots);
  }
};

/**
 * Refresh the bids
 *
 * @param {Slot[]} slots
 */
BidMediator.prototype.refreshBids = function(/*slots*/) {

};

/**
 * The maximum time the bid provider has before calling `done` inside the `init` method
 *
 * @param {number} millis timeout in milliseconds
 * @return {undefined}
 */
BidMediator.prototype.setInitDoneTimeout = function(millis){
  this.initDoneTimeout_ = typeof millis === 'number' ? millis : 2000;
};

/**
 * @private
 */
BidMediator.prototype.getBids_ = function(provider, slots) {<commit_msg>remove todo<commit_after>/**
 * pubfood
 * Copyright (c) 2015 Yieldbot, Inc. - All rights reserved.
 */

'use strict';

//var util = require('../util');
//var BidProvider = require('../provider/bidprovider');
var Event = require('../event');
var Bid = require('../model/bid');

/**
 * BidMediator mediates provider bid requests.
 *
 * @class
 * @param {AuctionMediator} auctionMediator - auction mediator object
 * @memberof pubfood/mediator
 */
function BidMediator(auctionMediator) {
  this.auctionMediator = auctionMediator;
  this.operators = [];
  this.initDoneTimeout_ = 2000;
}

/**
 * Initialize the bidders.
 *
 * @param {object} slotMap
 * @return {undefined}
 */
BidMediator.prototype.initBids = function(auctionState) {
  var providers = auctionState.providers;
  for (var k in providers) {
    this.getBids_(providers[k].provider, providers[k].slots);
  }
};

/**
 * Refresh the bids
 *
 * @param {Slot[]} slots
 */
BidMediator.prototype.refreshBids = function(/*slots*/) {

};

/**
 * The maximum time the bid provider has before calling `done` inside the `init` method
 *
 * @param {number} millis timeout in milliseconds
 * @return {undefined}
 */
BidMediator.prototype.setInitDoneTimeout = function(millis){
  this.initDoneTimeout_ = typeof millis === 'number' ? millis : 2000;
};

/**
 * @private
 */
BidMediator.prototype.getBids_ = function(provider, slots) {
{'fraction_non_alphanumeric': 0.15255448374419436, 'fraction_numerical': 0.00857449088960343, 'mean_word_length': 4.045045045045045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1655057', 'n_tokens_mistral': 950, 'n_tokens_neox': 894, 'n_words': 220}