<commit_before>/**
 * pubfood
 */

/* global yieldbot googletag*/
/*eslint no-unused-vars: 0*/

'use strict';

window.googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
var ybotq = ybotq || [];

var pubfoodContrib = {
  slots: [
    {
      name: '/2476204/multi-size',
      sizes: [
        [300, 250],
        [300, 600]
      ],
      elementId: 'div-multi-size',
      bidProviders: [
        'yieldbot',
        'walkathon'
      ]
    },
    {
      name: '/2476204/leaderboard',
      sizes: [
        [728, 90]
      ],
      elementId: 'div-leaderboard',
      bidProviders: [
        'yieldbot',
        'walkathon',
        'carsales'
      ]
    }
  ],
  auctionProvider: {
    name: 'Google',
    libUri: '//www.googletagservices.com/tag/js/gpt.js',
    init: function(targeting, done) {
/* array of targeting objects
      {
        type: 'page',
        targeting: {
          yb_ad: 'y'
        }
      },
      {
        type: 'slot',
        name: '/2476204/multi-size',
        id: 'somerandomid',
        elementId: 'div-multi-size',
        sizes: [
          [300, 250],
          [300, 600]
        ],
        // a flattened list from all bidders
        targeting: {
          foo: ['bar', 'foo.bar'], // from bidder 1 & 2
          foooo: ['bar'], // from bidder 2
          provider1_bid: '400',
          provider2_bid: '200'
        },
        bids: [
          {
            provider: 'provider1',
            id: '1212121',
            targeting: {
              bid: '400',
              foo: 'bar'
            }
          }
        ]
      }
*/
      googletag.cmd.push(function() {
        var i;
        for (i = 0; i < targeting.length; i++) {
          var slot = targeting[i];

          var gptslot = googletag.defineSlot(slot.name, slot.sizes, slot.elementId)
              .addService(googletag.pubads());

          for (var p in slot.targeting) {
            gptslot.setTargeting(p, slot.targeting[p]);
          }
        }
      });
      googletag.cmd.push(function() {
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
        done();
      });

      googletag.cmd.push(function() { googletag.display('div-leaderboard'); });
      googletag.cmd.push(function() { googletag.display('div-multi-size'); });

    },
    refresh: function(targeting, done) {

      googletag.cmd.push(function() {
        googletag.refresh();
        done();
      });
    }
  },<commit_msg>integration test refresh from googletag.PubAdsService.<commit_after>/**
 * pubfood
 */

/* global yieldbot googletag*/
/*eslint no-unused-vars: 0*/

'use strict';

window.googletag = window.googletag || {};
googletag.cmd = googletag.cmd || [];
var ybotq = ybotq || [];

var pubfoodContrib = {
  slots: [
    {
      name: '/2476204/multi-size',
      sizes: [
        [300, 250],
        [300, 600]
      ],
      elementId: 'div-multi-size',
      bidProviders: [
        'yieldbot',
        'walkathon'
      ]
    },
    {
      name: '/2476204/leaderboard',
      sizes: [
        [728, 90]
      ],
      elementId: 'div-leaderboard',
      bidProviders: [
        'yieldbot',
        'walkathon',
        'carsales'
      ]
    }
  ],
  auctionProvider: {
    name: 'Google',
    libUri: '//www.googletagservices.com/tag/js/gpt.js',
    init: function(targeting, done) {
/* array of targeting objects
      {
        type: 'page',
        targeting: {
          yb_ad: 'y'
        }
      },
      {
        type: 'slot',
        name: '/2476204/multi-size',
        id: 'somerandomid',
        elementId: 'div-multi-size',
        sizes: [
          [300, 250],
          [300, 600]
        ],
        // a flattened list from all bidders
        targeting: {
          foo: ['bar', 'foo.bar'], // from bidder 1 & 2
          foooo: ['bar'], // from bidder 2
          provider1_bid: '400',
          provider2_bid: '200'
        },
        bids: [
          {
            provider: 'provider1',
            id: '1212121',
            targeting: {
              bid: '400',
              foo: 'bar'
            }
          }
        ]
      }
*/
      googletag.cmd.push(function() {
        var i;
        for (i = 0; i < targeting.length; i++) {
          var slot = targeting[i];

          var gptslot = googletag.defineSlot(slot.name, slot.sizes, slot.elementId)
              .addService(googletag.pubads());

          for (var p in slot.targeting) {
            gptslot.setTargeting(p, slot.targeting[p]);
          }
        }
      });
      googletag.cmd.push(function() {
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
        done();
      });

      googletag.cmd.push(function() { googletag.display('div-leaderboard'); });
      googletag.cmd.push(function() { googletag.display('div-multi-size'); });

    },
    refresh: function(targeting, done) {
      if (googletag) {
        googletag.pubads().refresh();
        done();
      }
    }
  },
{'fraction_non_alphanumeric': 0.15415495784825373, 'fraction_numerical': 0.029706945002007226, 'mean_word_length': 1.5765253360910032, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5899329', 'n_tokens_mistral': 1760, 'n_tokens_neox': 1626, 'n_words': 295}