repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
typicode/hotel | src/cli/daemon.js | start | function start() {
const node = process.execPath
const daemonFile = path.join(__dirname, '../daemon')
const startupFile = startup.getFile('hotel')
startup.create('hotel', node, [daemonFile], common.logFile)
// Save startup file path in ~/.hotel
// Will be used later by uninstall script
mkdirp.sync(commo... | javascript | function start() {
const node = process.execPath
const daemonFile = path.join(__dirname, '../daemon')
const startupFile = startup.getFile('hotel')
startup.create('hotel', node, [daemonFile], common.logFile)
// Save startup file path in ~/.hotel
// Will be used later by uninstall script
mkdirp.sync(commo... | [
"function",
"start",
"(",
")",
"{",
"const",
"node",
"=",
"process",
".",
"execPath",
"const",
"daemonFile",
"=",
"path",
".",
"join",
"(",
"__dirname",
",",
"'../daemon'",
")",
"const",
"startupFile",
"=",
"startup",
".",
"getFile",
"(",
"'hotel'",
")",
... | Start daemon in background | [
"Start",
"daemon",
"in",
"background"
] | cd4711ad46573f0cdeb59a839aa9f34b43172df5 | https://github.com/typicode/hotel/blob/cd4711ad46573f0cdeb59a839aa9f34b43172df5/src/cli/daemon.js#L15-L28 | train |
marcj/css-element-queries | src/ElementQueries.js | queueQuery | function queueQuery(selector, mode, property, value) {
if (typeof(allQueries[selector]) === 'undefined') {
allQueries[selector] = [];
// add animation to trigger animationstart event, so we know exactly when a element appears in the DOM
var id = idToSelectorM... | javascript | function queueQuery(selector, mode, property, value) {
if (typeof(allQueries[selector]) === 'undefined') {
allQueries[selector] = [];
// add animation to trigger animationstart event, so we know exactly when a element appears in the DOM
var id = idToSelectorM... | [
"function",
"queueQuery",
"(",
"selector",
",",
"mode",
",",
"property",
",",
"value",
")",
"{",
"if",
"(",
"typeof",
"(",
"allQueries",
"[",
"selector",
"]",
")",
"===",
"'undefined'",
")",
"{",
"allQueries",
"[",
"selector",
"]",
"=",
"[",
"]",
";",
... | Stores rules to the selector that should be applied once resized.
@param {String} selector
@param {String} mode min|max
@param {String} property width|height
@param {String} value | [
"Stores",
"rules",
"to",
"the",
"selector",
"that",
"should",
"be",
"applied",
"once",
"resized",
"."
] | 31cabb56fb2af08470159251f6e535e2c3577758 | https://github.com/marcj/css-element-queries/blob/31cabb56fb2af08470159251f6e535e2c3577758/src/ElementQueries.js#L190-L206 | train |
marcj/css-element-queries | src/ElementQueries.js | findElementQueriesElements | function findElementQueriesElements(container) {
var query = getQuery(container);
for (var selector in allQueries) if (allQueries.hasOwnProperty(selector)) {
// find all elements based on the extract query selector from the element query rule
var elements = query... | javascript | function findElementQueriesElements(container) {
var query = getQuery(container);
for (var selector in allQueries) if (allQueries.hasOwnProperty(selector)) {
// find all elements based on the extract query selector from the element query rule
var elements = query... | [
"function",
"findElementQueriesElements",
"(",
"container",
")",
"{",
"var",
"query",
"=",
"getQuery",
"(",
"container",
")",
";",
"for",
"(",
"var",
"selector",
"in",
"allQueries",
")",
"if",
"(",
"allQueries",
".",
"hasOwnProperty",
"(",
"selector",
")",
"... | If animationStart didn't catch a new element in the DOM, we can manually search for it | [
"If",
"animationStart",
"didn",
"t",
"catch",
"a",
"new",
"element",
"in",
"the",
"DOM",
"we",
"can",
"manually",
"search",
"for",
"it"
] | 31cabb56fb2af08470159251f6e535e2c3577758 | https://github.com/marcj/css-element-queries/blob/31cabb56fb2af08470159251f6e535e2c3577758/src/ElementQueries.js#L224-L235 | train |
TypeStrong/typedoc | scripts/rebuild_specs.js | getFiles | function getFiles(base, dir = '', results = []) {
const files = fs.readdirSync(path.join(base, dir));
for (const file of files) {
const relativeToBase = path.join(dir, file);
if (fs.statSync(path.join(base, relativeToBase)).isDirectory()) {
get... | javascript | function getFiles(base, dir = '', results = []) {
const files = fs.readdirSync(path.join(base, dir));
for (const file of files) {
const relativeToBase = path.join(dir, file);
if (fs.statSync(path.join(base, relativeToBase)).isDirectory()) {
get... | [
"function",
"getFiles",
"(",
"base",
",",
"dir",
"=",
"''",
",",
"results",
"=",
"[",
"]",
")",
"{",
"const",
"files",
"=",
"fs",
".",
"readdirSync",
"(",
"path",
".",
"join",
"(",
"base",
",",
"dir",
")",
")",
";",
"for",
"(",
"const",
"file",
... | Rewrite GitHub urls
Avoiding sync methods here is... difficult.
@param {string} base
@param {string} dir
@param {string[]} results
@returns {string[]} | [
"Rewrite",
"GitHub",
"urls",
"Avoiding",
"sync",
"methods",
"here",
"is",
"...",
"difficult",
"."
] | 185ca2fdbf489325edb9880ca90668372232ce03 | https://github.com/TypeStrong/typedoc/blob/185ca2fdbf489325edb9880ca90668372232ce03/scripts/rebuild_specs.js#L66-L77 | train |
hiloteam/Hilo | build/amd/hilo-amd.js | function(font){
var me = this;
if(me.font !== font){
me.font = font;
me._fontHeight = Text.measureFontHeight(font);
}
return me;
} | javascript | function(font){
var me = this;
if(me.font !== font){
me.font = font;
me._fontHeight = Text.measureFontHeight(font);
}
return me;
} | [
"function",
"(",
"font",
")",
"{",
"var",
"me",
"=",
"this",
";",
"if",
"(",
"me",
".",
"font",
"!==",
"font",
")",
"{",
"me",
".",
"font",
"=",
"font",
";",
"me",
".",
"_fontHeight",
"=",
"Text",
".",
"measureFontHeight",
"(",
"font",
")",
";",
... | read-only
@language=en
Set text CSS font style.
@param {String} font Text CSS font style to set.
@returns {Text} the Text object, chained call supported. | [
"read",
"-",
"only"
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/amd/hilo-amd.js#L4577-L4585 | train | |
hiloteam/Hilo | build/amd/hilo-amd.js | rotateX | function rotateX(x, y, z, ca, sa) {//rotate x
return {
x: x,
y: y * ca - z * sa,
z: y * sa + z * ca
};
} | javascript | function rotateX(x, y, z, ca, sa) {//rotate x
return {
x: x,
y: y * ca - z * sa,
z: y * sa + z * ca
};
} | [
"function",
"rotateX",
"(",
"x",
",",
"y",
",",
"z",
",",
"ca",
",",
"sa",
")",
"{",
"//rotate x",
"return",
"{",
"x",
":",
"x",
",",
"y",
":",
"y",
"*",
"ca",
"-",
"z",
"*",
"sa",
",",
"z",
":",
"y",
"*",
"sa",
"+",
"z",
"*",
"ca",
"}"... | Rotate the axis. | [
"Rotate",
"the",
"axis",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/amd/hilo-amd.js#L7627-L7633 | train |
hiloteam/Hilo | build/physics/physics.js | function(p1, p2, r1, r2)
{
var mindist = r1 + r2;
var delta = vsub(p2, p1);
var distsq = vlengthsq(delta);
if(distsq >= mindist*mindist) return;
var dist = Math.sqrt(distsq);
// Allocate and initialize the contact.
return new Contact(
vadd(p1, vmult(delta, 0.5 + (r1 - 0.5*mindi... | javascript | function(p1, p2, r1, r2)
{
var mindist = r1 + r2;
var delta = vsub(p2, p1);
var distsq = vlengthsq(delta);
if(distsq >= mindist*mindist) return;
var dist = Math.sqrt(distsq);
// Allocate and initialize the contact.
return new Contact(
vadd(p1, vmult(delta, 0.5 + (r1 - 0.5*mindi... | [
"function",
"(",
"p1",
",",
"p2",
",",
"r1",
",",
"r2",
")",
"{",
"var",
"mindist",
"=",
"r1",
"+",
"r2",
";",
"var",
"delta",
"=",
"vsub",
"(",
"p2",
",",
"p1",
")",
";",
"var",
"distsq",
"=",
"vlengthsq",
"(",
"delta",
")",
";",
"if",
"(",
... | Add contact points for circle to circle collisions. Used by several collision tests. | [
"Add",
"contact",
"points",
"for",
"circle",
"to",
"circle",
"collisions",
".",
"Used",
"by",
"several",
"collision",
"tests",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3247-L3263 | train | |
hiloteam/Hilo | build/physics/physics.js | function(circ1, circ2)
{
var contact = circle2circleQuery(circ1.tc, circ2.tc, circ1.r, circ2.r);
return contact ? [contact] : NONE;
} | javascript | function(circ1, circ2)
{
var contact = circle2circleQuery(circ1.tc, circ2.tc, circ1.r, circ2.r);
return contact ? [contact] : NONE;
} | [
"function",
"(",
"circ1",
",",
"circ2",
")",
"{",
"var",
"contact",
"=",
"circle2circleQuery",
"(",
"circ1",
".",
"tc",
",",
"circ2",
".",
"tc",
",",
"circ1",
".",
"r",
",",
"circ2",
".",
"r",
")",
";",
"return",
"contact",
"?",
"[",
"contact",
"]"... | Collide circle shapes. | [
"Collide",
"circle",
"shapes",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3266-L3270 | train | |
hiloteam/Hilo | build/physics/physics.js | function(poly1, poly2, n, dist)
{
var arr = [];
var verts1 = poly1.tVerts;
for(var i=0; i<verts1.length; i+=2){
var vx = verts1[i];
var vy = verts1[i+1];
if(poly2.containsVert(vx, vy)){
arr.push(new Contact(new Vect(vx, vy), n, dist, hashPair(poly1.hashid, i>>1)));
... | javascript | function(poly1, poly2, n, dist)
{
var arr = [];
var verts1 = poly1.tVerts;
for(var i=0; i<verts1.length; i+=2){
var vx = verts1[i];
var vy = verts1[i+1];
if(poly2.containsVert(vx, vy)){
arr.push(new Contact(new Vect(vx, vy), n, dist, hashPair(poly1.hashid, i>>1)));
... | [
"function",
"(",
"poly1",
",",
"poly2",
",",
"n",
",",
"dist",
")",
"{",
"var",
"arr",
"=",
"[",
"]",
";",
"var",
"verts1",
"=",
"poly1",
".",
"tVerts",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"verts1",
".",
"length",
";",
"i",
... | Add contacts for penetrating vertexes. | [
"Add",
"contacts",
"for",
"penetrating",
"vertexes",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3353-L3376 | train | |
hiloteam/Hilo | build/physics/physics.js | function(poly1, poly2)
{
var mini1 = findMSA(poly2, poly1.tPlanes);
if(mini1 == -1) return NONE;
var min1 = last_MSA_min;
var mini2 = findMSA(poly1, poly2.tPlanes);
if(mini2 == -1) return NONE;
var min2 = last_MSA_min;
// There is overlap, find the penetrating verts
if(min1 > m... | javascript | function(poly1, poly2)
{
var mini1 = findMSA(poly2, poly1.tPlanes);
if(mini1 == -1) return NONE;
var min1 = last_MSA_min;
var mini2 = findMSA(poly1, poly2.tPlanes);
if(mini2 == -1) return NONE;
var min2 = last_MSA_min;
// There is overlap, find the penetrating verts
if(min1 > m... | [
"function",
"(",
"poly1",
",",
"poly2",
")",
"{",
"var",
"mini1",
"=",
"findMSA",
"(",
"poly2",
",",
"poly1",
".",
"tPlanes",
")",
";",
"if",
"(",
"mini1",
"==",
"-",
"1",
")",
"return",
"NONE",
";",
"var",
"min1",
"=",
"last_MSA_min",
";",
"var",
... | Collide poly shapes together. | [
"Collide",
"poly",
"shapes",
"together",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3379-L3394 | train | |
hiloteam/Hilo | build/physics/physics.js | function(arr, seg, poly, pDist, coef)
{
var dta = vcross(seg.tn, seg.ta);
var dtb = vcross(seg.tn, seg.tb);
var n = vmult(seg.tn, coef);
var verts = poly.tVerts;
for(var i=0; i<verts.length; i+=2){
var vx = verts[i];
var vy = verts[i+1];
if(vdot2(vx, vy, n.x, n.y) < vdo... | javascript | function(arr, seg, poly, pDist, coef)
{
var dta = vcross(seg.tn, seg.ta);
var dtb = vcross(seg.tn, seg.tb);
var n = vmult(seg.tn, coef);
var verts = poly.tVerts;
for(var i=0; i<verts.length; i+=2){
var vx = verts[i];
var vy = verts[i+1];
if(vdot2(vx, vy, n.x, n.y) < vdo... | [
"function",
"(",
"arr",
",",
"seg",
",",
"poly",
",",
"pDist",
",",
"coef",
")",
"{",
"var",
"dta",
"=",
"vcross",
"(",
"seg",
".",
"tn",
",",
"seg",
".",
"ta",
")",
";",
"var",
"dtb",
"=",
"vcross",
"(",
"seg",
".",
"tn",
",",
"seg",
".",
... | Identify vertexes that have penetrated the segment. | [
"Identify",
"vertexes",
"that",
"have",
"penetrated",
"the",
"segment",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L3405-L3422 | train | |
hiloteam/Hilo | build/physics/physics.js | function(a, b, r1, r2, k1, k2)
{
// calculate mass matrix
// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...
var k11, k12, k21, k22;
var m_sum = a.m_inv + b.m_inv;
// start with I*m_sum
k11 = m_sum; k12 = 0;
k21 = 0; k22 = m_sum;
// add the in... | javascript | function(a, b, r1, r2, k1, k2)
{
// calculate mass matrix
// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...
var k11, k12, k21, k22;
var m_sum = a.m_inv + b.m_inv;
// start with I*m_sum
k11 = m_sum; k12 = 0;
k21 = 0; k22 = m_sum;
// add the in... | [
"function",
"(",
"a",
",",
"b",
",",
"r1",
",",
"r2",
",",
"k1",
",",
"k2",
")",
"{",
"// calculate mass matrix",
"// If I wasn't lazy and wrote a proper matrix class, this wouldn't be so gross...",
"var",
"k11",
",",
"k12",
",",
"k21",
",",
"k22",
";",
"var",
"... | k1 and k2 are modified by the function to contain the outputs. | [
"k1",
"and",
"k2",
"are",
"modified",
"by",
"the",
"function",
"to",
"contain",
"the",
"outputs",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/build/physics/physics.js#L5083-L5118 | train | |
hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/frame/Opt.js | function(args, optNames) {
var opt = {"_": []}; // the unnamed option allows multiple values
for (var i = 0; i < args.length; i++) {
var arg = new String(args[i]);
var name;
var value;
if (arg.charAt(0) == "-") {
if (arg.charAt(1) == "-") { // it's a longname like --foo
arg = arg.substring(2);
... | javascript | function(args, optNames) {
var opt = {"_": []}; // the unnamed option allows multiple values
for (var i = 0; i < args.length; i++) {
var arg = new String(args[i]);
var name;
var value;
if (arg.charAt(0) == "-") {
if (arg.charAt(1) == "-") { // it's a longname like --foo
arg = arg.substring(2);
... | [
"function",
"(",
"args",
",",
"optNames",
")",
"{",
"var",
"opt",
"=",
"{",
"\"_\"",
":",
"[",
"]",
"}",
";",
"// the unnamed option allows multiple values",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",... | Get commandline option values.
@param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"]
@param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}.
@return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true} | [
"Get",
"commandline",
"option",
"values",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/frame/Opt.js#L9-L60 | train | |
hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/run.js | function(/**Array*/ path) {
if (path.constructor != Array) path = path.split(/[\\\/]/);
var make = "";
for (var i = 0, l = path.length; i < l; i++) {
make += path[i] + SYS.slash;
if (! IO.exists(make)) {
IO.makeDir(make);
}
}
} | javascript | function(/**Array*/ path) {
if (path.constructor != Array) path = path.split(/[\\\/]/);
var make = "";
for (var i = 0, l = path.length; i < l; i++) {
make += path[i] + SYS.slash;
if (! IO.exists(make)) {
IO.makeDir(make);
}
}
} | [
"function",
"(",
"/**Array*/",
"path",
")",
"{",
"if",
"(",
"path",
".",
"constructor",
"!=",
"Array",
")",
"path",
"=",
"path",
".",
"split",
"(",
"/",
"[\\\\\\/]",
"/",
")",
";",
"var",
"make",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"0"... | Creates a series of nested directories. | [
"Creates",
"a",
"series",
"of",
"nested",
"directories",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/run.js#L220-L229 | train | |
hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/run.js | function(path) {
if (!path) return;
for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
if (/\.js$/i.test(lib[i])) load(lib[i]);
} | javascript | function(path) {
if (!path) return;
for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
if (/\.js$/i.test(lib[i])) load(lib[i]);
} | [
"function",
"(",
"path",
")",
"{",
"if",
"(",
"!",
"path",
")",
"return",
";",
"for",
"(",
"var",
"lib",
"=",
"IO",
".",
"ls",
"(",
"SYS",
".",
"pwd",
"+",
"path",
")",
",",
"i",
"=",
"0",
";",
"i",
"<",
"lib",
".",
"length",
";",
"i",
"+... | Loads all scripts from the given directory path. | [
"Loads",
"all",
"scripts",
"from",
"the",
"given",
"directory",
"path",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/run.js#L336-L341 | train | |
hiloteam/Hilo | tools/jsdoc-toolkit-2.4.0/app/frame/Link.js | Link | function Link() {
this.alias = "";
this.src = "";
this.file = "";
this.text = "";
this.innerName = "";
this.classLink = false;
this.targetName = "";
this.target = function(targetName) {
if (defined(targetName)) this.targetName = targetName;
return this;
}
this.inner = function(inner) {
if (defined(inn... | javascript | function Link() {
this.alias = "";
this.src = "";
this.file = "";
this.text = "";
this.innerName = "";
this.classLink = false;
this.targetName = "";
this.target = function(targetName) {
if (defined(targetName)) this.targetName = targetName;
return this;
}
this.inner = function(inner) {
if (defined(inn... | [
"function",
"Link",
"(",
")",
"{",
"this",
".",
"alias",
"=",
"\"\"",
";",
"this",
".",
"src",
"=",
"\"\"",
";",
"this",
".",
"file",
"=",
"\"\"",
";",
"this",
".",
"text",
"=",
"\"\"",
";",
"this",
".",
"innerName",
"=",
"\"\"",
";",
"this",
"... | Handle the creation of HTML links to documented symbols.
@constructor | [
"Handle",
"the",
"creation",
"of",
"HTML",
"links",
"to",
"documented",
"symbols",
"."
] | 491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea | https://github.com/hiloteam/Hilo/blob/491c8d6358b3dccbd1ca7b5562dc3a2777a7cfea/tools/jsdoc-toolkit-2.4.0/app/frame/Link.js#L4-L68 | train |
react-native-community/react-native-svg | index.web.js | prepare | function prepare(props) {
const {
translate,
scale,
rotation,
skewX,
skewY,
originX,
originY,
fontFamily,
fontSize,
fontWeight,
fontStyle,
style,
...clean
} = props;
const transform = [];
if (originX != null || originY != null) {
transform.push(`translat... | javascript | function prepare(props) {
const {
translate,
scale,
rotation,
skewX,
skewY,
originX,
originY,
fontFamily,
fontSize,
fontWeight,
fontStyle,
style,
...clean
} = props;
const transform = [];
if (originX != null || originY != null) {
transform.push(`translat... | [
"function",
"prepare",
"(",
"props",
")",
"{",
"const",
"{",
"translate",
",",
"scale",
",",
"rotation",
",",
"skewX",
",",
"skewY",
",",
"originX",
",",
"originY",
",",
"fontFamily",
",",
"fontSize",
",",
"fontWeight",
",",
"fontStyle",
",",
"style",
",... | `react-native-svg` supports additional props that aren't defined in the spec.
This function replaces them in a spec conforming manner.
@param {Object} props Properties given to us.
@returns {Object} Cleaned object.
@private | [
"react",
"-",
"native",
"-",
"svg",
"supports",
"additional",
"props",
"that",
"aren",
"t",
"defined",
"in",
"the",
"spec",
".",
"This",
"function",
"replaces",
"them",
"in",
"a",
"spec",
"conforming",
"manner",
"."
] | 235ded3d09e1b0a05957d3ba8a42424916d34f38 | https://github.com/react-native-community/react-native-svg/blob/235ded3d09e1b0a05957d3ba8a42424916d34f38/index.web.js#L13-L77 | train |
garris/BackstopJS | core/util/runPuppet.js | translateUrl | function translateUrl (url) {
const RE = new RegExp('^[./]');
if (RE.test(url)) {
const fileUrl = 'file://' + path.join(process.cwd(), url);
console.log('Relative filename detected -- translating to ' + fileUrl);
return fileUrl;
} else {
return url;
}
} | javascript | function translateUrl (url) {
const RE = new RegExp('^[./]');
if (RE.test(url)) {
const fileUrl = 'file://' + path.join(process.cwd(), url);
console.log('Relative filename detected -- translating to ' + fileUrl);
return fileUrl;
} else {
return url;
}
} | [
"function",
"translateUrl",
"(",
"url",
")",
"{",
"const",
"RE",
"=",
"new",
"RegExp",
"(",
"'^[./]'",
")",
";",
"if",
"(",
"RE",
".",
"test",
"(",
"url",
")",
")",
"{",
"const",
"fileUrl",
"=",
"'file://'",
"+",
"path",
".",
"join",
"(",
"process"... | handle relative file name | [
"handle",
"relative",
"file",
"name"
] | d0a5ade11c1d8732158e6218a6f8a288f0bfc4db | https://github.com/garris/BackstopJS/blob/d0a5ade11c1d8732158e6218a6f8a288f0bfc4db/core/util/runPuppet.js#L397-L406 | train |
prebid/Prebid.js | modules/consentManagement.js | processCmpData | function processCmpData(consentObject, hookConfig) {
let gdprApplies = consentObject && consentObject.getConsentData && consentObject.getConsentData.gdprApplies;
if (
(typeof gdprApplies !== 'boolean') ||
(gdprApplies === true &&
!(utils.isStr(consentObject.getConsentData.consentData) &&
utils... | javascript | function processCmpData(consentObject, hookConfig) {
let gdprApplies = consentObject && consentObject.getConsentData && consentObject.getConsentData.gdprApplies;
if (
(typeof gdprApplies !== 'boolean') ||
(gdprApplies === true &&
!(utils.isStr(consentObject.getConsentData.consentData) &&
utils... | [
"function",
"processCmpData",
"(",
"consentObject",
",",
"hookConfig",
")",
"{",
"let",
"gdprApplies",
"=",
"consentObject",
"&&",
"consentObject",
".",
"getConsentData",
"&&",
"consentObject",
".",
"getConsentData",
".",
"gdprApplies",
";",
"if",
"(",
"(",
"typeo... | This function checks the consent data provided by CMP to ensure it's in an expected state.
If it's bad, we exit the module depending on config settings.
If it's good, then we store the value and exits the module.
@param {object} consentObject required; object returned by CMP that contains user's consent choices
@param ... | [
"This",
"function",
"checks",
"the",
"consent",
"data",
"provided",
"by",
"CMP",
"to",
"ensure",
"it",
"s",
"in",
"an",
"expected",
"state",
".",
"If",
"it",
"s",
"bad",
"we",
"exit",
"the",
"module",
"depending",
"on",
"config",
"settings",
".",
"If",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L234-L252 | train |
prebid/Prebid.js | modules/consentManagement.js | cmpFailed | function cmpFailed(errMsg, hookConfig, extraArgs) {
clearTimeout(hookConfig.timer);
// still set the consentData to undefined when there is a problem as per config options
if (allowAuction) {
storeConsentData(undefined);
}
exitModule(errMsg, hookConfig, extraArgs);
} | javascript | function cmpFailed(errMsg, hookConfig, extraArgs) {
clearTimeout(hookConfig.timer);
// still set the consentData to undefined when there is a problem as per config options
if (allowAuction) {
storeConsentData(undefined);
}
exitModule(errMsg, hookConfig, extraArgs);
} | [
"function",
"cmpFailed",
"(",
"errMsg",
",",
"hookConfig",
",",
"extraArgs",
")",
"{",
"clearTimeout",
"(",
"hookConfig",
".",
"timer",
")",
";",
"// still set the consentData to undefined when there is a problem as per config options",
"if",
"(",
"allowAuction",
")",
"{"... | This function contains the controlled steps to perform when there's a problem with CMP.
@param {string} errMsg required; should be a short descriptive message for why the failure/issue happened.
@param {object} hookConfig contains module related variables (see comment in requestBidsHook function)
@param {object} extraA... | [
"This",
"function",
"contains",
"the",
"controlled",
"steps",
"to",
"perform",
"when",
"there",
"s",
"a",
"problem",
"with",
"CMP",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L267-L275 | train |
prebid/Prebid.js | modules/consentManagement.js | exitModule | function exitModule(errMsg, hookConfig, extraArgs) {
if (hookConfig.haveExited === false) {
hookConfig.haveExited = true;
let context = hookConfig.context;
let args = hookConfig.args;
let nextFn = hookConfig.nextFn;
if (errMsg) {
if (allowAuction) {
utils.logWarn(errMsg + ' Resumin... | javascript | function exitModule(errMsg, hookConfig, extraArgs) {
if (hookConfig.haveExited === false) {
hookConfig.haveExited = true;
let context = hookConfig.context;
let args = hookConfig.args;
let nextFn = hookConfig.nextFn;
if (errMsg) {
if (allowAuction) {
utils.logWarn(errMsg + ' Resumin... | [
"function",
"exitModule",
"(",
"errMsg",
",",
"hookConfig",
",",
"extraArgs",
")",
"{",
"if",
"(",
"hookConfig",
".",
"haveExited",
"===",
"false",
")",
"{",
"hookConfig",
".",
"haveExited",
"=",
"true",
";",
"let",
"context",
"=",
"hookConfig",
".",
"cont... | This function handles the exit logic for the module.
There are several paths in the module's logic to call this function and we only allow 1 of the 3 potential exits to happen before suppressing others.
We prevent multiple exits to avoid conflicting messages in the console depending on certain scenarios.
One scenario ... | [
"This",
"function",
"handles",
"the",
"exit",
"logic",
"for",
"the",
"module",
".",
"There",
"are",
"several",
"paths",
"in",
"the",
"module",
"s",
"logic",
"to",
"call",
"this",
"function",
"and",
"we",
"only",
"allow",
"1",
"of",
"the",
"3",
"potential... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/consentManagement.js#L307-L331 | train |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | function (bidRequests, bidderRequest) {
return {
data: bidToTag(bidRequests, bidderRequest),
bidderRequest,
method: 'GET',
url: URL
};
} | javascript | function (bidRequests, bidderRequest) {
return {
data: bidToTag(bidRequests, bidderRequest),
bidderRequest,
method: 'GET',
url: URL
};
} | [
"function",
"(",
"bidRequests",
",",
"bidderRequest",
")",
"{",
"return",
"{",
"data",
":",
"bidToTag",
"(",
"bidRequests",
",",
"bidderRequest",
")",
",",
"bidderRequest",
",",
"method",
":",
"'GET'",
",",
"url",
":",
"URL",
"}",
";",
"}"
] | Make a server request from the list of BidRequests
@param bidRequests
@param bidderRequest | [
"Make",
"a",
"server",
"request",
"from",
"the",
"list",
"of",
"BidRequests"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L64-L71 | train | |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | function (serverResponse, {bidderRequest}) {
serverResponse = serverResponse.body;
let bids = [];
if (!utils.isArray(serverResponse)) {
return parseRTBResponse(serverResponse, bidderRequest);
}
serverResponse.forEach(serverBidResponse => {
bids = utils.flatten(bids, parseRTBResponse(se... | javascript | function (serverResponse, {bidderRequest}) {
serverResponse = serverResponse.body;
let bids = [];
if (!utils.isArray(serverResponse)) {
return parseRTBResponse(serverResponse, bidderRequest);
}
serverResponse.forEach(serverBidResponse => {
bids = utils.flatten(bids, parseRTBResponse(se... | [
"function",
"(",
"serverResponse",
",",
"{",
"bidderRequest",
"}",
")",
"{",
"serverResponse",
"=",
"serverResponse",
".",
"body",
";",
"let",
"bids",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"utils",
".",
"isArray",
"(",
"serverResponse",
")",
")",
"{",
"r... | Unpack the response from the server into a list of bids
@param serverResponse
@param bidderRequest
@return {Bid[]} An array of bids which were nested inside the server | [
"Unpack",
"the",
"response",
"from",
"the",
"server",
"into",
"a",
"list",
"of",
"bids"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L79-L92 | train | |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | getMediaType | function getMediaType(bidderRequest) {
const videoMediaType = utils.deepAccess(bidderRequest, 'mediaTypes.video');
const context = utils.deepAccess(bidderRequest, 'mediaTypes.video.context');
return !videoMediaType ? DISPLAY : context === OUTSTREAM ? OUTSTREAM : VIDEO;
} | javascript | function getMediaType(bidderRequest) {
const videoMediaType = utils.deepAccess(bidderRequest, 'mediaTypes.video');
const context = utils.deepAccess(bidderRequest, 'mediaTypes.video.context');
return !videoMediaType ? DISPLAY : context === OUTSTREAM ? OUTSTREAM : VIDEO;
} | [
"function",
"getMediaType",
"(",
"bidderRequest",
")",
"{",
"const",
"videoMediaType",
"=",
"utils",
".",
"deepAccess",
"(",
"bidderRequest",
",",
"'mediaTypes.video'",
")",
";",
"const",
"context",
"=",
"utils",
".",
"deepAccess",
"(",
"bidderRequest",
",",
"'m... | Prepare all parameters for request
@param bidderRequest {object}
@returns {object} | [
"Prepare",
"all",
"parameters",
"for",
"request"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L164-L169 | train |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | createBid | function createBid(bidResponse, mediaType) {
let bid = {
requestId: bidResponse.requestId,
creativeId: bidResponse.cmpId,
height: bidResponse.height,
currency: bidResponse.cur,
width: bidResponse.width,
cpm: bidResponse.cpm,
netRevenue: true,
mediaType,
ttl: 3600
};
if (mediaT... | javascript | function createBid(bidResponse, mediaType) {
let bid = {
requestId: bidResponse.requestId,
creativeId: bidResponse.cmpId,
height: bidResponse.height,
currency: bidResponse.cur,
width: bidResponse.width,
cpm: bidResponse.cpm,
netRevenue: true,
mediaType,
ttl: 3600
};
if (mediaT... | [
"function",
"createBid",
"(",
"bidResponse",
",",
"mediaType",
")",
"{",
"let",
"bid",
"=",
"{",
"requestId",
":",
"bidResponse",
".",
"requestId",
",",
"creativeId",
":",
"bidResponse",
".",
"cmpId",
",",
"height",
":",
"bidResponse",
".",
"height",
",",
... | Configure new bid by response
@param bidResponse {object}
@param mediaType {Object}
@returns {object} | [
"Configure",
"new",
"bid",
"by",
"response"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L177-L209 | train |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | newRenderer | function newRenderer(requestId) {
const renderer = Renderer.install({
id: requestId,
url: OUTSTREAM_SRC,
loaded: false
});
renderer.setRender(outstreamRender);
return renderer;
} | javascript | function newRenderer(requestId) {
const renderer = Renderer.install({
id: requestId,
url: OUTSTREAM_SRC,
loaded: false
});
renderer.setRender(outstreamRender);
return renderer;
} | [
"function",
"newRenderer",
"(",
"requestId",
")",
"{",
"const",
"renderer",
"=",
"Renderer",
".",
"install",
"(",
"{",
"id",
":",
"requestId",
",",
"url",
":",
"OUTSTREAM_SRC",
",",
"loaded",
":",
"false",
"}",
")",
";",
"renderer",
".",
"setRender",
"("... | Create Adtelligent renderer
@param requestId
@returns {*} | [
"Create",
"Adtelligent",
"renderer"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L216-L226 | train |
prebid/Prebid.js | modules/adtelligentBidAdapter.js | outstreamRender | function outstreamRender(bid) {
bid.renderer.push(() => {
window.VOutstreamAPI.initOutstreams([{
width: bid.width,
height: bid.height,
vastUrl: bid.vastUrl,
elId: bid.adUnitCode
}]);
});
} | javascript | function outstreamRender(bid) {
bid.renderer.push(() => {
window.VOutstreamAPI.initOutstreams([{
width: bid.width,
height: bid.height,
vastUrl: bid.vastUrl,
elId: bid.adUnitCode
}]);
});
} | [
"function",
"outstreamRender",
"(",
"bid",
")",
"{",
"bid",
".",
"renderer",
".",
"push",
"(",
"(",
")",
"=>",
"{",
"window",
".",
"VOutstreamAPI",
".",
"initOutstreams",
"(",
"[",
"{",
"width",
":",
"bid",
".",
"width",
",",
"height",
":",
"bid",
".... | Initialise Adtelligent outstream
@param bid | [
"Initialise",
"Adtelligent",
"outstream"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adtelligentBidAdapter.js#L232-L241 | train |
prebid/Prebid.js | modules/lifestreetBidAdapter.js | formatBidRequest | function formatBidRequest(bid, bidderRequest) {
let url = urlTemplate({
adapter: 'prebid',
slot: bid.params.slot,
adkey: bid.params.adkey,
ad_size: bid.params.ad_size,
location: encodeURIComponent(utils.getTopWindowLocation()),
referrer: encodeURIComponent(utils.getTopWindowReferrer()),
wn... | javascript | function formatBidRequest(bid, bidderRequest) {
let url = urlTemplate({
adapter: 'prebid',
slot: bid.params.slot,
adkey: bid.params.adkey,
ad_size: bid.params.ad_size,
location: encodeURIComponent(utils.getTopWindowLocation()),
referrer: encodeURIComponent(utils.getTopWindowReferrer()),
wn... | [
"function",
"formatBidRequest",
"(",
"bid",
",",
"bidderRequest",
")",
"{",
"let",
"url",
"=",
"urlTemplate",
"(",
"{",
"adapter",
":",
"'prebid'",
",",
"slot",
":",
"bid",
".",
"params",
".",
"slot",
",",
"adkey",
":",
"bid",
".",
"params",
".",
"adke... | Creates a bid requests for a given bid.
@param {BidRequest} bid The bid params to use for formatting a request | [
"Creates",
"a",
"bid",
"requests",
"for",
"a",
"given",
"bid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L15-L46 | train |
prebid/Prebid.js | modules/lifestreetBidAdapter.js | template | function template(strings, ...keys) {
return function(...values) {
let dict = values[values.length - 1] || {};
let result = [strings[0]];
keys.forEach(function(key, i) {
let value = isInteger(key) ? values[key] : dict[key];
result.push(value, strings[i + 1]);
});
return result.join('')... | javascript | function template(strings, ...keys) {
return function(...values) {
let dict = values[values.length - 1] || {};
let result = [strings[0]];
keys.forEach(function(key, i) {
let value = isInteger(key) ? values[key] : dict[key];
result.push(value, strings[i + 1]);
});
return result.join('')... | [
"function",
"template",
"(",
"strings",
",",
"...",
"keys",
")",
"{",
"return",
"function",
"(",
"...",
"values",
")",
"{",
"let",
"dict",
"=",
"values",
"[",
"values",
".",
"length",
"-",
"1",
"]",
"||",
"{",
"}",
";",
"let",
"result",
"=",
"[",
... | A helper function to form URL from the template | [
"A",
"helper",
"function",
"to",
"form",
"URL",
"from",
"the",
"template"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L51-L61 | train |
prebid/Prebid.js | modules/lifestreetBidAdapter.js | isResponseValid | function isResponseValid(response) {
return !/^\s*\{\s*"advertisementAvailable"\s*:\s*false/i.test(response.content) &&
response.content.indexOf('<VAST version="2.0"></VAST>') === -1 && (typeof response.cpm !== 'undefined') &&
response.status === 1;
} | javascript | function isResponseValid(response) {
return !/^\s*\{\s*"advertisementAvailable"\s*:\s*false/i.test(response.content) &&
response.content.indexOf('<VAST version="2.0"></VAST>') === -1 && (typeof response.cpm !== 'undefined') &&
response.status === 1;
} | [
"function",
"isResponseValid",
"(",
"response",
")",
"{",
"return",
"!",
"/",
"^\\s*\\{\\s*\"advertisementAvailable\"\\s*:\\s*false",
"/",
"i",
".",
"test",
"(",
"response",
".",
"content",
")",
"&&",
"response",
".",
"content",
".",
"indexOf",
"(",
"'<VAST versio... | Validates response from Lifestreet AD server | [
"Validates",
"response",
"from",
"Lifestreet",
"AD",
"server"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L81-L85 | train |
prebid/Prebid.js | modules/lifestreetBidAdapter.js | function(bid) {
return !!(bid.params.slot && bid.params.adkey && bid.params.ad_size);
} | javascript | function(bid) {
return !!(bid.params.slot && bid.params.adkey && bid.params.ad_size);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
".",
"params",
".",
"slot",
"&&",
"bid",
".",
"params",
".",
"adkey",
"&&",
"bid",
".",
"params",
".",
"ad_size",
")",
";",
"}"
] | Lifestreet supports banner and video media types
Determines whether or not the given bid request is valid.
@param {BidRequest} bid The bid params to validate.
@return boolean True if this is a valid bid, and false otherwise. | [
"Lifestreet",
"supports",
"banner",
"and",
"video",
"media",
"types",
"Determines",
"whether",
"or",
"not",
"the",
"given",
"bid",
"request",
"is",
"valid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/lifestreetBidAdapter.js#L98-L100 | train | |
prebid/Prebid.js | modules/telariaBidAdapter.js | function (bid) {
return !!(bid && bid.params && bid.params.adCode && bid.params.supplyCode);
} | javascript | function (bid) {
return !!(bid && bid.params && bid.params.adCode && bid.params.supplyCode);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
"&&",
"bid",
".",
"params",
"&&",
"bid",
".",
"params",
".",
"adCode",
"&&",
"bid",
".",
"params",
".",
"supplyCode",
")",
";",
"}"
] | Determines if the request is valid
@param bid
@returns {*|string} | [
"Determines",
"if",
"the",
"request",
"is",
"valid"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L19-L21 | train | |
prebid/Prebid.js | modules/telariaBidAdapter.js | function (syncOptions, serverResponses) {
const syncs = [];
if (syncOptions.pixelEnabled && serverResponses.length) {
try {
serverResponses[0].body.ext.telaria.userSync.forEach(url => syncs.push({type: 'image', url: url}));
} catch (e) {}
}
return syncs;
} | javascript | function (syncOptions, serverResponses) {
const syncs = [];
if (syncOptions.pixelEnabled && serverResponses.length) {
try {
serverResponses[0].body.ext.telaria.userSync.forEach(url => syncs.push({type: 'image', url: url}));
} catch (e) {}
}
return syncs;
} | [
"function",
"(",
"syncOptions",
",",
"serverResponses",
")",
"{",
"const",
"syncs",
"=",
"[",
"]",
";",
"if",
"(",
"syncOptions",
".",
"pixelEnabled",
"&&",
"serverResponses",
".",
"length",
")",
"{",
"try",
"{",
"serverResponses",
"[",
"0",
"]",
".",
"b... | We support pixel syncing only at the moment. Telaria ad server returns 'ext'
as an optional parameter if the tag has 'incIdSync' parameter set to true
@param syncOptions
@param serverResponses
@returns {Array} | [
"We",
"support",
"pixel",
"syncing",
"only",
"at",
"the",
"moment",
".",
"Telaria",
"ad",
"server",
"returns",
"ext",
"as",
"an",
"optional",
"parameter",
"if",
"the",
"tag",
"has",
"incIdSync",
"parameter",
"set",
"to",
"true"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L100-L108 | train | |
prebid/Prebid.js | modules/telariaBidAdapter.js | createBid | function createBid(status, reqBid, response, width, height, bidderCode) {
let bid = createBidFactory(status, reqBid);
// TTL 5 mins by default, future support for extended imp wait time
if (response) {
Object.assign(bid, {
requestId: reqBid.bidId,
cpm: response.price,
creativeId: response.c... | javascript | function createBid(status, reqBid, response, width, height, bidderCode) {
let bid = createBidFactory(status, reqBid);
// TTL 5 mins by default, future support for extended imp wait time
if (response) {
Object.assign(bid, {
requestId: reqBid.bidId,
cpm: response.price,
creativeId: response.c... | [
"function",
"createBid",
"(",
"status",
",",
"reqBid",
",",
"response",
",",
"width",
",",
"height",
",",
"bidderCode",
")",
"{",
"let",
"bid",
"=",
"createBidFactory",
"(",
"status",
",",
"reqBid",
")",
";",
"// TTL 5 mins by default, future support for extended ... | Create and return a bid object based on status and tag
@param status
@param reqBid
@param response
@param width
@param height
@param bidderCode | [
"Create",
"and",
"return",
"a",
"bid",
"object",
"based",
"on",
"status",
"and",
"tag"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/telariaBidAdapter.js#L186-L210 | train |
prebid/Prebid.js | modules/iasBidAdapter.js | stringifySlotSizes | function stringifySlotSizes(sizes) {
let result = '';
if (utils.isArray(sizes)) {
result = sizes.reduce((acc, size) => {
acc.push(size.join('.'));
return acc;
}, []);
result = '[' + result.join(',') + ']';
}
return result;
} | javascript | function stringifySlotSizes(sizes) {
let result = '';
if (utils.isArray(sizes)) {
result = sizes.reduce((acc, size) => {
acc.push(size.join('.'));
return acc;
}, []);
result = '[' + result.join(',') + ']';
}
return result;
} | [
"function",
"stringifySlotSizes",
"(",
"sizes",
")",
"{",
"let",
"result",
"=",
"''",
";",
"if",
"(",
"utils",
".",
"isArray",
"(",
"sizes",
")",
")",
"{",
"result",
"=",
"sizes",
".",
"reduce",
"(",
"(",
"acc",
",",
"size",
")",
"=>",
"{",
"acc",
... | Converts GPT-style size array into a string
@param {Array} sizes: list of GPT-style sizes, e.g. [[300, 250], [300, 300]]
@return {String} a string containing sizes, e.g. '[300.250,300.300]' | [
"Converts",
"GPT",
"-",
"style",
"size",
"array",
"into",
"a",
"string"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/iasBidAdapter.js#L18-L28 | train |
prebid/Prebid.js | modules/adpod.js | attachPriceIndustryDurationKeyToBid | function attachPriceIndustryDurationKeyToBid(bid, brandCategoryExclusion) {
let initialCacheKey = bidCacheRegistry.getInitialCacheKey(bid);
let duration = utils.deepAccess(bid, 'video.durationBucket');
let cpmFixed = bid.cpm.toFixed(2);
let pcd;
if (brandCategoryExclusion) {
let category = utils.deepAcce... | javascript | function attachPriceIndustryDurationKeyToBid(bid, brandCategoryExclusion) {
let initialCacheKey = bidCacheRegistry.getInitialCacheKey(bid);
let duration = utils.deepAccess(bid, 'video.durationBucket');
let cpmFixed = bid.cpm.toFixed(2);
let pcd;
if (brandCategoryExclusion) {
let category = utils.deepAcce... | [
"function",
"attachPriceIndustryDurationKeyToBid",
"(",
"bid",
",",
"brandCategoryExclusion",
")",
"{",
"let",
"initialCacheKey",
"=",
"bidCacheRegistry",
".",
"getInitialCacheKey",
"(",
"bid",
")",
";",
"let",
"duration",
"=",
"utils",
".",
"deepAccess",
"(",
"bid"... | This function reads certain fields from the bid to generate a specific key used for caching the bid in Prebid Cache
@param {Object} bid bid object to update
@param {Boolean} brandCategoryExclusion value read from setConfig; influences whether category is required or not | [
"This",
"function",
"reads",
"certain",
"fields",
"from",
"the",
"bid",
"to",
"generate",
"a",
"specific",
"key",
"used",
"for",
"caching",
"the",
"bid",
"in",
"Prebid",
"Cache"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L117-L137 | train |
prebid/Prebid.js | modules/adpod.js | updateBidQueue | function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) {
let bidListIter = bidCacheRegistry.getBids(bidResponse);
if (bidListIter) {
let bidListArr = from(bidListIter);
let callDispatcher = bidCacheRegistry.getQueueDispatcher(bidResponse);
let killQueue = !!(auctionInstance.getAuctionStat... | javascript | function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) {
let bidListIter = bidCacheRegistry.getBids(bidResponse);
if (bidListIter) {
let bidListArr = from(bidListIter);
let callDispatcher = bidCacheRegistry.getQueueDispatcher(bidResponse);
let killQueue = !!(auctionInstance.getAuctionStat... | [
"function",
"updateBidQueue",
"(",
"auctionInstance",
",",
"bidResponse",
",",
"afterBidAdded",
")",
"{",
"let",
"bidListIter",
"=",
"bidCacheRegistry",
".",
"getBids",
"(",
"bidResponse",
")",
";",
"if",
"(",
"bidListIter",
")",
"{",
"let",
"bidListArr",
"=",
... | Updates the running queue for the associated auction.
Does a check to ensure the auction is still running; if it's not - the previously running queue is killed.
@param {*} auctionInstance running context of the auction
@param {Object} bidResponse bid object being added to queue
@param {Function} afterBidAdded callback ... | [
"Updates",
"the",
"running",
"queue",
"for",
"the",
"associated",
"auction",
".",
"Does",
"a",
"check",
"to",
"ensure",
"the",
"auction",
"is",
"still",
"running",
";",
"if",
"it",
"s",
"not",
"-",
"the",
"previously",
"running",
"queue",
"is",
"killed",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L146-L157 | train |
prebid/Prebid.js | modules/adpod.js | firePrebidCacheCall | function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) {
// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list
removeBidsFromStorage(bidList);
store(bidList, function (error, cacheIds) {
if (error) {
... | javascript | function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) {
// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list
removeBidsFromStorage(bidList);
store(bidList, function (error, cacheIds) {
if (error) {
... | [
"function",
"firePrebidCacheCall",
"(",
"auctionInstance",
",",
"bidList",
",",
"afterBidAdded",
")",
"{",
"// remove entries now so other incoming bids won't accidentally have a stale version of the list while PBC is processing the current submitted list",
"removeBidsFromStorage",
"(",
"b... | This function will send a list of bids to Prebid Cache. It also removes the same bids from the internal bidCacheRegistry
to maintain which bids are in queue.
If the bids are successfully cached, they will be added to the respective auction.
@param {*} auctionInstance running context of the auction
@param {Array[Object... | [
"This",
"function",
"will",
"send",
"a",
"list",
"of",
"bids",
"to",
"Prebid",
"Cache",
".",
"It",
"also",
"removes",
"the",
"same",
"bids",
"from",
"the",
"internal",
"bidCacheRegistry",
"to",
"maintain",
"which",
"bids",
"are",
"in",
"queue",
".",
"If",
... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adpod.js#L177-L199 | train |
prebid/Prebid.js | modules/getintentBidAdapter.js | 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,... | javascript | 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,... | [
"function",
"(",
"serverResponse",
")",
"{",
"let",
"responseBody",
"=",
"serverResponse",
".",
"body",
";",
"const",
"bids",
"=",
"[",
"]",
";",
"if",
"(",
"responseBody",
"&&",
"responseBody",
".",
"no_bid",
"!==",
"1",
")",
"{",
"let",
"size",
"=",
... | Callback for bids, after the call to DSP completes.
Parse the response from the server into a list of bids.
@param {object} serverResponse A response from the GetIntent's server.
@return {Bid[]} An array of bids which were nested inside the server. | [
"Callback",
"for",
"bids",
"after",
"the",
"call",
"to",
"DSP",
"completes",
".",
"Parse",
"the",
"response",
"from",
"the",
"server",
"into",
"a",
"list",
"of",
"bids",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/getintentBidAdapter.js#L56-L81 | train | |
prebid/Prebid.js | modules/getintentBidAdapter.js | buildGiBidRequest | function buildGiBidRequest(bidRequest) {
let giBidRequest = {
bid_id: bidRequest.bidId,
pid: bidRequest.params.pid, // required
tid: bidRequest.params.tid, // required
known: bidRequest.params.known || 1,
is_video: bidRequest.mediaType === 'video',
resp_type: 'JSON',
provider: 'direct.preb... | javascript | function buildGiBidRequest(bidRequest) {
let giBidRequest = {
bid_id: bidRequest.bidId,
pid: bidRequest.params.pid, // required
tid: bidRequest.params.tid, // required
known: bidRequest.params.known || 1,
is_video: bidRequest.mediaType === 'video',
resp_type: 'JSON',
provider: 'direct.preb... | [
"function",
"buildGiBidRequest",
"(",
"bidRequest",
")",
"{",
"let",
"giBidRequest",
"=",
"{",
"bid_id",
":",
"bidRequest",
".",
"bidId",
",",
"pid",
":",
"bidRequest",
".",
"params",
".",
"pid",
",",
"// required",
"tid",
":",
"bidRequest",
".",
"params",
... | Builds GI bid request from BidRequest.
@param {BidRequest} bidRequest.
@return {object} GI bid request. | [
"Builds",
"GI",
"bid",
"request",
"from",
"BidRequest",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/getintentBidAdapter.js#L95-L111 | train |
prebid/Prebid.js | modules/c1xBidAdapter.js | function(bid) {
const siteId = bid.params.siteId || '';
if (!siteId) {
utils.logError(LOG_MSG.noSite);
}
return !!(bid.adUnitCode && siteId);
} | javascript | function(bid) {
const siteId = bid.params.siteId || '';
if (!siteId) {
utils.logError(LOG_MSG.noSite);
}
return !!(bid.adUnitCode && siteId);
} | [
"function",
"(",
"bid",
")",
"{",
"const",
"siteId",
"=",
"bid",
".",
"params",
".",
"siteId",
"||",
"''",
";",
"if",
"(",
"!",
"siteId",
")",
"{",
"utils",
".",
"logError",
"(",
"LOG_MSG",
".",
"noSite",
")",
";",
"}",
"return",
"!",
"!",
"(",
... | check the bids sent to c1x bidder | [
"check",
"the",
"bids",
"sent",
"to",
"c1x",
"bidder"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/c1xBidAdapter.js#L24-L30 | train | |
prebid/Prebid.js | modules/express.js | defaultSlots | function defaultSlots(slots) {
return Array.isArray(slots)
? slots.slice()
: googletag.pubads().getSlots().slice();
} | javascript | function defaultSlots(slots) {
return Array.isArray(slots)
? slots.slice()
: googletag.pubads().getSlots().slice();
} | [
"function",
"defaultSlots",
"(",
"slots",
")",
"{",
"return",
"Array",
".",
"isArray",
"(",
"slots",
")",
"?",
"slots",
".",
"slice",
"(",
")",
":",
"googletag",
".",
"pubads",
"(",
")",
".",
"getSlots",
"(",
")",
".",
"slice",
"(",
")",
";",
"}"
] | a helper function to verify slots or get slots if not present | [
"a",
"helper",
"function",
"to",
"verify",
"slots",
"or",
"get",
"slots",
"if",
"not",
"present"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/express.js#L61-L65 | train |
prebid/Prebid.js | modules/express.js | pickAdUnits | function pickAdUnits(gptSlots) {
var adUnits = [];
// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots
for (var i = gptSlots.length - 1; i > -1; i--) {
const gptSlot = gptSlots[i];
const elemId = gptSlot.getSlotElementId();
con... | javascript | function pickAdUnits(gptSlots) {
var adUnits = [];
// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots
for (var i = gptSlots.length - 1; i > -1; i--) {
const gptSlot = gptSlots[i];
const elemId = gptSlot.getSlotElementId();
con... | [
"function",
"pickAdUnits",
"(",
"gptSlots",
")",
"{",
"var",
"adUnits",
"=",
"[",
"]",
";",
"// traverse backwards (since gptSlots is mutated) to find adUnits in cache and remove non-mapped slots",
"for",
"(",
"var",
"i",
"=",
"gptSlots",
".",
"length",
"-",
"1",
";",
... | maps gpt slots to adUnits, matches are copied to new array and removed from passed array. | [
"maps",
"gpt",
"slots",
"to",
"adUnits",
"matches",
"are",
"copied",
"to",
"new",
"array",
"and",
"removed",
"from",
"passed",
"array",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/express.js#L68-L85 | train |
prebid/Prebid.js | src/utils.js | tryConvertType | function tryConvertType(typeToConvert, value) {
if (typeToConvert === 'string') {
return value && value.toString();
} else if (typeToConvert === 'number') {
return Number(value);
} else {
return value;
}
} | javascript | function tryConvertType(typeToConvert, value) {
if (typeToConvert === 'string') {
return value && value.toString();
} else if (typeToConvert === 'number') {
return Number(value);
} else {
return value;
}
} | [
"function",
"tryConvertType",
"(",
"typeToConvert",
",",
"value",
")",
"{",
"if",
"(",
"typeToConvert",
"===",
"'string'",
")",
"{",
"return",
"value",
"&&",
"value",
".",
"toString",
"(",
")",
";",
"}",
"else",
"if",
"(",
"typeToConvert",
"===",
"'number'... | Try to convert a value to a type.
If it can't be done, the value will be returned.
@param {string} typeToConvert The target type. e.g. "string", "number", etc.
@param {*} value The value to be converted into typeToConvert. | [
"Try",
"to",
"convert",
"a",
"value",
"to",
"a",
"type",
".",
"If",
"it",
"can",
"t",
"be",
"done",
"the",
"value",
"will",
"be",
"returned",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/utils.js#L1193-L1201 | train |
prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getAdPodAdUnits | function getAdPodAdUnits(codes) {
return auctionManager.getAdUnits()
.filter((adUnit) => deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD)
.filter((adUnit) => (codes.length > 0) ? codes.indexOf(adUnit.code) != -1 : true);
} | javascript | function getAdPodAdUnits(codes) {
return auctionManager.getAdUnits()
.filter((adUnit) => deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD)
.filter((adUnit) => (codes.length > 0) ? codes.indexOf(adUnit.code) != -1 : true);
} | [
"function",
"getAdPodAdUnits",
"(",
"codes",
")",
"{",
"return",
"auctionManager",
".",
"getAdUnits",
"(",
")",
".",
"filter",
"(",
"(",
"adUnit",
")",
"=>",
"deepAccess",
"(",
"adUnit",
",",
"'mediaTypes.video.context'",
")",
"===",
"ADPOD",
")",
".",
"filt... | This function returns the adunit of mediaType adpod
@param {Array} codes adUnitCodes
@returns {Array[Object]} adunits of mediaType adpod | [
"This",
"function",
"returns",
"the",
"adunit",
"of",
"mediaType",
"adpod"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L116-L120 | train |
prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getExclusiveBids | function getExclusiveBids(bidsReceived) {
let bids = bidsReceived
.map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
let filteredBids = [];
Object.keys(bids).forEach((targetingKey) => {
bid... | javascript | function getExclusiveBids(bidsReceived) {
let bids = bidsReceived
.map((bid) => Object.assign({}, bid, {[TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR]}));
bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR);
let filteredBids = [];
Object.keys(bids).forEach((targetingKey) => {
bid... | [
"function",
"getExclusiveBids",
"(",
"bidsReceived",
")",
"{",
"let",
"bids",
"=",
"bidsReceived",
".",
"map",
"(",
"(",
"bid",
")",
"=>",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"bid",
",",
"{",
"[",
"TARGETING_KEY_PB_CAT_DUR",
"]",
":",
"bid",
"... | This function removes bids of same freewheel category. It will be used when competitive exclusion is enabled.
@param {Array[Object]} bidsReceived
@returns {Array[Object]} unique freewheel category bids | [
"This",
"function",
"removes",
"bids",
"of",
"same",
"freewheel",
"category",
".",
"It",
"will",
"be",
"used",
"when",
"competitive",
"exclusion",
"is",
"enabled",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L127-L137 | train |
prebid/Prebid.js | modules/freeWheelAdserverVideo.js | getBidsForAdpod | function getBidsForAdpod(bidsReceived, adPodAdUnits) {
let adUnitCodes = adPodAdUnits.map((adUnit) => adUnit.code);
return bidsReceived
.filter((bid) => adUnitCodes.indexOf(bid.adUnitCode) != -1 && (bid.video && bid.video.context === ADPOD))
} | javascript | function getBidsForAdpod(bidsReceived, adPodAdUnits) {
let adUnitCodes = adPodAdUnits.map((adUnit) => adUnit.code);
return bidsReceived
.filter((bid) => adUnitCodes.indexOf(bid.adUnitCode) != -1 && (bid.video && bid.video.context === ADPOD))
} | [
"function",
"getBidsForAdpod",
"(",
"bidsReceived",
",",
"adPodAdUnits",
")",
"{",
"let",
"adUnitCodes",
"=",
"adPodAdUnits",
".",
"map",
"(",
"(",
"adUnit",
")",
"=>",
"adUnit",
".",
"code",
")",
";",
"return",
"bidsReceived",
".",
"filter",
"(",
"(",
"bi... | This function returns bids for adpod adunits
@param {Array[Object]} bidsReceived
@param {Array[Object]} adPodAdUnits
@returns {Array[Object]} bids of mediaType adpod | [
"This",
"function",
"returns",
"bids",
"for",
"adpod",
"adunits"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/freeWheelAdserverVideo.js#L145-L149 | train |
prebid/Prebid.js | src/bidfactory.js | Bid | function Bid(statusCode, bidRequest) {
var _bidSrc = (bidRequest && bidRequest.src) || 'client';
var _statusCode = statusCode || 0;
this.bidderCode = (bidRequest && bidRequest.bidder) || '';
this.width = 0;
this.height = 0;
this.statusMessage = _getStatus();
this.adId = utils.getUniqueIdentifierStr();
... | javascript | function Bid(statusCode, bidRequest) {
var _bidSrc = (bidRequest && bidRequest.src) || 'client';
var _statusCode = statusCode || 0;
this.bidderCode = (bidRequest && bidRequest.bidder) || '';
this.width = 0;
this.height = 0;
this.statusMessage = _getStatus();
this.adId = utils.getUniqueIdentifierStr();
... | [
"function",
"Bid",
"(",
"statusCode",
",",
"bidRequest",
")",
"{",
"var",
"_bidSrc",
"=",
"(",
"bidRequest",
"&&",
"bidRequest",
".",
"src",
")",
"||",
"'client'",
";",
"var",
"_statusCode",
"=",
"statusCode",
"||",
"0",
";",
"this",
".",
"bidderCode",
"... | Required paramaters
bidderCode,
height,
width,
statusCode
Optional paramaters
adId,
cpm,
ad,
adUrl,
dealId,
priceKeyString; | [
"Required",
"paramaters",
"bidderCode",
"height",
"width",
"statusCode",
"Optional",
"paramaters",
"adId",
"cpm",
"ad",
"adUrl",
"dealId",
"priceKeyString",
";"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/bidfactory.js#L17-L51 | train |
prebid/Prebid.js | modules/adkernelBidAdapter.js | dispatchImps | function dispatchImps(bidRequests, refererInfo) {
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
return bidRequests.map(bidRequest => buildImp(bidRequest, secure))
.reduce((acc, curr, index) => {
let bidRequest = bidRequests[index];
let zoneId = bidRequest.params.zoneId;
... | javascript | function dispatchImps(bidRequests, refererInfo) {
let secure = (refererInfo && refererInfo.referer.indexOf('https:') === 0);
return bidRequests.map(bidRequest => buildImp(bidRequest, secure))
.reduce((acc, curr, index) => {
let bidRequest = bidRequests[index];
let zoneId = bidRequest.params.zoneId;
... | [
"function",
"dispatchImps",
"(",
"bidRequests",
",",
"refererInfo",
")",
"{",
"let",
"secure",
"=",
"(",
"refererInfo",
"&&",
"refererInfo",
".",
"referer",
".",
"indexOf",
"(",
"'https:'",
")",
"===",
"0",
")",
";",
"return",
"bidRequests",
".",
"map",
"(... | Dispatch impressions by ad network host and zone | [
"Dispatch",
"impressions",
"by",
"ad",
"network",
"host",
"and",
"zone"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L96-L108 | train |
prebid/Prebid.js | modules/adkernelBidAdapter.js | createSite | function createSite(refInfo) {
let url = parseUrl(refInfo.referer);
let result = {
'domain': url.hostname,
'page': url.protocol + '://' + url.hostname + url.pathname
};
if (self === top && document.referrer) {
result.ref = document.referrer;
}
let keywords = document.getElementsByTagName('meta')... | javascript | function createSite(refInfo) {
let url = parseUrl(refInfo.referer);
let result = {
'domain': url.hostname,
'page': url.protocol + '://' + url.hostname + url.pathname
};
if (self === top && document.referrer) {
result.ref = document.referrer;
}
let keywords = document.getElementsByTagName('meta')... | [
"function",
"createSite",
"(",
"refInfo",
")",
"{",
"let",
"url",
"=",
"parseUrl",
"(",
"refInfo",
".",
"referer",
")",
";",
"let",
"result",
"=",
"{",
"'domain'",
":",
"url",
".",
"hostname",
",",
"'page'",
":",
"url",
".",
"protocol",
"+",
"'://'",
... | Creates site description object | [
"Creates",
"site",
"description",
"object"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L199-L213 | train |
prebid/Prebid.js | modules/adkernelBidAdapter.js | formatAdMarkup | function formatAdMarkup(bid) {
let adm = bid.adm;
if ('nurl' in bid) {
adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
}
return adm;
} | javascript | function formatAdMarkup(bid) {
let adm = bid.adm;
if ('nurl' in bid) {
adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`);
}
return adm;
} | [
"function",
"formatAdMarkup",
"(",
"bid",
")",
"{",
"let",
"adm",
"=",
"bid",
".",
"adm",
";",
"if",
"(",
"'nurl'",
"in",
"bid",
")",
"{",
"adm",
"+=",
"utils",
".",
"createTrackPixelHtml",
"(",
"`",
"${",
"bid",
".",
"nurl",
"}",
"`",
")",
";",
... | Format creative with optional nurl call
@param bid rtb Bid object | [
"Format",
"creative",
"with",
"optional",
"nurl",
"call"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/adkernelBidAdapter.js#L219-L225 | train |
prebid/Prebid.js | modules/gjirafaBidAdapter.js | generateSizeParam | function generateSizeParam(sizes) {
return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);
} | javascript | function generateSizeParam(sizes) {
return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);
} | [
"function",
"generateSizeParam",
"(",
"sizes",
")",
"{",
"return",
"sizes",
".",
"map",
"(",
"size",
"=>",
"size",
".",
"join",
"(",
"DIMENSION_SEPARATOR",
")",
")",
".",
"join",
"(",
"SIZE_SEPARATOR",
")",
";",
"}"
] | Generate size param for bid request using sizes array
@param {Array} sizes Possible sizes for the ad unit.
@return {string} Processed sizes param to be used for the bid request. | [
"Generate",
"size",
"param",
"for",
"bid",
"request",
"using",
"sizes",
"array"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/gjirafaBidAdapter.js#L91-L93 | train |
prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(slot) {
const hbAdIdTargeting = slot.getTargeting('hb_adid');
if (hbAdIdTargeting.length > 0) {
const hbAdId = hbAdIdTargeting[0];
return typeof this.prebidWinnersCache[hbAdId] !== 'undefined';
}
return false;
} | javascript | function(slot) {
const hbAdIdTargeting = slot.getTargeting('hb_adid');
if (hbAdIdTargeting.length > 0) {
const hbAdId = hbAdIdTargeting[0];
return typeof this.prebidWinnersCache[hbAdId] !== 'undefined';
}
return false;
} | [
"function",
"(",
"slot",
")",
"{",
"const",
"hbAdIdTargeting",
"=",
"slot",
".",
"getTargeting",
"(",
"'hb_adid'",
")",
";",
"if",
"(",
"hbAdIdTargeting",
".",
"length",
">",
"0",
")",
"{",
"const",
"hbAdId",
"=",
"hbAdIdTargeting",
"[",
"0",
"]",
";",
... | Decides if the GPT slot contains prebid ad impression or not.
When BID_WON event is emitted adid is added to prebidWinnersCache,
then we check if prebidWinnersCache contains slot.hb_adid.
This function is optional and used only when googlePublisherTag is provided.
Default implementation uses slot's `hb_adid` targeti... | [
"Decides",
"if",
"the",
"GPT",
"slot",
"contains",
"prebid",
"ad",
"impression",
"or",
"not",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L76-L83 | train | |
prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
// this is bid response event has `bidder` while bid won has bidderCode property
return bid ? bid.bidderCode || bid.bidder : null;
} | javascript | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
// this is bid response event has `bidder` while bid won has bidderCode property
return bid ? bid.bidderCode || bid.bidder : null;
} | [
"function",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
"{",
"const",
"bid",
"=",
"getHighestPrebidBidResponseBySlotTargeting",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
";",
"// this is bid response event has `bidder` while bid won has bidderCod... | If isPrebidAdImpression decides that slot contain prebid ad impression,
this function should return prebids highest ad impression partner for that
slot.
Default implementation uses slot's `hb_adid` targeting value to find
highest bid response and when present then returns `bidder`.
@param instanceConfig merged analyt... | [
"If",
"isPrebidAdImpression",
"decides",
"that",
"slot",
"contain",
"prebid",
"ad",
"impression",
"this",
"function",
"should",
"return",
"prebids",
"highest",
"ad",
"impression",
"partner",
"for",
"that",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L98-L107 | train | |
prebid/Prebid.js | modules/liveyieldAnalyticsAdapter.js | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
return bid ? bid.cpm : null;
} | javascript | function(instanceConfig, slot, version) {
const bid = getHighestPrebidBidResponseBySlotTargeting(
instanceConfig,
slot,
version
);
return bid ? bid.cpm : null;
} | [
"function",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
"{",
"const",
"bid",
"=",
"getHighestPrebidBidResponseBySlotTargeting",
"(",
"instanceConfig",
",",
"slot",
",",
"version",
")",
";",
"return",
"bid",
"?",
"bid",
".",
"cpm",
":",
"null",
"... | If isPrebidAdImpression decides that slot contain prebid ad impression,
this function should return prebids highest ad impression value for that
slot.
Default implementation uses slot's `hb_adid` targeting value to find
highest bid response and when present then returns `cpm`.
@param instanceConfig merged analytics a... | [
"If",
"isPrebidAdImpression",
"decides",
"that",
"slot",
"contain",
"prebid",
"ad",
"impression",
"this",
"function",
"should",
"return",
"prebids",
"highest",
"ad",
"impression",
"value",
"for",
"that",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/liveyieldAnalyticsAdapter.js#L122-L130 | train | |
prebid/Prebid.js | modules/yieldmoBidAdapter.js | function(serverResponse) {
let bids = [];
let data = serverResponse.body;
if (data.length > 0) {
data.forEach((response) => {
if (response.cpm && response.cpm > 0) {
bids.push(createNewBid(response));
}
});
}
return bids;
} | javascript | function(serverResponse) {
let bids = [];
let data = serverResponse.body;
if (data.length > 0) {
data.forEach((response) => {
if (response.cpm && response.cpm > 0) {
bids.push(createNewBid(response));
}
});
}
return bids;
} | [
"function",
"(",
"serverResponse",
")",
"{",
"let",
"bids",
"=",
"[",
"]",
";",
"let",
"data",
"=",
"serverResponse",
".",
"body",
";",
"if",
"(",
"data",
".",
"length",
">",
"0",
")",
"{",
"data",
".",
"forEach",
"(",
"(",
"response",
")",
"=>",
... | Makes Yieldmo Ad Server response compatible to Prebid specs
@param serverResponse successful response from Ad Server
@param bidderRequest original bidRequest
@return {Bid[]} an array of bids | [
"Makes",
"Yieldmo",
"Ad",
"Server",
"response",
"compatible",
"to",
"Prebid",
"specs"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/yieldmoBidAdapter.js#L67-L78 | train | |
prebid/Prebid.js | modules/yieldmoBidAdapter.js | createNewBid | function createNewBid(response) {
return {
requestId: response['callback_id'],
cpm: response.cpm,
width: response.width,
height: response.height,
creativeId: response.creative_id,
currency: CURRENCY,
netRevenue: NET_REVENUE,
ttl: TIME_TO_LIVE,
ad: response.ad
};
} | javascript | function createNewBid(response) {
return {
requestId: response['callback_id'],
cpm: response.cpm,
width: response.width,
height: response.height,
creativeId: response.creative_id,
currency: CURRENCY,
netRevenue: NET_REVENUE,
ttl: TIME_TO_LIVE,
ad: response.ad
};
} | [
"function",
"createNewBid",
"(",
"response",
")",
"{",
"return",
"{",
"requestId",
":",
"response",
"[",
"'callback_id'",
"]",
",",
"cpm",
":",
"response",
".",
"cpm",
",",
"width",
":",
"response",
".",
"width",
",",
"height",
":",
"response",
".",
"hei... | creates a new bid with response information
@param response server response | [
"creates",
"a",
"new",
"bid",
"with",
"response",
"information"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/yieldmoBidAdapter.js#L116-L128 | train |
prebid/Prebid.js | gulpfile.js | viewCoverage | function viewCoverage(done) {
var coveragePort = 1999;
var mylocalhost = (argv.host) ? argv.host : 'localhost';
connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
livereload: false
});
opens('http://' + mylocalhost + ':' + coveragePort);
done();
} | javascript | function viewCoverage(done) {
var coveragePort = 1999;
var mylocalhost = (argv.host) ? argv.host : 'localhost';
connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
livereload: false
});
opens('http://' + mylocalhost + ':' + coveragePort);
done();
} | [
"function",
"viewCoverage",
"(",
"done",
")",
"{",
"var",
"coveragePort",
"=",
"1999",
";",
"var",
"mylocalhost",
"=",
"(",
"argv",
".",
"host",
")",
"?",
"argv",
".",
"host",
":",
"'localhost'",
";",
"connect",
".",
"server",
"(",
"{",
"port",
":",
... | View the code coverage report in the browser. | [
"View",
"the",
"code",
"coverage",
"report",
"in",
"the",
"browser",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/gulpfile.js#L78-L89 | train |
prebid/Prebid.js | gulpfile.js | watch | function watch(done) {
var mainWatcher = gulp.watch([
'src/**/*.js',
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
]);
var loaderWatcher = gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
]);
connect.server({
https: argv.https,
port: port,
... | javascript | function watch(done) {
var mainWatcher = gulp.watch([
'src/**/*.js',
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
]);
var loaderWatcher = gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
]);
connect.server({
https: argv.https,
port: port,
... | [
"function",
"watch",
"(",
"done",
")",
"{",
"var",
"mainWatcher",
"=",
"gulp",
".",
"watch",
"(",
"[",
"'src/**/*.js'",
",",
"'modules/**/*.js'",
",",
"'test/spec/**/*.js'",
",",
"'!test/spec/loaders/**/*.js'",
"]",
")",
";",
"var",
"loaderWatcher",
"=",
"gulp",... | Watch Task with Live Reload | [
"Watch",
"Task",
"with",
"Live",
"Reload"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/gulpfile.js#L94-L116 | train |
prebid/Prebid.js | src/adUnits.js | incrementCounter | function incrementCounter(adunit) {
adUnits[adunit] = adUnits[adunit] || {};
adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;
return adUnits[adunit].counter;
} | javascript | function incrementCounter(adunit) {
adUnits[adunit] = adUnits[adunit] || {};
adUnits[adunit].counter = (deepAccess(adUnits, `${adunit}.counter`) + 1) || 1;
return adUnits[adunit].counter;
} | [
"function",
"incrementCounter",
"(",
"adunit",
")",
"{",
"adUnits",
"[",
"adunit",
"]",
"=",
"adUnits",
"[",
"adunit",
"]",
"||",
"{",
"}",
";",
"adUnits",
"[",
"adunit",
"]",
".",
"counter",
"=",
"(",
"deepAccess",
"(",
"adUnits",
",",
"`",
"${",
"a... | Increments and returns current Adunit counter
@param {string} adunit id
@returns {number} current adunit count | [
"Increments",
"and",
"returns",
"current",
"Adunit",
"counter"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/adUnits.js#L10-L14 | train |
prebid/Prebid.js | modules/brainyBidAdapter.js | _getFlash | function _getFlash() {
try {
var _mac = (navigator.userAgent.indexOf('Mac') != -1);
if (document.all) {
if (_mac) {
if (window['sample']) {
return ((window['sample'].FlashVersion() & 0xffff0000) >> 16);
}
} else {
var _axo = new ActiveXObject('ShockwaveFlash.Shock... | javascript | function _getFlash() {
try {
var _mac = (navigator.userAgent.indexOf('Mac') != -1);
if (document.all) {
if (_mac) {
if (window['sample']) {
return ((window['sample'].FlashVersion() & 0xffff0000) >> 16);
}
} else {
var _axo = new ActiveXObject('ShockwaveFlash.Shock... | [
"function",
"_getFlash",
"(",
")",
"{",
"try",
"{",
"var",
"_mac",
"=",
"(",
"navigator",
".",
"userAgent",
".",
"indexOf",
"(",
"'Mac'",
")",
"!=",
"-",
"1",
")",
";",
"if",
"(",
"document",
".",
"all",
")",
"{",
"if",
"(",
"_mac",
")",
"{",
"... | Check if the browser supports flash
0 is return if it dosen't support flash
@return {int} Flash version
接続元のブラウザがフラッシュに対応しているか判定
対応していなければ0を返す
@return {int} フラッシュのバージョン | [
"Check",
"if",
"the",
"browser",
"supports",
"flash",
"0",
"is",
"return",
"if",
"it",
"dosen",
"t",
"support",
"flash"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L18-L41 | train |
prebid/Prebid.js | modules/brainyBidAdapter.js | function(bid) {
return !!(bid && bid.params && bid.params.accountID && bid.params.slotID);
} | javascript | function(bid) {
return !!(bid && bid.params && bid.params.accountID && bid.params.slotID);
} | [
"function",
"(",
"bid",
")",
"{",
"return",
"!",
"!",
"(",
"bid",
"&&",
"bid",
".",
"params",
"&&",
"bid",
".",
"params",
".",
"accountID",
"&&",
"bid",
".",
"params",
".",
"slotID",
")",
";",
"}"
] | Check if the bid account ID and slotID is valid
@param {object} bid the brainy bid to validate
@return {boolean}
adUnits.bidに値が入っているかを判断する
@param {object} bid 検証する入札リクエスト
@return {boolean} | [
"Check",
"if",
"the",
"bid",
"account",
"ID",
"and",
"slotID",
"is",
"valid"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L57-L59 | train | |
prebid/Prebid.js | modules/brainyBidAdapter.js | function(validBidRequests) {
var bidRequests = [];
for (var i = 0, len = validBidRequests.length; i < len; i++) {
var bid = validBidRequests[i];
var accountID = utils.getBidIdParameter('accountID', bid.params);
var slotID = utils.getBidIdParameter('slotID', bid.params);
var url = utils.g... | javascript | function(validBidRequests) {
var bidRequests = [];
for (var i = 0, len = validBidRequests.length; i < len; i++) {
var bid = validBidRequests[i];
var accountID = utils.getBidIdParameter('accountID', bid.params);
var slotID = utils.getBidIdParameter('slotID', bid.params);
var url = utils.g... | [
"function",
"(",
"validBidRequests",
")",
"{",
"var",
"bidRequests",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"validBidRequests",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"var",
"bid",
"=",
"val... | Format the bid request object for our endpoint
@param {BidRequest[]} bidRequests Array of brainy bidders
@return object of parameters for Prebid AJAX request
入札リクエストをbrainyに対応するように整形する
@param {BidRequest[]} bidRequests 入札のための配列
@return Prebid AJAX用に整形したオブジェクト | [
"Format",
"the",
"bid",
"request",
"object",
"for",
"our",
"endpoint"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L71-L96 | train | |
prebid/Prebid.js | modules/brainyBidAdapter.js | function (brainyResponseObj, request) {
var bidResponses = [];
var bidRequest = request.bidRequest;
var responseBody = brainyResponseObj ? brainyResponseObj.body : {};
bidResponses.push({
requestId: bidRequest.bidId,
cpm: responseBody.cpm || 0,
width: responseBody.width,
height:... | javascript | function (brainyResponseObj, request) {
var bidResponses = [];
var bidRequest = request.bidRequest;
var responseBody = brainyResponseObj ? brainyResponseObj.body : {};
bidResponses.push({
requestId: bidRequest.bidId,
cpm: responseBody.cpm || 0,
width: responseBody.width,
height:... | [
"function",
"(",
"brainyResponseObj",
",",
"request",
")",
"{",
"var",
"bidResponses",
"=",
"[",
"]",
";",
"var",
"bidRequest",
"=",
"request",
".",
"bidRequest",
";",
"var",
"responseBody",
"=",
"brainyResponseObj",
"?",
"brainyResponseObj",
".",
"body",
":",... | Format brainy responses as Prebid bid responses
@param {String} brainyResponseObj A successful response from brainy.
@param {object} request Object received from web page
@return {object} An array of formatted bids.
brainySSPからのレスポンスを解釈するメソッド
@param {String} brainyResponseObj SSPから受け取った... | [
"Format",
"brainy",
"responses",
"as",
"Prebid",
"bid",
"responses"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/brainyBidAdapter.js#L110-L129 | train | |
prebid/Prebid.js | modules/onetagBidAdapter.js | getPageInfo | function getPageInfo() {
var w, d, l, r, m, p, e, t, s;
for (w = window, d = w.document, l = d.location.href, r = d.referrer, m = 0, e = encodeURIComponent, t = new Date(), s = screen; w !== w.parent;) {
try {
p = w.parent; l = p.location.href; r = p.document.referrer; w = p;
} catch (e) {
m = t... | javascript | function getPageInfo() {
var w, d, l, r, m, p, e, t, s;
for (w = window, d = w.document, l = d.location.href, r = d.referrer, m = 0, e = encodeURIComponent, t = new Date(), s = screen; w !== w.parent;) {
try {
p = w.parent; l = p.location.href; r = p.document.referrer; w = p;
} catch (e) {
m = t... | [
"function",
"getPageInfo",
"(",
")",
"{",
"var",
"w",
",",
"d",
",",
"l",
",",
"r",
",",
"m",
",",
"p",
",",
"e",
",",
"t",
",",
"s",
";",
"for",
"(",
"w",
"=",
"window",
",",
"d",
"=",
"w",
".",
"document",
",",
"l",
"=",
"d",
".",
"lo... | Returns information about the page needed by the server in an object to be converted in JSON
@returns {{location: *, referrer: (*|string), masked: *, wWidth: (*|Number), wHeight: (*|Number), sWidth, sHeight, date: string, timeOffset: number}} | [
"Returns",
"information",
"about",
"the",
"page",
"needed",
"by",
"the",
"server",
"in",
"an",
"object",
"to",
"be",
"converted",
"in",
"JSON"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/onetagBidAdapter.js#L105-L130 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | bidResponseAvailable | function bidResponseAvailable(bidRequest, bidResponse) {
const idToImpMap = {};
const idToBidMap = {};
bidResponse = bidResponse.body
// extract the request bids and the response bids, keyed by impr-id
const ortbRequest = parse(bidRequest.data);
ortbRequest.imp.forEach(imp => {
idToImpMap[imp.id] = imp;... | javascript | function bidResponseAvailable(bidRequest, bidResponse) {
const idToImpMap = {};
const idToBidMap = {};
bidResponse = bidResponse.body
// extract the request bids and the response bids, keyed by impr-id
const ortbRequest = parse(bidRequest.data);
ortbRequest.imp.forEach(imp => {
idToImpMap[imp.id] = imp;... | [
"function",
"bidResponseAvailable",
"(",
"bidRequest",
",",
"bidResponse",
")",
"{",
"const",
"idToImpMap",
"=",
"{",
"}",
";",
"const",
"idToBidMap",
"=",
"{",
"}",
";",
"bidResponse",
"=",
"bidResponse",
".",
"body",
"// extract the request bids and the response b... | Callback for bids, after the call to PulsePoint completes. | [
"Callback",
"for",
"bids",
"after",
"the",
"call",
"to",
"PulsePoint",
"completes",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L82-L122 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | impression | function impression(slot) {
return {
id: slot.bidId,
banner: banner(slot),
'native': nativeImpression(slot),
tagid: slot.params.ct.toString(),
};
} | javascript | function impression(slot) {
return {
id: slot.bidId,
banner: banner(slot),
'native': nativeImpression(slot),
tagid: slot.params.ct.toString(),
};
} | [
"function",
"impression",
"(",
"slot",
")",
"{",
"return",
"{",
"id",
":",
"slot",
".",
"bidId",
",",
"banner",
":",
"banner",
"(",
"slot",
")",
",",
"'native'",
":",
"nativeImpression",
"(",
"slot",
")",
",",
"tagid",
":",
"slot",
".",
"params",
"."... | Produces an OpenRTBImpression from a slot config. | [
"Produces",
"an",
"OpenRTBImpression",
"from",
"a",
"slot",
"config",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L135-L142 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | banner | function banner(slot) {
const size = adSize(slot);
return slot.nativeParams ? null : {
w: size[0],
h: size[1],
};
} | javascript | function banner(slot) {
const size = adSize(slot);
return slot.nativeParams ? null : {
w: size[0],
h: size[1],
};
} | [
"function",
"banner",
"(",
"slot",
")",
"{",
"const",
"size",
"=",
"adSize",
"(",
"slot",
")",
";",
"return",
"slot",
".",
"nativeParams",
"?",
"null",
":",
"{",
"w",
":",
"size",
"[",
"0",
"]",
",",
"h",
":",
"size",
"[",
"1",
"]",
",",
"}",
... | Produces an OpenRTB Banner object for the slot given. | [
"Produces",
"an",
"OpenRTB",
"Banner",
"object",
"for",
"the",
"slot",
"given",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L147-L153 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | site | function site(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (!appParams) {
return {
publisher: {
id: pubId.toString(),
},
ref: referrer(),
page: utils.getTopWindowLo... | javascript | function site(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (!appParams) {
return {
publisher: {
id: pubId.toString(),
},
ref: referrer(),
page: utils.getTopWindowLo... | [
"function",
"site",
"(",
"bidderRequest",
")",
"{",
"const",
"pubId",
"=",
"bidderRequest",
"&&",
"bidderRequest",
".",
"length",
">",
"0",
"?",
"bidderRequest",
"[",
"0",
"]",
".",
"params",
".",
"cp",
":",
"'0'",
";",
"const",
"appParams",
"=",
"bidder... | Produces an OpenRTB site object. | [
"Produces",
"an",
"OpenRTB",
"site",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L231-L244 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | app | function app(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (appParams) {
return {
publisher: {
id: pubId.toString(),
},
bundle: appParams.bundle,
storeurl: appParams... | javascript | function app(bidderRequest) {
const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
const appParams = bidderRequest[0].params.app;
if (appParams) {
return {
publisher: {
id: pubId.toString(),
},
bundle: appParams.bundle,
storeurl: appParams... | [
"function",
"app",
"(",
"bidderRequest",
")",
"{",
"const",
"pubId",
"=",
"bidderRequest",
"&&",
"bidderRequest",
".",
"length",
">",
"0",
"?",
"bidderRequest",
"[",
"0",
"]",
".",
"params",
".",
"cp",
":",
"'0'",
";",
"const",
"appParams",
"=",
"bidderR... | Produces an OpenRTB App object. | [
"Produces",
"an",
"OpenRTB",
"App",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L249-L263 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | device | function device() {
return {
ua: navigator.userAgent,
language: (navigator.language || navigator.browserLanguage || navigator.userLanguage || navigator.systemLanguage),
};
} | javascript | function device() {
return {
ua: navigator.userAgent,
language: (navigator.language || navigator.browserLanguage || navigator.userLanguage || navigator.systemLanguage),
};
} | [
"function",
"device",
"(",
")",
"{",
"return",
"{",
"ua",
":",
"navigator",
".",
"userAgent",
",",
"language",
":",
"(",
"navigator",
".",
"language",
"||",
"navigator",
".",
"browserLanguage",
"||",
"navigator",
".",
"userLanguage",
"||",
"navigator",
".",
... | Produces an OpenRTB Device object. | [
"Produces",
"an",
"OpenRTB",
"Device",
"object",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L279-L284 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | parse | function parse(rawResponse) {
try {
if (rawResponse) {
return JSON.parse(rawResponse);
}
} catch (ex) {
utils.logError('pulsepointLite.safeParse', 'ERROR', ex);
}
return null;
} | javascript | function parse(rawResponse) {
try {
if (rawResponse) {
return JSON.parse(rawResponse);
}
} catch (ex) {
utils.logError('pulsepointLite.safeParse', 'ERROR', ex);
}
return null;
} | [
"function",
"parse",
"(",
"rawResponse",
")",
"{",
"try",
"{",
"if",
"(",
"rawResponse",
")",
"{",
"return",
"JSON",
".",
"parse",
"(",
"rawResponse",
")",
";",
"}",
"}",
"catch",
"(",
"ex",
")",
"{",
"utils",
".",
"logError",
"(",
"'pulsepointLite.saf... | Safely parses the input given. Returns null on
parsing failure. | [
"Safely",
"parses",
"the",
"input",
"given",
".",
"Returns",
"null",
"on",
"parsing",
"failure",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L290-L299 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | adSize | function adSize(slot) {
if (slot.params.cf) {
const size = slot.params.cf.toUpperCase().split('X');
const width = parseInt(slot.params.cw || size[0], 10);
const height = parseInt(slot.params.ch || size[1], 10);
return [width, height];
}
return [1, 1];
} | javascript | function adSize(slot) {
if (slot.params.cf) {
const size = slot.params.cf.toUpperCase().split('X');
const width = parseInt(slot.params.cw || size[0], 10);
const height = parseInt(slot.params.ch || size[1], 10);
return [width, height];
}
return [1, 1];
} | [
"function",
"adSize",
"(",
"slot",
")",
"{",
"if",
"(",
"slot",
".",
"params",
".",
"cf",
")",
"{",
"const",
"size",
"=",
"slot",
".",
"params",
".",
"cf",
".",
"toUpperCase",
"(",
")",
".",
"split",
"(",
"'X'",
")",
";",
"const",
"width",
"=",
... | Determines the AdSize for the slot. | [
"Determines",
"the",
"AdSize",
"for",
"the",
"slot",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L304-L312 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | applyGdpr | function applyGdpr(bidderRequest, ortbRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
ortbRequest.regs = { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } };
ortbRequest.user = { ext: { consent: bidderRequest.gdprConsent.consentString } };
}
} | javascript | function applyGdpr(bidderRequest, ortbRequest) {
if (bidderRequest && bidderRequest.gdprConsent) {
ortbRequest.regs = { ext: { gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0 } };
ortbRequest.user = { ext: { consent: bidderRequest.gdprConsent.consentString } };
}
} | [
"function",
"applyGdpr",
"(",
"bidderRequest",
",",
"ortbRequest",
")",
"{",
"if",
"(",
"bidderRequest",
"&&",
"bidderRequest",
".",
"gdprConsent",
")",
"{",
"ortbRequest",
".",
"regs",
"=",
"{",
"ext",
":",
"{",
"gdpr",
":",
"bidderRequest",
".",
"gdprConse... | Applies GDPR parameters to request. | [
"Applies",
"GDPR",
"parameters",
"to",
"request",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L317-L322 | train |
prebid/Prebid.js | modules/pulsepointBidAdapter.js | nativeResponse | function nativeResponse(imp, bid) {
if (imp['native']) {
const nativeAd = parse(bid.adm);
const keys = {};
if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
nativeAd['native'].assets.forEach(asset => {
keys.title = asset.title ? asset.title.text : keys.title;
keys.bo... | javascript | function nativeResponse(imp, bid) {
if (imp['native']) {
const nativeAd = parse(bid.adm);
const keys = {};
if (nativeAd && nativeAd['native'] && nativeAd['native'].assets) {
nativeAd['native'].assets.forEach(asset => {
keys.title = asset.title ? asset.title.text : keys.title;
keys.bo... | [
"function",
"nativeResponse",
"(",
"imp",
",",
"bid",
")",
"{",
"if",
"(",
"imp",
"[",
"'native'",
"]",
")",
"{",
"const",
"nativeAd",
"=",
"parse",
"(",
"bid",
".",
"adm",
")",
";",
"const",
"keys",
"=",
"{",
"}",
";",
"if",
"(",
"nativeAd",
"&&... | Parses the native response from the Bid given. | [
"Parses",
"the",
"native",
"response",
"from",
"the",
"Bid",
"given",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/pulsepointBidAdapter.js#L327-L347 | train |
prebid/Prebid.js | modules/33acrossBidAdapter.js | _createBidResponse | function _createBidResponse(response) {
return {
requestId: response.id,
bidderCode: BIDDER_CODE,
cpm: response.seatbid[0].bid[0].price,
width: response.seatbid[0].bid[0].w,
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,... | javascript | function _createBidResponse(response) {
return {
requestId: response.id,
bidderCode: BIDDER_CODE,
cpm: response.seatbid[0].bid[0].price,
width: response.seatbid[0].bid[0].w,
height: response.seatbid[0].bid[0].h,
ad: response.seatbid[0].bid[0].adm,
ttl: response.seatbid[0].bid[0].ttl || 60,... | [
"function",
"_createBidResponse",
"(",
"response",
")",
"{",
"return",
"{",
"requestId",
":",
"response",
".",
"id",
",",
"bidderCode",
":",
"BIDDER_CODE",
",",
"cpm",
":",
"response",
".",
"seatbid",
"[",
"0",
"]",
".",
"bid",
"[",
"0",
"]",
".",
"pri... | All this assumes that only one bid is ever returned by ttx | [
"All",
"this",
"assumes",
"that",
"only",
"one",
"bid",
"is",
"ever",
"returned",
"by",
"ttx"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L15-L28 | train |
prebid/Prebid.js | modules/33acrossBidAdapter.js | _createSync | function _createSync(siteId) {
const ttxSettings = config.getConfig('ttxSettings');
const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;
return {
type: 'iframe',
url: `${syncUrl}&id=${siteId}`
}
} | javascript | function _createSync(siteId) {
const ttxSettings = config.getConfig('ttxSettings');
const syncUrl = (ttxSettings && ttxSettings.syncUrl) || SYNC_ENDPOINT;
return {
type: 'iframe',
url: `${syncUrl}&id=${siteId}`
}
} | [
"function",
"_createSync",
"(",
"siteId",
")",
"{",
"const",
"ttxSettings",
"=",
"config",
".",
"getConfig",
"(",
"'ttxSettings'",
")",
";",
"const",
"syncUrl",
"=",
"(",
"ttxSettings",
"&&",
"ttxSettings",
".",
"syncUrl",
")",
"||",
"SYNC_ENDPOINT",
";",
"r... | Sync object will always be of type iframe for TTX | [
"Sync",
"object",
"will",
"always",
"be",
"of",
"type",
"iframe",
"for",
"TTX"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L125-L133 | train |
prebid/Prebid.js | modules/33acrossBidAdapter.js | ViewabilityContributor | function ViewabilityContributor(viewabilityAmount) {
function contributeViewability(ttxRequest) {
const req = Object.assign({}, ttxRequest);
const imp = req.imp = req.imp.map(impItem => Object.assign({}, impItem));
const banner = imp[0].banner = Object.assign({}, imp[0].banner);
const ext = banner.ext... | javascript | function ViewabilityContributor(viewabilityAmount) {
function contributeViewability(ttxRequest) {
const req = Object.assign({}, ttxRequest);
const imp = req.imp = req.imp.map(impItem => Object.assign({}, impItem));
const banner = imp[0].banner = Object.assign({}, imp[0].banner);
const ext = banner.ext... | [
"function",
"ViewabilityContributor",
"(",
"viewabilityAmount",
")",
"{",
"function",
"contributeViewability",
"(",
"ttxRequest",
")",
"{",
"const",
"req",
"=",
"Object",
".",
"assign",
"(",
"{",
"}",
",",
"ttxRequest",
")",
";",
"const",
"imp",
"=",
"req",
... | Viewability contribution to request.. | [
"Viewability",
"contribution",
"to",
"request",
".."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/33acrossBidAdapter.js#L226-L240 | train |
prebid/Prebid.js | src/auction.js | tryAddVideoBid | 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... | javascript | 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... | [
"function",
"tryAddVideoBid",
"(",
"auctionInstance",
",",
"bidResponse",
",",
"bidRequests",
",",
"afterBidAdded",
")",
"{",
"let",
"addBid",
"=",
"true",
";",
"const",
"bidderRequest",
"=",
"getBidRequest",
"(",
"bidResponse",
".",
"requestId",
",",
"[",
"bidR... | Video bids may fail if the cache is down, or there's trouble on the network. | [
"Video",
"bids",
"may",
"fail",
"if",
"the",
"cache",
"is",
"down",
"or",
"there",
"s",
"trouble",
"on",
"the",
"network",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L405-L426 | train |
prebid/Prebid.js | src/auction.js | createKeyVal | function createKeyVal(key, value) {
return {
key,
val: (typeof value === 'function')
? function (bidResponse) {
return value(bidResponse);
}
: function (bidResponse) {
return getValue(bidResponse, value);
}
};
} | javascript | function createKeyVal(key, value) {
return {
key,
val: (typeof value === 'function')
? function (bidResponse) {
return value(bidResponse);
}
: function (bidResponse) {
return getValue(bidResponse, value);
}
};
} | [
"function",
"createKeyVal",
"(",
"key",
",",
"value",
")",
"{",
"return",
"{",
"key",
",",
"val",
":",
"(",
"typeof",
"value",
"===",
"'function'",
")",
"?",
"function",
"(",
"bidResponse",
")",
"{",
"return",
"value",
"(",
"bidResponse",
")",
";",
"}"... | factory for key value objs | [
"factory",
"for",
"key",
"value",
"objs"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L519-L530 | train |
prebid/Prebid.js | src/auction.js | groupByPlacement | function groupByPlacement(bidsByPlacement, bid) {
if (!bidsByPlacement[bid.adUnitCode]) { bidsByPlacement[bid.adUnitCode] = { bids: [] }; }
bidsByPlacement[bid.adUnitCode].bids.push(bid);
return bidsByPlacement;
} | javascript | function groupByPlacement(bidsByPlacement, bid) {
if (!bidsByPlacement[bid.adUnitCode]) { bidsByPlacement[bid.adUnitCode] = { bids: [] }; }
bidsByPlacement[bid.adUnitCode].bids.push(bid);
return bidsByPlacement;
} | [
"function",
"groupByPlacement",
"(",
"bidsByPlacement",
",",
"bid",
")",
"{",
"if",
"(",
"!",
"bidsByPlacement",
"[",
"bid",
".",
"adUnitCode",
"]",
")",
"{",
"bidsByPlacement",
"[",
"bid",
".",
"adUnitCode",
"]",
"=",
"{",
"bids",
":",
"[",
"]",
"}",
... | groupByPlacement is a reduce function that converts an array of Bid objects
to an object with placement codes as keys, with each key representing an object
with an array of `Bid` objects for that placement
@returns {*} as { [adUnitCode]: { bids: [Bid, Bid, Bid] } } | [
"groupByPlacement",
"is",
"a",
"reduce",
"function",
"that",
"converts",
"an",
"array",
"of",
"Bid",
"objects",
"to",
"an",
"object",
"with",
"placement",
"codes",
"as",
"keys",
"with",
"each",
"key",
"representing",
"an",
"object",
"with",
"an",
"array",
"o... | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/auction.js#L688-L692 | train |
prebid/Prebid.js | modules/ixBidAdapter.js | bidToBannerImp | function bidToBannerImp(bid) {
const imp = {};
imp.id = bid.bidId;
imp.banner = {};
imp.banner.w = bid.params.size[0];
imp.banner.h = bid.params.size[1];
imp.banner.topframe = utils.inIframe() ? 0 : 1;
imp.ext = {};
imp.ext.siteID = bid.params.siteId;
if (bid.params.hasOwnProperty('id') &&
(ty... | javascript | function bidToBannerImp(bid) {
const imp = {};
imp.id = bid.bidId;
imp.banner = {};
imp.banner.w = bid.params.size[0];
imp.banner.h = bid.params.size[1];
imp.banner.topframe = utils.inIframe() ? 0 : 1;
imp.ext = {};
imp.ext.siteID = bid.params.siteId;
if (bid.params.hasOwnProperty('id') &&
(ty... | [
"function",
"bidToBannerImp",
"(",
"bid",
")",
"{",
"const",
"imp",
"=",
"{",
"}",
";",
"imp",
".",
"id",
"=",
"bid",
".",
"bidId",
";",
"imp",
".",
"banner",
"=",
"{",
"}",
";",
"imp",
".",
"banner",
".",
"w",
"=",
"bid",
".",
"params",
".",
... | Transform valid bid request config object to impression object that will be sent to ad server.
@param {object} bid A valid bid request config object.
@return {object} A impression object that will be sent to ad server. | [
"Transform",
"valid",
"bid",
"request",
"config",
"object",
"to",
"impression",
"object",
"that",
"will",
"be",
"sent",
"to",
"ad",
"server",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ixBidAdapter.js#L26-L52 | train |
prebid/Prebid.js | modules/ixBidAdapter.js | parseBid | function parseBid(rawBid, currency) {
const bid = {};
if (PRICE_TO_DOLLAR_FACTOR.hasOwnProperty(currency)) {
bid.cpm = rawBid.price / PRICE_TO_DOLLAR_FACTOR[currency];
} else {
bid.cpm = rawBid.price / CENT_TO_DOLLAR_FACTOR;
}
bid.requestId = rawBid.impid;
bid.width = rawBid.w;
bid.height = rawB... | javascript | function parseBid(rawBid, currency) {
const bid = {};
if (PRICE_TO_DOLLAR_FACTOR.hasOwnProperty(currency)) {
bid.cpm = rawBid.price / PRICE_TO_DOLLAR_FACTOR[currency];
} else {
bid.cpm = rawBid.price / CENT_TO_DOLLAR_FACTOR;
}
bid.requestId = rawBid.impid;
bid.width = rawBid.w;
bid.height = rawB... | [
"function",
"parseBid",
"(",
"rawBid",
",",
"currency",
")",
"{",
"const",
"bid",
"=",
"{",
"}",
";",
"if",
"(",
"PRICE_TO_DOLLAR_FACTOR",
".",
"hasOwnProperty",
"(",
"currency",
")",
")",
"{",
"bid",
".",
"cpm",
"=",
"rawBid",
".",
"price",
"/",
"PRIC... | Parses a raw bid for the relevant information.
@param {object} rawBid The bid to be parsed.
@param {string} currency Global currency in bid response.
@return {object} bid The parsed bid. | [
"Parses",
"a",
"raw",
"bid",
"for",
"the",
"relevant",
"information",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ixBidAdapter.js#L61-L86 | train |
prebid/Prebid.js | modules/ixBidAdapter.js | isValidSize | function isValidSize(size) {
return isArray(size) && size.length === 2 && isInteger(size[0]) && isInteger(size[1]);
} | javascript | function isValidSize(size) {
return isArray(size) && size.length === 2 && isInteger(size[0]) && isInteger(size[1]);
} | [
"function",
"isValidSize",
"(",
"size",
")",
"{",
"return",
"isArray",
"(",
"size",
")",
"&&",
"size",
".",
"length",
"===",
"2",
"&&",
"isInteger",
"(",
"size",
"[",
"0",
"]",
")",
"&&",
"isInteger",
"(",
"size",
"[",
"1",
"]",
")",
";",
"}"
] | Determines whether or not the given object is valid size format.
@param {*} size The object to be validated.
@return {boolean} True if this is a valid size format, and false otherwise. | [
"Determines",
"whether",
"or",
"not",
"the",
"given",
"object",
"is",
"valid",
"size",
"format",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ixBidAdapter.js#L94-L96 | train |
prebid/Prebid.js | modules/ixBidAdapter.js | includesSize | function includesSize(sizeArray, size) {
if (isValidSize(sizeArray)) {
return sizeArray[0] === size[0] && sizeArray[1] === size[1];
}
for (let i = 0; i < sizeArray.length; i++) {
if (sizeArray[i][0] === size[0] && sizeArray[i][1] === size[1]) {
return true;
}
}
return false;
} | javascript | function includesSize(sizeArray, size) {
if (isValidSize(sizeArray)) {
return sizeArray[0] === size[0] && sizeArray[1] === size[1];
}
for (let i = 0; i < sizeArray.length; i++) {
if (sizeArray[i][0] === size[0] && sizeArray[i][1] === size[1]) {
return true;
}
}
return false;
} | [
"function",
"includesSize",
"(",
"sizeArray",
",",
"size",
")",
"{",
"if",
"(",
"isValidSize",
"(",
"sizeArray",
")",
")",
"{",
"return",
"sizeArray",
"[",
"0",
"]",
"===",
"size",
"[",
"0",
"]",
"&&",
"sizeArray",
"[",
"1",
"]",
"===",
"size",
"[",
... | Determines whether or not the given size object is an element of the size
array.
@param {array} sizeArray The size array.
@param {object} size The size object.
@return {boolean} True if the size object is an element of the size array, and false
otherwise. | [
"Determines",
"whether",
"or",
"not",
"the",
"given",
"size",
"object",
"is",
"an",
"element",
"of",
"the",
"size",
"array",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ixBidAdapter.js#L107-L119 | train |
prebid/Prebid.js | modules/ixBidAdapter.js | isValidBidFloorParams | function isValidBidFloorParams(bidFloor, bidFloorCur) {
const curRegex = /^[A-Z]{3}$/;
return Boolean(typeof bidFloor === 'number' && typeof bidFloorCur === 'string' &&
bidFloorCur.match(curRegex));
} | javascript | function isValidBidFloorParams(bidFloor, bidFloorCur) {
const curRegex = /^[A-Z]{3}$/;
return Boolean(typeof bidFloor === 'number' && typeof bidFloorCur === 'string' &&
bidFloorCur.match(curRegex));
} | [
"function",
"isValidBidFloorParams",
"(",
"bidFloor",
",",
"bidFloorCur",
")",
"{",
"const",
"curRegex",
"=",
"/",
"^[A-Z]{3}$",
"/",
";",
"return",
"Boolean",
"(",
"typeof",
"bidFloor",
"===",
"'number'",
"&&",
"typeof",
"bidFloorCur",
"===",
"'string'",
"&&",
... | Determines whether or not the given bidFloor parameters are valid.
@param {*} bidFloor The bidFloor parameter inside bid request config.
@param {*} bidFloorCur The bidFloorCur parameter inside bid request config.
@return {boolean} True if this is a valid biFfloor parameters format, and fal... | [
"Determines",
"whether",
"or",
"not",
"the",
"given",
"bidFloor",
"parameters",
"are",
"valid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ixBidAdapter.js#L129-L134 | train |
prebid/Prebid.js | modules/rubiconBidAdapter.js | bidType | function bidType(bid, log = false) {
// Is it considered video ad unit by rubicon
if (hasVideoMediaType(bid)) {
// Removed legacy mediaType support. new way using mediaTypes.video object is now required
// We require either context as instream or outstream
if (['outstream', 'instream'].indexOf(utils.dee... | javascript | function bidType(bid, log = false) {
// Is it considered video ad unit by rubicon
if (hasVideoMediaType(bid)) {
// Removed legacy mediaType support. new way using mediaTypes.video object is now required
// We require either context as instream or outstream
if (['outstream', 'instream'].indexOf(utils.dee... | [
"function",
"bidType",
"(",
"bid",
",",
"log",
"=",
"false",
")",
"{",
"// Is it considered video ad unit by rubicon",
"if",
"(",
"hasVideoMediaType",
"(",
"bid",
")",
")",
"{",
"// Removed legacy mediaType support. new way using mediaTypes.video object is now required",
"// ... | Determine bidRequest mediaType
@param bid the bid to test
@param log whether we should log errors/warnings for invalid bids
@returns {string|undefined} Returns 'video' or 'banner' if resolves to a type, or undefined otherwise (invalid). | [
"Determine",
"bidRequest",
"mediaType"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/rubiconBidAdapter.js#L775-L815 | train |
prebid/Prebid.js | modules/rubiconBidAdapter.js | partitionArray | function partitionArray(array, size) {
return array.map((e, i) => (i % size === 0) ? array.slice(i, i + size) : null).filter((e) => e)
} | javascript | function partitionArray(array, size) {
return array.map((e, i) => (i % size === 0) ? array.slice(i, i + size) : null).filter((e) => e)
} | [
"function",
"partitionArray",
"(",
"array",
",",
"size",
")",
"{",
"return",
"array",
".",
"map",
"(",
"(",
"e",
",",
"i",
")",
"=>",
"(",
"i",
"%",
"size",
"===",
"0",
")",
"?",
"array",
".",
"slice",
"(",
"i",
",",
"i",
"+",
"size",
")",
":... | split array into multiple arrays of defined size
@param {Array} array
@param {number} size
@returns {Array} | [
"split",
"array",
"into",
"multiple",
"arrays",
"of",
"defined",
"size"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/rubiconBidAdapter.js#L906-L908 | train |
prebid/Prebid.js | modules/googleAnalyticsAdapter.js | checkAnalytics | function checkAnalytics() {
if (_enableCheck && typeof window[_gaGlobal] === 'function') {
for (var i = 0; i < _analyticsQueue.length; i++) {
_analyticsQueue[i].call();
}
// override push to execute the command immediately from now on
_analyticsQueue.push = function (fn) {
fn.call();
... | javascript | function checkAnalytics() {
if (_enableCheck && typeof window[_gaGlobal] === 'function') {
for (var i = 0; i < _analyticsQueue.length; i++) {
_analyticsQueue[i].call();
}
// override push to execute the command immediately from now on
_analyticsQueue.push = function (fn) {
fn.call();
... | [
"function",
"checkAnalytics",
"(",
")",
"{",
"if",
"(",
"_enableCheck",
"&&",
"typeof",
"window",
"[",
"_gaGlobal",
"]",
"===",
"'function'",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"_analyticsQueue",
".",
"length",
";",
"i",
"++",
... | Check if gaGlobal or window.ga is defined on page. If defined execute all the GA commands | [
"Check",
"if",
"gaGlobal",
"or",
"window",
".",
"ga",
"is",
"defined",
"on",
"page",
".",
"If",
"defined",
"execute",
"all",
"the",
"GA",
"commands"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/googleAnalyticsAdapter.js#L113-L129 | train |
prebid/Prebid.js | src/native.js | typeIsSupported | function typeIsSupported(type) {
if (!(type && includes(Object.keys(SUPPORTED_TYPES), type))) {
logError(`${type} nativeParam is not supported`);
return false;
}
return true;
} | javascript | function typeIsSupported(type) {
if (!(type && includes(Object.keys(SUPPORTED_TYPES), type))) {
logError(`${type} nativeParam is not supported`);
return false;
}
return true;
} | [
"function",
"typeIsSupported",
"(",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"type",
"&&",
"includes",
"(",
"Object",
".",
"keys",
"(",
"SUPPORTED_TYPES",
")",
",",
"type",
")",
")",
")",
"{",
"logError",
"(",
"`",
"${",
"type",
"}",
"`",
")",
";",
... | Check if the native type specified in the adUnit is supported by Prebid. | [
"Check",
"if",
"the",
"native",
"type",
"specified",
"in",
"the",
"adUnit",
"is",
"supported",
"by",
"Prebid",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/native.js#L41-L48 | train |
prebid/Prebid.js | src/videoCache.js | toStorageRequest | function toStorageRequest(bid) {
const vastValue = bid.vastXml ? bid.vastXml : wrapURI(bid.vastUrl, bid.vastImpUrl);
let payload = {
type: 'xml',
value: vastValue,
ttlseconds: Number(bid.ttl)
};
if (typeof bid.customCacheKey === 'string' && bid.customCacheKey !== '') {
payload.key = bid.customC... | javascript | function toStorageRequest(bid) {
const vastValue = bid.vastXml ? bid.vastXml : wrapURI(bid.vastUrl, bid.vastImpUrl);
let payload = {
type: 'xml',
value: vastValue,
ttlseconds: Number(bid.ttl)
};
if (typeof bid.customCacheKey === 'string' && bid.customCacheKey !== '') {
payload.key = bid.customC... | [
"function",
"toStorageRequest",
"(",
"bid",
")",
"{",
"const",
"vastValue",
"=",
"bid",
".",
"vastXml",
"?",
"bid",
".",
"vastXml",
":",
"wrapURI",
"(",
"bid",
".",
"vastUrl",
",",
"bid",
".",
"vastImpUrl",
")",
";",
"let",
"payload",
"=",
"{",
"type",... | Wraps a bid in the format expected by the prebid-server endpoints, or returns null if
the bid can't be converted cleanly.
@param {CacheableBid} bid | [
"Wraps",
"a",
"bid",
"in",
"the",
"format",
"expected",
"by",
"the",
"prebid",
"-",
"server",
"endpoints",
"or",
"returns",
"null",
"if",
"the",
"bid",
"can",
"t",
"be",
"converted",
"cleanly",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/videoCache.js#L61-L74 | train |
prebid/Prebid.js | src/videoCache.js | shimStorageCallback | function shimStorageCallback(done) {
return {
success: function(responseBody) {
let ids;
try {
ids = JSON.parse(responseBody).responses
} catch (e) {
done(e, []);
return;
}
if (ids) {
done(null, ids);
} else {
done(new Error("The cache s... | javascript | function shimStorageCallback(done) {
return {
success: function(responseBody) {
let ids;
try {
ids = JSON.parse(responseBody).responses
} catch (e) {
done(e, []);
return;
}
if (ids) {
done(null, ids);
} else {
done(new Error("The cache s... | [
"function",
"shimStorageCallback",
"(",
"done",
")",
"{",
"return",
"{",
"success",
":",
"function",
"(",
"responseBody",
")",
"{",
"let",
"ids",
";",
"try",
"{",
"ids",
"=",
"JSON",
".",
"parse",
"(",
"responseBody",
")",
".",
"responses",
"}",
"catch",... | A function which should be called with the results of the storage operation.
@callback videoCacheStoreCallback
@param {Error} [error] The error, if one occurred.
@param {?string[]} uuids An array of unique IDs. The array will have one element for each bid we were asked
to store. It may include null elements if some o... | [
"A",
"function",
"which",
"should",
"be",
"called",
"with",
"the",
"results",
"of",
"the",
"storage",
"operation",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/videoCache.js#L95-L116 | train |
prebid/Prebid.js | modules/medianetBidAdapter.js | getOverlapArea | function getOverlapArea(topLeft1, bottomRight1, topLeft2, bottomRight2) {
// If no overlap, return 0
if ((topLeft1.x > bottomRight2.x || bottomRight1.x < topLeft2.x) || (topLeft1.y > bottomRight2.y || bottomRight1.y < topLeft2.y)) {
return 0;
}
// return overlapping area : [ min of rightmost/bottommost co-o... | javascript | function getOverlapArea(topLeft1, bottomRight1, topLeft2, bottomRight2) {
// If no overlap, return 0
if ((topLeft1.x > bottomRight2.x || bottomRight1.x < topLeft2.x) || (topLeft1.y > bottomRight2.y || bottomRight1.y < topLeft2.y)) {
return 0;
}
// return overlapping area : [ min of rightmost/bottommost co-o... | [
"function",
"getOverlapArea",
"(",
"topLeft1",
",",
"bottomRight1",
",",
"topLeft2",
",",
"bottomRight2",
")",
"{",
"// If no overlap, return 0",
"if",
"(",
"(",
"topLeft1",
".",
"x",
">",
"bottomRight2",
".",
"x",
"||",
"bottomRight1",
".",
"x",
"<",
"topLeft... | find the overlapping area between two rectangles | [
"find",
"the",
"overlapping",
"area",
"between",
"two",
"rectangles"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/medianetBidAdapter.js#L199-L206 | train |
prebid/Prebid.js | modules/ucfunnelBidAdapter.js | function(bid) {
const isVideoMediaType = utils.deepAccess(bid, 'mediaTypes.video');
const videoContext = utils.deepAccess(bid, 'mediaTypes.video.context');
if (typeof bid.params !== 'object' || typeof bid.params.adid != 'string') {
return false;
}
if (isVideoMediaType && videoContext === 'ou... | javascript | function(bid) {
const isVideoMediaType = utils.deepAccess(bid, 'mediaTypes.video');
const videoContext = utils.deepAccess(bid, 'mediaTypes.video.context');
if (typeof bid.params !== 'object' || typeof bid.params.adid != 'string') {
return false;
}
if (isVideoMediaType && videoContext === 'ou... | [
"function",
"(",
"bid",
")",
"{",
"const",
"isVideoMediaType",
"=",
"utils",
".",
"deepAccess",
"(",
"bid",
",",
"'mediaTypes.video'",
")",
";",
"const",
"videoContext",
"=",
"utils",
".",
"deepAccess",
"(",
"bid",
",",
"'mediaTypes.video.context'",
")",
";",
... | Check if the bid is a valid zone ID in either number or string form
@param {object} bid the ucfunnel bid to validate
@return boolean for whether or not a bid is valid | [
"Check",
"if",
"the",
"bid",
"is",
"a",
"valid",
"zone",
"ID",
"in",
"either",
"number",
"or",
"string",
"form"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ucfunnelBidAdapter.js#L22-L36 | train | |
prebid/Prebid.js | modules/ucfunnelBidAdapter.js | function (ucfunnelResponseObj, request) {
const bidRequest = request.bidRequest;
const ad = ucfunnelResponseObj ? ucfunnelResponseObj.body : {};
const videoPlayerSize = parseSizes(bidRequest);
let bid = {
requestId: bidRequest.bidId,
cpm: ad.cpm || 0,
creativeId: ad.ad_id,
dealI... | javascript | function (ucfunnelResponseObj, request) {
const bidRequest = request.bidRequest;
const ad = ucfunnelResponseObj ? ucfunnelResponseObj.body : {};
const videoPlayerSize = parseSizes(bidRequest);
let bid = {
requestId: bidRequest.bidId,
cpm: ad.cpm || 0,
creativeId: ad.ad_id,
dealI... | [
"function",
"(",
"ucfunnelResponseObj",
",",
"request",
")",
"{",
"const",
"bidRequest",
"=",
"request",
".",
"bidRequest",
";",
"const",
"ad",
"=",
"ucfunnelResponseObj",
"?",
"ucfunnelResponseObj",
".",
"body",
":",
"{",
"}",
";",
"const",
"videoPlayerSize",
... | Format ucfunnel responses as Prebid bid responses
@param {ucfunnelResponseObj} ucfunnelResponse A successful response from ucfunnel.
@return {Bid[]} An array of formatted bids. | [
"Format",
"ucfunnel",
"responses",
"as",
"Prebid",
"bid",
"responses"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/ucfunnelBidAdapter.js#L59-L119 | train | |
prebid/Prebid.js | modules/conversantBidAdapter.js | getDevice | function getDevice() {
const language = navigator.language ? 'language' : 'userLanguage';
return {
h: screen.height,
w: screen.width,
dnt: getDNT() ? 1 : 0,
language: navigator[language].split('-')[0],
make: navigator.vendor ? navigator.vendor : '',
ua: navigator.userAgent
};
} | javascript | function getDevice() {
const language = navigator.language ? 'language' : 'userLanguage';
return {
h: screen.height,
w: screen.width,
dnt: getDNT() ? 1 : 0,
language: navigator[language].split('-')[0],
make: navigator.vendor ? navigator.vendor : '',
ua: navigator.userAgent
};
} | [
"function",
"getDevice",
"(",
")",
"{",
"const",
"language",
"=",
"navigator",
".",
"language",
"?",
"'language'",
":",
"'userLanguage'",
";",
"return",
"{",
"h",
":",
"screen",
".",
"height",
",",
"w",
":",
"screen",
".",
"width",
",",
"dnt",
":",
"ge... | Return openrtb device object that includes ua, width, and height.
@returns {Device} Openrtb device object | [
"Return",
"openrtb",
"device",
"object",
"that",
"includes",
"ua",
"width",
"and",
"height",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/conversantBidAdapter.js#L236-L246 | train |
prebid/Prebid.js | modules/conversantBidAdapter.js | convertSizes | function convertSizes(bidSizes) {
let format;
if (Array.isArray(bidSizes)) {
if (bidSizes.length === 2 && typeof bidSizes[0] === 'number' && typeof bidSizes[1] === 'number') {
format = [{w: bidSizes[0], h: bidSizes[1]}];
} else {
format = utils._map(bidSizes, d => { return {w: d[0], h: d[1]}; })... | javascript | function convertSizes(bidSizes) {
let format;
if (Array.isArray(bidSizes)) {
if (bidSizes.length === 2 && typeof bidSizes[0] === 'number' && typeof bidSizes[1] === 'number') {
format = [{w: bidSizes[0], h: bidSizes[1]}];
} else {
format = utils._map(bidSizes, d => { return {w: d[0], h: d[1]}; })... | [
"function",
"convertSizes",
"(",
"bidSizes",
")",
"{",
"let",
"format",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"bidSizes",
")",
")",
"{",
"if",
"(",
"bidSizes",
".",
"length",
"===",
"2",
"&&",
"typeof",
"bidSizes",
"[",
"0",
"]",
"===",
"'num... | Convert arrays of widths and heights to an array of objects with w and h properties.
[[300, 250], [300, 600]] => [{w: 300, h: 250}, {w: 300, h: 600}]
@param {number[2][]|number[2]} bidSizes - arrays of widths and heights
@returns {object[]} Array of objects with w and h | [
"Convert",
"arrays",
"of",
"widths",
"and",
"heights",
"to",
"an",
"array",
"of",
"objects",
"with",
"w",
"and",
"h",
"properties",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/conversantBidAdapter.js#L256-L267 | train |
prebid/Prebid.js | src/adapters/bidderFactory.js | validBidSize | function validBidSize(adUnitCode, bid, bidRequests) {
if ((bid.width || parseInt(bid.width, 10) === 0) && (bid.height || parseInt(bid.height, 10) === 0)) {
bid.width = parseInt(bid.width, 10);
bid.height = parseInt(bid.height, 10);
return true;
}
const adUnit = getBidderRequest(bidRequests, bid.bidde... | javascript | function validBidSize(adUnitCode, bid, bidRequests) {
if ((bid.width || parseInt(bid.width, 10) === 0) && (bid.height || parseInt(bid.height, 10) === 0)) {
bid.width = parseInt(bid.width, 10);
bid.height = parseInt(bid.height, 10);
return true;
}
const adUnit = getBidderRequest(bidRequests, bid.bidde... | [
"function",
"validBidSize",
"(",
"adUnitCode",
",",
"bid",
",",
"bidRequests",
")",
"{",
"if",
"(",
"(",
"bid",
".",
"width",
"||",
"parseInt",
"(",
"bid",
".",
"width",
",",
"10",
")",
"===",
"0",
")",
"&&",
"(",
"bid",
".",
"height",
"||",
"parse... | check that the bid has a width and height set | [
"check",
"that",
"the",
"bid",
"has",
"a",
"width",
"and",
"height",
"set"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/src/adapters/bidderFactory.js#L425-L447 | train |
prebid/Prebid.js | modules/prebidServerBidAdapter/index.js | setS2sConfig | function setS2sConfig(options) {
if (options.defaultVendor) {
let vendor = options.defaultVendor;
let optionKeys = Object.keys(options);
if (S2S_VENDORS[vendor]) {
// vendor keys will be set if either: the key was not specified by user
// or if the user did not set their own distinct value (ie... | javascript | function setS2sConfig(options) {
if (options.defaultVendor) {
let vendor = options.defaultVendor;
let optionKeys = Object.keys(options);
if (S2S_VENDORS[vendor]) {
// vendor keys will be set if either: the key was not specified by user
// or if the user did not set their own distinct value (ie... | [
"function",
"setS2sConfig",
"(",
"options",
")",
"{",
"if",
"(",
"options",
".",
"defaultVendor",
")",
"{",
"let",
"vendor",
"=",
"options",
".",
"defaultVendor",
";",
"let",
"optionKeys",
"=",
"Object",
".",
"keys",
"(",
"options",
")",
";",
"if",
"(",
... | Set config for server to server header bidding
@typedef {Object} options - required
@property {boolean} enabled enables S2S bidding
@property {string[]} bidders bidders to request S2S
@property {string} endpoint endpoint to contact
=== optional params below ===
@property {number} [timeout] timeout for S2S bidders - sho... | [
"Set",
"config",
"for",
"server",
"to",
"server",
"header",
"bidding"
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/prebidServerBidAdapter/index.js#L78-L109 | train |
prebid/Prebid.js | modules/prebidServerBidAdapter/index.js | doPreBidderSync | function doPreBidderSync(type, url, bidder, done) {
if (_s2sConfig.syncUrlModifier && typeof _s2sConfig.syncUrlModifier[bidder] === 'function') {
const newSyncUrl = _s2sConfig.syncUrlModifier[bidder](type, url, bidder);
doBidderSync(type, newSyncUrl, bidder, done)
} else {
doBidderSync(type, url, bidder... | javascript | function doPreBidderSync(type, url, bidder, done) {
if (_s2sConfig.syncUrlModifier && typeof _s2sConfig.syncUrlModifier[bidder] === 'function') {
const newSyncUrl = _s2sConfig.syncUrlModifier[bidder](type, url, bidder);
doBidderSync(type, newSyncUrl, bidder, done)
} else {
doBidderSync(type, url, bidder... | [
"function",
"doPreBidderSync",
"(",
"type",
",",
"url",
",",
"bidder",
",",
"done",
")",
"{",
"if",
"(",
"_s2sConfig",
".",
"syncUrlModifier",
"&&",
"typeof",
"_s2sConfig",
".",
"syncUrlModifier",
"[",
"bidder",
"]",
"===",
"'function'",
")",
"{",
"const",
... | Modify the cookie sync url from prebid server to add new params.
@param {string} type the type of sync, "image", "redirect", "iframe"
@param {string} url the url to sync
@param {string} bidder name of bidder doing sync for
@param {function} done an exit callback; to signify this pixel has either: finished rendering or... | [
"Modify",
"the",
"cookie",
"sync",
"url",
"from",
"prebid",
"server",
"to",
"add",
"new",
"params",
"."
] | bd1636ada243f30c309bd8212e4446d39d86659b | https://github.com/prebid/Prebid.js/blob/bd1636ada243f30c309bd8212e4446d39d86659b/modules/prebidServerBidAdapter/index.js#L188-L195 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.