query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Function containing Launch Library API call | function launchLibrary(year, date) {
//console.log(date);
var launchLibraryURL = 'https://launchlibrary.net/1.3/launch?mode=verbose&';
var targetDate = date.split('-');
var startDate = 'startdate=' + year[0] + '-' + targetDate + '-01';
var endDate = '&enddate=' + year[0] + '-' + targetDate + '-31';
... | [
"function target_launch_app() {\n var http = new XMLHttpRequest();\n http.open(\"GET\", \"./boa_launch.py\");\n http.onreadystatechange = function() {\n\tif (http.readyState == XMLHttpRequest.DONE) {\n\t if (http.status != 200) {\n\t\talert(\"target_launch_app()\\nError \" + http.status + \"\\n\" + http... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Populates the stock data table node with cells for all the stock data about a company. | function populateStockDataTable(stockData) {
const tableBody = document.querySelector('#stockDataTable tbody');
tableBody.innerHTML = "";
for (let data of stockData) {
let row = document.createElement('tr'); // each piece of 'data' will be a single row in the table
let ... | [
"function populateStockSummaryTable(stockData) {\n const openData = stockData.map(stock => stock.open); // creating arrays for each type of stock data\n const closeData = stockData.map(stock => stock.close);\n const lowData = stockData.map(stock => stock.low);\n const highData = stockDat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CMS \\ Checks that the filename suffix in el is in allowed array | function checkFile(el,allowed) {
var suffix = $(el).val().split(".")[$(el).val().split(".").length-1].toUpperCase();
if (!(allowed.indexOf(suffix) !== -1)) {
alert("File type not allowed,\nAllowed files: *."+allowed.join(",*."));
$(el).val("");
}
} | [
"function gfnFileExtCheck(obj, arr){\n\tif( $(obj).val() != \"\" ){\n var ext = $(obj).val().split('.').pop().toLowerCase();\n\t\tif($.inArray(ext, arr) == -1) {\n\t\t\talert(arr+' 파일만 업로드 할 수 있습니다.');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\treturn null;\n}",
"function fileExtension(str){\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update orbs position and calculate intersection points for all rays | update(x,y){
if (x > 0 & x < width){
if(y > 0 & y < height/2){
//if(!this.nearWall()){
this.pos.x= x;
this.pos.y= y;
for (var i = 0; i < this.rays.length;i++) {
this.rays[i].update(this.pos)
... | [
"intersection () {\n var tan = this.vector.y / this.vector.x,\n _this = this,\n from, to,\n cursorDegree = -Math.atan2(-this.vector.y, -this.vector.x) * 180/Math.PI + 180;\n\n\n for (var i= 0, max = this.cache.length; i < max; i++) {\n var item = _this.cache... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show bulk sms transfer modal box | function showSmsMultiModal()
{
//alert($('#leadsCount').val());
var count = parseInt($('#leadsCount').val());
if(count)
{
var leadCountTxt = (count>1)?count+" Leads":count+" Lead";
//alert('showTransferMultiModal');
$(".leadCountTxt").text(leadCoun... | [
"function showSMSDialog() {\n var SMS = require('ti.sms');\n \n var SMSDialog = SMS.createSMSDialog({\n barColor: \"black\",\n toRecipients: [\"1234567890\", \"0987654321\"],\n subject: \"What's up?\",\n messageBody: \"Titanium rocks! 🔥\"\n });\n \n if (!SMS.canSen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select previous panel, when in singlepanel mode. | selectPrevious () {
if (this._isNavigable) {
this.currentPanel -= 1;
}
} | [
"selectPrevious () {\n // if current tab is the first tab\n if (this.currentTab === 0) {\n // select last\n this.currentTab = (this.tabs.length - 1);\n } else {\n // select previous\n this.currentTab -= 1;\n }\n this.tabs[this.currentTab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a field from the collection by title | getByTitle(title) {
return Field(this, `getByTitle('${title}')`);
} | [
"function findFormByTitle(title){\n for (var i in forms) {\n if (forms[i].title === title) {\n return forms[i];\n }\n }\n return null;\n }",
"getByTitle(title) {\n return View(this, `getByTitle('${encodePath(title)}')`);\n }",
"getByTitle(ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the "kind" of value. (e.g. "String", "Number", etc) | function kindOf(val) {
return Object.prototype.toString.call(val).slice(8, -1);
} | [
"function classify(value) {\n if (value == null) {\n return null;\n }\n else if (value instanceof HTMLElement) {\n return 'primitive';\n }\n else if (value instanceof Array) {\n return 'array';\n }\n else if (value instanceof Date) {\n return 'primitive';\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
slider disabled v2 Extends mxShape. | function mxShapeGmdlSliderDisabled2(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function disableSizeSlider(){\r\n document.querySelector(\"#arr_sz\").disabled = true;\r\n}",
"disable() {\r\n this.enableMove(false);\r\n this.enableResize(false);\r\n this._triggerEvent('disable');\r\n return this;\r\n }",
"function disableHighLow( id ) {\n $(id).find(\".... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Putting x's from the interval in the array Computing y's with this formula: k1 = f(x[i1], y[i1]) k2 = f(x[i1] + h/2, y[i1] + hk1/2) k3 = f(x[i1] + h/2, y[i1] + hk2/2) k4 = f(x[i1], y[i1] + hk3) y[i] = y[i1] + h/6(k1+2k2+2k3+k4) | function RungeKutta() {
xRungeKutta.length = 0;
yRungeKutta.length = 0;
yRungeKuttaErrorGlobal.length = 0;
yRungeKutta.push(+y0);
for (let i = x0; i <= X; i+=h) {
xRungeKutta.push(+i);
}
for (let i = 1; i < xRungeKutta.length; i++) {
var k1 = equation(+xImprovedEuler[i-1], +y... | [
"function computeEachPoint(min, max, fx)\n{\n let xData = [];\n let yData = [];\n const step = 0.1;\n\n for(let i = min;i <= max; i += step)\n {\n xData.push(i);\n let y = fx(i);\n yData.push(y);\n }\n\n return [xData, yData];\n}",
"function val2between({\n xy, //function y(x) set as pairs ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a post object and fetches the current revision for that post. If the revision doesn't exist null will be passed back. | function fetchCurrentRevision (post, next) {
RevisionModel.findById (post.currentRevision, function (error, revision) {
if (!error) {
next (revision);
}
else {
console.log ('Erorr occured while retrieving current revision: ' + error);
next (null);
... | [
"function updatePost (user, post, fileName, title, datePublished, content, commitId) {\n var newRevision = new RevisionModel ({\n author : user,\n commitId : commitId,\n revisionDate : datePublished,\n content : content,\n });\n\n\n fetchRevisionsByIds... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Silver Bullet code file originated Sept 2017 Major restructure: August 2019 KILL EMPTY GROUPS IN LAYER Called from processSibyl to do final check through all layers, deleting empty groups | function killEmptyGroupsInLayer(theLayer) {
var gCount = theLayer.groupItems.length;
for (var gNo = gCount - 1; gNo >= 0; gNo--) {
var thisGroup = theLayer.groupItems[gNo];
if (thisGroup.pageItems.length === 0) {
thisGroup.remove();
}
}
} | [
"deselectAll() {\n\n if (this.currentTab === 'supergroups') {\n for (let sg in this.supergroups) {\n if (this.supergroups.hasOwnProperty(sg)) {\n this.supergroups[sg].visible = false;\n }\n }\n this.checkedSupergroups = [];\n }\n else if (this.current... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Collapsible sidebar portlets Source: ============================================================ | function foldingPortlets() {
var portlets = getElementsByClassName(document.getElementById('column-one'), 'div', 'portlet');
var portskip = ['p-personal', 'p-cactions', 'p-logo', 'ads-top-left', 'p-search', 'p-tbx', 'p-wikicities-nav', 'p-lang'];
var num = 0;
for (var i = 0; i < portlets.length; i++) {... | [
"function switchToCollapsibleLayout() {\n layout = \"collapsible\";\n var sidebarFull = $(\".left-sidebar-toplevel\").detach();\n $(\".sidebar-target-collapsible\").prepend(sidebarFull);\n $(\".left-sidebar-toplevel\").addClass(\"left-sidebar-collapsible\");\n $(\".left-sidebar-to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays games based on specified platform | function output_sort_platform(result, platform){
window.scrollTo(0, 0);
let length = result.length;
let i = 0;
if(platform == "pc"){
platform = "PC (Windows)";
}
else{
platform = "Web Browser";
}
document.querySelector("main").innerHTML = "";
document.querySelector("main").style.display = "g... | [
"function renderplat(){\n ctx.fillStyle = \"#8C158E\";\n platforms.forEach((platform) => {\n ctx.fillRect(platform.x, platform.y, platform.width, platform.height);\n })\n}",
"function renderplat(){\n for(var i=0; i<platforms.length;i++){\n ctx.fillStyle = platforms[i].color;\n ctx.fillRect(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the exchange isMeeting of this event readonly attribute boolean isMeeting; | get isMeeting()
{
return this._isMeeting;
} | [
"get meetingRequestWasSent()\n\t{\n\t\treturn this._meetingRequestWasSent;\n\t}",
"get reminderIsSet()\n\t{\n\t\treturn this._reminderIsSet;\n\t}",
"function setAlarm(employed, vacation){\n return !vacation && employed ? true : false;\n}",
"get meetingTimeZone()\n\t{\n\t\treturn this._meetingTimeZone;\n\t}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decreases the given `interval` to match the last possible time that coincides with the unit of the given interval, if any. Like if the interval is an exact number of days, this yields the milliseconds until some next day (local time), and when called just before midnight the returned interval might be quite small. Like... | _minimizeInterval(interval) {
const unit = [24 * 3600, 3600, 30 * 60, 15 * 60, 10 * 60, 5 * 60, 60, 30, 15, 10, 5, 1].find(s => interval % (s * 1000) === 0) * 1000;
if (!unit) {
return interval;
}
const utc = new Date();
// Ensure daily reports start at midnight in th... | [
"_firstTick(interval, tickPeriod) {\n const time = interval.start;\n var period = tickPeriod.value;\n var unit = tickPeriod.unit;\n\n var roundedTime = time.clone().startOf(unit);\n if (!roundedTime.isSame(time)) {\n roundedTime.add(1, unit);\n }\n if (unit === 'h' || unit === 'M') {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
related to: eventManager makeEventManager() > eventManager Makes an event manager. The manager creates and references event lists (see [[makeEventList]]) based on a name. | function makeEventManager() {
var manager = {};
var list = {};
/**
* eventManager.get(name) -> eventList
* - name (String): Name of the event list.
*
* Gets an [[eventList]] for the given `name`. If there is no
* [[eventList]] for that `name`, o... | [
"function get(name) {\n\n if (!list[name]) {\n list[name] = makeEventList();\n }\n\n return list[name];\n\n }",
"async function createManager() {\n const newManager = await new Manager();\n await newManager.getOfficeNumber();\n await manager.push(new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove entity attribute from microdata list | onAttrRemove (attrName, entName) {
if (this.entityAttrsUse.length <= 0) return // microdata list already empty
if (!attrName || !entName) {
console.warn('Unable to remove from microdata list, attribute or entity name is empty:', attrName, entName)
return
}
const name = entName + ... | [
"function removeCustomAttribute(customAttribute) {\n if (!(customAttribute in customQualificationData)) {\n return;\n }\n delete customQualificationData[customAttribute];\n displayCustomAttributes();\n}",
"function remove () {\n for (let key in currAttrs) {\n if (!nextAttrs[key]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns list of flagged quotes if logged in | function returnFlaggedQuotes( queryObj, response, sessionObj, onFinish )
{
//if the user is not logged in then stop them from getting the flagged quotes
if ( sessionObj.data.user === undefined )
{
var errorList = [ { "name" : "user" , "problem" : "not logged in" } ];
outputErrorAsJson( error... | [
"function processQuotes(context) {\n hidePostsByDataAttribute(\n context.querySelectorAll('[data-ipsquote-userid]'),\n 'ipsquoteUserid'\n )\n }",
"static getSelectedSongs() {\n return SongManager.songList.filter(s => s.element.hasAttribute(\"selectedsong\"));\n }",
"function generateQ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove all stored sessions for given identifier. | async clearSessions(identifier) {
if (!this.storage) {
throw new Error('Unable to clear sessions: No storage adapter configured');
}
for (const auth of await this.listSessions(identifier)) {
await this.removeSession(identifier, auth);
}
} | [
"static async destroy(id) {\n db.del(`session:${id}`)\n }",
"function destroyExpiredSessions() {\n // httpd sessions\n var httpSessions = this.getSessions(\"http\");\n for (var i = 0; i < httpSessions.length; i++) {\n var session = httpSessions[i];\n if ((Date.now() ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GOES THROUGH ALL OF MY POSTS AND RENDERS THEM TO THE "MYPOST" MODAL | function renderMyPostsLinks(posts) {
posts.forEach(function (post) {
const postElement = createMyPostHTML(post);
$(".modal-body").append(postElement);
});
} | [
"function renderPosts(posts){\n\n //jQuery ima each metodo s katero loop-amo\n\n $.each(posts, function (i, post) {\n\n\n //kot spremenljivke sem shranila te 4 elemente\n\n var $postContainer = $('<div>', {class:'post-container'});\n var $postTitle = $('<h1>', {class:'post-title', t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses the text body returned by the server from a batch request | function parseResponse(body) {
const responses = [];
const header = "--batchresponse_";
// Ex. "HTTP/1.1 500 Internal Server Error"
const statusRegExp = new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)", "i");
const lines = body.split("\n");
let state = "batch";
let status;
let statusText;
... | [
"_bufferParse(response)\n {\n return new Promise((resolve, reject) => {\n response.on('error', reject);\n\n let dataBuffer = [];\n\n response.on('data', (data) => {\n dataBuffer.push(data);\n });\n\n response.on('end', () => resolve(dataBuffer));\n });\n }",
"parseResponse(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//Update Meta Data//// ////////////////////// Update to file data. Name update is only triggered on blur event (due to async file to write functionality) The rest is called immediately. TODO: Need to compact DB at some point. TODO: Should refractor the data that's being passed. | function updateFileData(data) {
if (data.field === 'name') {
data.newObj.path = uploadPath + data.newObj.name + data.file.extension;
dbSrvc.update(fileCollection, data);
renameFileToSystem(data.file.path, data.newObj.path);
} else {
dbSrvc.update(fileColle... | [
"function updateDbEntryAndMove(sFileNameOld, sFileNameNew, fCallback) {\n\t// update database entry\n\tvar sSql = esc(\"UPDATE datasets SET file_name = %Q WHERE file_name = %Q;\",\n\tsFileNameNew, sFileNameOld);\n\t\t\n\tpostgres.query(sSql, function(oErr, oResult) {\n\t\tif(oErr) {fCallback(oErr);}\n\t\t\t\n\t\t//... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This extracts the vassal array from the GM_value | function getVassals(){
g_vassals = [];
var v = GM_getValue(vassal_key, '').split("||");
if (v=='') return;
for (var i=0; i < v.length; i++){
g_vassals[i] = makeVassal(v[i]);
g_paid[v[i]] = [];
}
} | [
"getValues() {\n return this.getValuesFromElement(this.element);\n }",
"function declaracionArrayCTV(ele, mod, ambi) {\n var encontreError = false;\n //BUSCANDO VECTOR EN LOS AMBITOS SI NO ESTA SE REALIZA DECLARACION\n if (!buscarVariable(ele.identificador)) {\n //VERIFICAR EXPRESIONES\n var v = [];\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render dc.js elements The makeGraphs function renders all the graphs and crossfilters the returned data from the loadDoc function. This function is called from the loadDoc function. | function makeGraphs(data) {
var ndx = crossfilter(data);
has_website(ndx);
pieChart(ndx);
barChart(ndx);
table(ndx, 10);
dc.renderAll();
$(".dc-select-menu").addClass("custom-select");
} | [
"function draw() {\n\t\tvar nodes = _layoutEngine.getNodes();\n\t\tvar links = _layoutEngine.getLinks();\n\n\t\tvar svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n\t\tsvg.setAttribute('height', _height);\n\t\tsvg.setAttribute('width', _width);\n\n\t\t_container.appendChild(svg);\n\n\t\t_visua... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function will get a valid letter guess | function getValidLetterGuess() {
//this helper function is used to determine if letter guess is valid
function guessIsValid(letter) {
//use regex to determine if letter is in the alphabet and ignore case sensitivty
const validEntries = /[a-z]/i;
//if the letter is in the alphabet and the length of the l... | [
"function guessIsValid(letter) {\n //use regex to determine if letter is in the alphabet and ignore case sensitivty\n const validEntries = /[a-z]/i;\n //if the letter is in the alphabet and the length of the letter is 1\n if (validEntries.test(letter) && letter.length === 1) {\n return letter;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Route handler To fetch product chooser Page | function chooseProductPage(req, res) {
return res.render('product-switcher.html');
} | [
"function productPage (itm, cst) {\n pref.product = {item: itm, cost: cst};\n storePref();\n window.location.href = '../pages/product.html';\n}",
"function Show() {\n var CurrentHttpParameterMap = request.httpParameterMap;\n var CurrentForms = session.forms;\n\n CurrentForms.giftregistry.clearFo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set attributes to a d3 selection. | function setAttrs(select, attrs) {
var key;
for (key in attrs) {
if (attrs.hasOwnProperty(key)) {
select.attr(key, attrs[key]);
}
}
} | [
"function createAttributeSelect() {\n var attrSelect = $(\"#attr-select\");\n var prevDatasetId = queryParameters.dataset;\n if(attrSelect.length > 0 && attrSelect.data(\"datasetid\") !== prevDatasetId){\n attrSelect.parent().remove();\n attrSelect = $(\"#attr-select\");\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function called triple that takes a number as an argument and returns the result of that number multiplied by 3. | function triple(number) {
return number * 3
} | [
"function multiplysNum(n1, n2, n3){\n alert (n1 * n2 * n3)\n}",
"function multiplicationNum (num1, num2, num3) {\n totalMultipication = num1 * num2 * num3;\n return totalMultipication;\n}",
"function sumOfThree(x) \n {\n return x[0] + x[1] + x[2];\n }",
"function multiOf(num , num2 ,num3)\n {\n\n \ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Synchronously perform change detection on a root view and its components. | function detectChangesInRootView(lView) {
tickRootContext(lView[CONTEXT]);
} | [
"function notifyObservers() {\n _.each(views, function (aView) {\n aView.update();\n });\n } // notifyObservers",
"function walkViewTree(rootView, fn) {\n let visit_ = view => {\n fn(view);\n\n let nsArray = view.subviews();\n let count = nsArray.count();\n for (let i = 0; i < cou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define small collection of default pagelets, this prevents code duplication. | function Pagelets() {
this.navigation = require('./pagelets/navigation');
this.footer = contour.footer;
this.analytics = contour.analytics.extend({
data: {
domain: 'browsenpm.org',
key: 'gikqh9ctxn',
type: 'segment'
}
});
} | [
"addDefaultParameters() {\n // for (let parameterData of[{ name: 'page_count', type: Parameter.type.number, eval: false, editable: false, showOnlyNameType: true }, { name: 'page_number', type: Parameter.type.number, eval: false, editable: false, showOnlyNameType: true }]) {\n // let parameter = ne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
See description above for Modifier constructor for details, same technique Painter % (func: Function(ctx, data[ctx, t, dt])[, type: C.PNT_]) | function Painter(func, type) {
func.id = guid();
func.type = type || C.PNT_USER;
func[C.MARKERS.PAINTER_MARKER] = true;
return func;
} | [
"function Modifier(func, type) {\n func.id = guid();\n func.type = type || C.MOD_USER;\n func.$data = null;\n func.$band = func.$band || null; // either band or time is specified\n func.$time = is.defined(func.$time) ? func.$time : null; // either band or time is specified\n func.$easing = func.$e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test: .size should return dimensions for element with margin | function sizeShouldReturnDimensionsForElementWithMargin() {
const data = element.size(fixture.el.querySelector(".size"))
expect(data)
.toEqual({
width: 100,
height: 100
})
} | [
"function measure(element, maxSize) {\n var horizontalMargin = element.margin.left + element.margin.right;\n var verticalMargin = element.margin.top + element.margin.bottom;\n if (element.width && element.width < maxSize.x) { maxSize.x = element.width; }\n if (element.height && element.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if there are any images for the selected foot param footIndex: 0 => left foot, 1 => right foot returns true if there are any images for the selected foot in the database | existsAnyImages_for_selectedFoot(footIndex) {
try {
if (this.state.toeData.feet[footIndex].toes !== undefined) {
for (let i = 0; i < 5; i++) {//5 toes
if (this.state.toeData.feet[footIndex].toes[i].images.length > 0)
return true;
... | [
"function checkSlide(e) {\n images.forEach(img => {\n // console.group('image ',img.id)\n const imageMidpoint = (img.offsetTop+(img.clientHeight/2));\n const isInView = (imageMidpoint < window.scrollY+window.innerHeight);\n // console.log('isInView: ', isInView);\n const isOutOfView = (imageMidpoint... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
global functions clear the totals and tosserTotals arrays with a zero at each time | function clearTotals() {
for (var i = 0; i < numOpenHours; i++){
totals[i] = 0;
tosserTotals[i] = 0;
}
} | [
"function clearCalculation() {\n calculation = [];\n displayCalculation();\n }",
"reset() {\n /**\n * The overall error.\n */\n this.globalError = 0;\n /**\n * The size of a set.\n */\n this.setSize = 0;\n\n this.sum = 0;\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formats the given money. | format (money) {
return `${this.formatSign(money)}${
this.currency.symbol
}${this.commaPeriodSetting.format(
Math.floor(Math.abs(money.amount))
)}${this.formatMoneyFractionPart(money)}`
} | [
"function formatMoney(number){\n return '₹ '+number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}",
"function getMoneyFormatted(val){\n return val.toFixed(2);\n }",
"function formatCurrency(num, addDollarSign) {\n\tvar resultStr = \"\";\n\tvar Str = \"\";\n\n\t// Retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate HTML for a given wallet | function genWalletHtml(viewModel, index, wallet) {
var walletHtml = jQuery([
'<div id="wallet-' + index + '" class="col-sm-12 col-md-6 col-lg-6 col-xl-4">',
'<div class="card text-light">',
'<div class="card-header bg-flat-color-5">',
'<div class="col-10 pl-0... | [
"function updateWalletHtml(viewModel) {\n jQuery(\"#wallets\").empty();\n\n var walletCount = 0;\n jQuery.each(viewModel.wallets, function(index, element) {\n walletCount++;\n var walletHtml = genWalletHtml(viewModel, index, element);\n\n jQuery(\"#wallets\").append(walletHtml);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set ``testFile`` to kind. | _$kind() {
this._value.kind = 'testFile';
} | [
"setOutputFileType(fileType) {\n this.outputType = 'audio/' + fileType + '; codecs=opus';\n }",
"function setCurrentFile(file) {\n data.currentFile = file;\n }",
"resetFileThumb() {\n const fileThumb = this.dom.querySelector(\".file-details-thumbnail\");\n fileThumb.src = require(\".... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Implements a EBNF grammar using the Myna parsing library See | function CreateEbnfGrammar(myna) {
// Setup a shorthand for the Myna parsing library object
let m = myna;
let g = new function() {
// comment and whitespace
this.comment = m.seq("/*", m.advanceUntilPast("*/"));
this.ws = m.char(" \t").or(m.seq(m.choice('\... | [
"function CreateGrammar(myna) {\r\n // Setup a shorthand for the Myna parsing library object\r\n let m = myna; \r\n\r\n let g = new function() {\r\n // comment and whitespace \r\n this.comment \t= m.choice(m.seq(\"/*\", m.advanceUntilPast(\"*/\")), m.seq('//', m.advanceUntilPast(\"\\n\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return location of firefox.exe file for a given Firefox directory (available: "Mozilla Firefox", "Aurora", "Nightly"). | function getFirefoxExe(firefoxDirName){
if (process.platform !== 'win32') {
return null;
}
var prefix;
var prefixes = [process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']];
var suffix = '\\'+ firefoxDirName + '\\firefox.exe';
for (var i = 0; i < prefixes.length; i++) {
pref... | [
"function isFirefox()\n{\n var m = navigator.userAgent.match(/Firefox\\/(\\d\\.\\d+)/);\n if(m)\n {\n return true;\n }\n}",
"function getExecutablePath () {\n let possiblePaths = [\n '/Applications/Guild Wars 2.app',\n 'C:\\\\Program Files\\\\Guild Wars 2\\\\Gw2.exe',\n 'C:\\\\Program... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiate a new multi render target texture. A multi render target, like a render target provides the ability to render to a texture. Unlike the render target, it can render to several draw buffers in one draw. This is specially interesting in deferred rendering or for any effects requiring more than just one color f... | function MultiRenderTarget(name,size,count,scene,options){var _this=this;var generateMipMaps=options&&options.generateMipMaps?options.generateMipMaps:false;var generateDepthTexture=options&&options.generateDepthTexture?options.generateDepthTexture:false;var doNotChangeAspectRatio=!options||options.doNotChangeAspectRati... | [
"function SpriteMultiple(sprites, render) {\n var sources = render.source[2];\n this.sprites = sprites;\n this.direction = render.source[1];\n if (this.direction === \"vertical\" || this.direction === \"corners\") {\n this.topheight = sources.topheight | 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::Route.GrpcRouteMatch` resource | function cfnRouteGrpcRouteMatchPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnRoute_GrpcRouteMatchPropertyValidator(properties).assertSuccess();
return {
Metadata: cdk.listMapper(cfnRouteGrpcRouteMetadataPropertyToCloudFormation)(propert... | [
"function cfnRouteGrpcRoutePropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnRoute_GrpcRoutePropertyValidator(properties).assertSuccess();\n return {\n Action: cfnRouteGrpcRouteActionPropertyToCloudFormation(properties.action),\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to stop/delete graph | function stop()
{
//get choosen location
var locations = document.getElementById("location");
var loc = locations.options[locations.selectedIndex].value;
//go through array of already set up graphs
for(var i = 0; i < array.length; i++)
{
//check graph position
if(array[i][0]==loc)
... | [
"function chartStop(chart_id) {\n // Drop the config\n clearInterval(chart_id);\n}",
"delete() {\n\t\t// Remove all edge relate to vertex\n\t\tthis.vertexMgmt.edgeMgmt.removeAllEdgeConnectToVertex(this)\n\n\t\t// Remove from DOM\n\t\td3.select(`#${this.id}`).remove()\n\t\t// Remove from data container\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up common IComponentValidator script for an editor that has minimum, maximum, and current value properties. | function setupCommonRangeCheckingValidation(prototype, noun, nouns,
minProperty, maxProperty, valueProperty, converter) {
setupCommonAndMaxLengthRangeCheckingValidation(prototype, noun, nouns,
minProperty, maxProperty, valueProperty, converter, null);
} | [
"function setupCommonAndMaxLengthRangeCheckingValidation(prototype, noun, nouns,\r\n\t\tminProperty, maxProperty, valueProperty, converter, maxLengthProperty) {\r\n\r\n\tif (converter == null)\r\n\t\tconverter = function(value) { return value; };\r\n\r\n\t\t\t// note that laf will be null if a display model was not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
works even when old_elt is the only elt in its parent. | function insert_elt_after(new_elt, old_elt){
old_elt.parentNode.insertBefore(new_elt, old_elt.nextSibling);
} | [
"function diffComponent (path, entityId, prev, next, el) {\n if (next.type !== prev.type) {\n return replaceElement(entityId, path, el, next)\n } else {\n var targetId = children[entityId][path]\n\n // This is a hack for now\n if (targetId) {\n updateEntityProps(targetId, assign({ c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
giniIndex: calculate entropy with respect to variable, return | function giniIndex(obj, target_var, input_var){
rootEnt = rootNode(obj,target_var);
//Variable breakage
if(typeof(obj[input_var]=="number")){
console.log("it's a number!");
x = unique(obj,input_var).sort();
console.log(x);
//Count aboves and belows
info... | [
"function logEntropy(s) {\n console.log('Entropy of \"' + s + '\" in bits per symbol:', shannon.entropy(s));\n}",
"calcFitness(target) {\n let score = 0;\n\n for (let i = 0; i < this.genes.length; i++) {\n if (this.genes[i] == target.charAt(i)) {\n score++;\n }\n }\n\n this.fitness =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides all fetchers currently on the page. Useful for layouts and parent routes that need to provide pending/optimistic UI regarding the fetch. | function useFetchers() {
let state = dist_useDataRouterState(dist_DataRouterStateHook.UseFetchers);
return [...state.fetchers.values()];
} | [
"function fetchSites() {\n fetch(BASE_URL + SITES)\n .then(function(response) {\n return response.json();\n })\n .then(function(json) {\n json.forEach(site => {\n document.getElementById(\"loading\").style.display = \"none\";\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch school results from the REST API which is run locally. Get the results in JSON format. Set the state with the obtained results. | componentDidMount() {
fetch('http://localhost:3000/schools?gradeRange=6-8&gradeRange=K-8&gradeRange=7-12')
.then(results => results.json())
.then((data) => {this.setState({middleSchools: data});
//console.log('the retreived data is: ' + JSON.stringify(data));
});
} | [
"_fetchState() {\n this._fetchLeagues();\n this._fetchSeasons();\n this._fetchRallies();\n this._fetchDrivers();\n }",
"getSpecies() {\n return axios.get(\"http://swapi.co/api/species\", {crossDomain: true})\n .then((response) => {\n this.setState({species: response.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserinterfaceBody. | exitInterfaceBody(ctx) {
} | [
"exitNormalInterfaceDeclaration(ctx) {\n\t}",
"exitControlStructureBody(ctx) {\n\t}",
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitInterfaceModifier(ctx) {\n\t}",
"endIf() {\n return this._endBlockNode(If, Else)\n }",
"exitStatementWithoutTrailingSubstatemen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assign the global group items to remove | function remove_group() {
// Enable the remove animation
remove_animation = true;
// refresh the score
set_stat(stat_types.score, gamer.score + map.single_score * group.length);
// refresh tha available planets
gamer.available_planets -= group.length;
// set ev... | [
"function remove_floating_group() {\n // Enable the remove animation\n remove_animation = true;\n\n // refresh the score\n set_stat(stat_types.score, gamer.score + map.floating_score * group.length);\n\n for (var i = group.length - 1; i >= 0; i--) {\n // refresh the ava... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove all right and wrong style classes from all answer buttons. | function resetAnswerButtons() {
for(var i = 1; i <= 4; i++) {
$("#divAnswer" + i).removeClass(
"classAnswerCorrect classAnswerEliminated");
}
} | [
"function prepareAnswerClasses(){\n\n for (let i =0; i<answerchildren.length; i++){\n answerchildren[i].classList.remove('hiddenAnswer');\n answerchildren[i].classList.add('basicAnswer');\n }\n document.getElementById(\"answers\").classList.remove('unclickable');\n}",
"function resetForm() {\n\t//Reset b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readBlankNodeTail` reads the end of a blank node | _readBlankNodeTail(token) {
if (token.type !== ']') return this._readBlankNodePunctuation(token); // Store blank node quad
if (this._subject !== null) this._emit(this._subject, this._predicate, this._object, this._graph); // Restore the parent context containing this blank node
const empty = this._predica... | [
"function NilNode() {\n}",
"_readRDFStarTail(token) {\n if (token.type !== '>>') return this._error(`Expected >> but got ${token.type}`, token); // Read the quad and restore the previous context\n\n const quad = this._quad(this._subject, this._predicate, this._object, this._graph || this.DEFAULTGRAPH);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selector caching. See for more details | function Selector_Cache() {
var collection = {};
function get_from_cache( selector ) {
if ( undefined === collection[ selector ] ) {
collection[ selector ] = $( selector );
}
return collection[ selector ];
};
return { get: get_from_cache };
} | [
"_getOptionSelector(widgetInstance){\n return this.cache.selector[widgetInstance.id] = this.cache.selector[widgetInstance.id] || widgetInstance._getOptionSelector({ enableCaching: true });\n }",
"function createSelector() {\n for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a map from a type of attention to the CLs that needs that attention from the user. | getCategoryMap() {
var result = new utils.Map();
var user = this.getAccount();
var onlyAttentionSet = this.options_.onlyAttentionSet;
this.data_.forEach(function(cl) {
var attention
if (onlyAttentionSet !== config.OPTION_DISABLED) {
attention = cl.getCategoryFromAttentionSet(user);
... | [
"get_user_input() {\n return new Map();\n }",
"fetchAttributes() {\n let result = {};\n Object.values(this.attributes).map(attribute => {\n result[attribute.type] = Utility.getInstance().clone(attribute);\n })\n this.traits.map(trait => {\n Object.values... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the length of item name and add 3 dots if too long | checkName(item) {
var name = item.name;
if(name.length > 28) {
return name.substr(0,28)+'...';
} else {
return name;
}
} | [
"function shortenName(name){\n var split, partA, partB, finalName;\n\n if($.getSizeClassification('medium_up') && name.length > 35){\n split = Math.floor((name.length - 1) / 4);\n partA = name.substring(0,split);\n partB = name.substring(name.length-split);\n finalName = partA + '.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
4. Pure assertion tests whether a value is truthy, as determined by !!guard. assert.ok(guard, message_opt); This statement is equivalent to assert.equal(true, guard, message_opt);. To test strictly for the value true, use assert.strictEqual(true, guard, message_opt);. | function ok(value, message) {
if (!!!value) fail(value, true, message, '==', assert.ok);
} | [
"function assertIsTruthy(a){\n return a_is_truthy(a);\n }",
"function assertion(value) {\n return expression.test(value)\n }",
"confirmAssertion () {\n this._asserted = true;\n }",
"function mustBeTrue (boo) {\n if (boo === true) {\n return true;\n }\n}",
"function mustBeTrue (b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sells quantity of itemid, returns the amount of money made from the sale, or false if some error | sell(itemid, quantity)
{
var func = "Inventory.sell";
if(!this.has(itemid))
{
console.warn(func + ": cannot sell an item (" + itemid + ") we don't have.");
return false; // TODO test
}
var value = this.get(itemid);
if(quantity > value)
... | [
"function sellSpecificItem(someItem) {\n someItem.shopDivI.style.display = 'block';\n someItem.inventoryDivI.style.display = 'none';\n money = money + someItem.sellI();\n prestige = prestige - someItem.owningI;\n someItem.boughtI = false;\n updateStats();\n message(msgSell + someItem.nameI + ' for ' + someIt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `HttpGatewayRouteRewriteProperty` | function CfnGatewayRoute_HttpGatewayRouteRewritePropertyValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
if (typeof properties !== 'object') {
errors.collect(new cdk.ValidationResult('Expected an objec... | [
"function CfnGatewayRoute_HttpGatewayRoutePathRewritePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Ex... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function returns the device orientation in angles | function getOrientation() {
return window.screen.orientation.angle;
} | [
"@computed\n get sideCenterAngles() {\n const sideSum = this.windowDimensions.width + this.windowDimensions.height;\n const topBottom = this.windowDimensions.width / sideSum * Math.PI;\n const leftRigth = Math.abs(topBottom - Math.PI);\n return { topBottom, leftRigth };\n }",
"calculateRotation() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalize `position` to add an `indent`. | function normalize(position) {
var offsets = ctx.offset
var line = position.line
var result = []
while (++line) {
if (!(line in offsets)) {
break
}
result.push((offsets[line] || 0) + 1)
}
return {start: position, indent: result}
} | [
"function syntaxIndentation(cx, ast, pos) {\n return indentFrom(\n ast.resolveInner(pos).enterUnfinishedNodesBefore(pos),\n pos,\n cx\n )\n }",
"assignPosition(node, position) {\n node.position = position \n if (node.children.length){\n for (let child_node of node.chil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines whether this block type is active; uses the this.blocks property if the block is being tracked, otherwise defaults to false | has_block(type) { return (this.tracking_block(type)) ? this.blocks[type] : false; } | [
"tracking_block(type) { return this.blocks[type] !== undefined; }",
"function isBlockType(name) {\n return !!blockTypes[name];\n }",
"function getBlockType(name) {\n return blockTypes[name] || false;\n }",
"function atTopLevel() {\n return Object.is(topBlock,currentBlock);\n }",
"hasBlockA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
oBA compute the amount of dissolved oBA, in mg, for a specific hop addition | function compute_oBA_dis_mg(ibu, hopIdx, currVolume) {
var oBA_addition = 0.0;
var oBA_percent = 0.0;
oBA_percent = 1.0 - ibu.add[hopIdx].freshnessFactor.value;
oBA_addition = oBA_percent * SMPH.oBA_boilFactor *
(ibu.add[hopIdx].BA.value / 100.0) *
ibu.add[hopIdx].weight.val... | [
"function compute_oAA_dis_mg(ibu, hopIdx, currVolume) {\n var AAloss_percent = 0.0;\n var k = 0.0;\n var oAA_addition = 0.0;\n var oAA_fresh = 0.0;\n var oAA_percent_boilFactor = 0.0;\n var oAA_percent_init = 0.0;\n var oAA_percent = 0.0;\n var ratio = 0.0;\n var relativeAA = 0.0;\n\n // The oAA_percent_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
select and analyze GranD dam | function analyzeGranD() {
var zoomLevel = 12
var dam = getDamAfter2000()
//Map.centerObject(dam, zoomLevel)
var bounds = ee.Geometry(Map.getBounds(true))
var images = analyzeDamsAfter2000(bounds)
var beforeConstruction = images[0]
var afterConstruction = images[1]
var percentiles = [10, 20, 30, 40, ... | [
"function main () {\n\n pg_handler.pool_query_db(pg_pool, query_text, [], function(query_result) {\n if (query_result.rows && query_result.rows.length) {\n const scenes_by_dataset = usgs_helpers.sort_scene_records_by_dataset(query_result.rows)\n var dataset_names = usgs_constants.LANDSAT_DATASETS.slic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redact some text / required params properties / inputText : string : the text to have redaction performed on it. / phrases : array of strings : the text strings to match and replace / optional params properties / replacementChar : character : the replacement character : defaults to 'X' / caseSensitive : boolean : defau... | redact(parameters) {
// Converted to a promise now
let promise = this.$q((resolve, reject) => {
// Setup and defaults
let replacementChar = parameters.replacementChar || 'X';
// Here is a little example of type checking variables and defaulting if it isn't as expected.
let caseSensitive ... | [
"async function replaceAsync(str, regex, replacerAsync) {\n const promises = [];\n str.replace(regex, (match, ...args) => {\n const promise = replacerAsync(match, ...args);\n promises.push(promise);\n return \"\";\n });\n const data = await Promise.all(promises);\n return str.rep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trains a given model with the given syllables | function train(model, syllables) {
console.log('train')
let x = syllables.map(extract)
let y = syllables.map(({ tone }) => tone)
// const data = model.name === 'LogisticRegression' ? [
// new Matrix(x),
// Matrix.columnVector(y)
// ] : [x, y]
const data = [new Matrix(x), Matrix.columnVector(y)]
... | [
"function bindLabels(data) {\n $scope.langproLables = data.labels;\n }",
"function TLabel(){}",
"function translateResourceLabel(terms){\n var name = terms[0].terms[0].predicate;\n var label = terms[1].predicate;\n var readWriteValue = \"private\"\n if(terms[2] !== undefine... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`readSlice()` reads until the first occurrence of `delim` in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. If `readSlice()` encounters an error before finding a delimiter, or the buffer fills without finding a delimiter, it throws an error with a `partial... | async readSlice(delim) {
let s = 0; // search start index
let slice;
while (true) {
// Search buffer.
let i = this.buf.subarray(this.r + s, this.w).indexOf(delim);
if (i >= 0) {
i += s;
slice = th... | [
"async readString(delim) {\n if (delim.length !== 1)\n throw new Error(\"Delimiter should be a single character\");\n const buffer = await this.readSlice(delim.charCodeAt(0));\n if (buffer == Deno.EOF)\n return Deno.EOF;\n return new TextDeco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| | Webpack Server Config | | function webpackServerConfig() {
let config = webpackBaseConfig.call(this, 'server');
// env object defined in nuxt.config.js
let env = {};
_.each(this.options.env, (value, key) => {
env['process.env.' + key] = ['boolean', 'number'].indexOf(typeof value) !== -1 ? value : JSON.stringify(value);
});
con... | [
"prepareWebpackConfig() {\r\n this.clientConfig = createClientConfig(this.context).toConfig()\r\n this.serverConfig = createServerConfig(this.context).toConfig()\r\n\r\n const userConfig = this.context.siteConfig.configureWebpack\r\n if (userConfig) {\r\n this.clientConfig = a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the albums displayed within the album list to the albums contained in the specified feed. | function setAlbums(albumFeed) {
for (var i = 0; i < albumFeed.feed.entry.length; i++) {
renderAlbum(this, albumFeed.feed.entry[i]);
}
} | [
"function populateAlbums (albums, list) {\n\n\t\tfor (var album of albums) {\n\n\t\t\tvar albumTemplate = importTemplate('artist-album-template');\n\n\t\t\tvar albumName = albumTemplate.querySelector('.artist-album-name');\n\t\t\talbumName.textContent = album.name;\n\n\t\t\tvar viewAlbum = emitEvent('view-album', a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A Codec is one of the three Transformer kinds. Codecs are a pair of functions that serialize Types into bytes (or abritrary representations), and deserialize back. There MUST be no information loss in Codecs; they're simply representing a Type in different ways. E.g. json, unixtime, isodate They're like a Conversion, b... | function Codec(src, encode, decode) {
if (src instanceof Codec)
return src;
if (!(this instanceof Codec))
return new Codec(src, code, decode);
src = Object(src, codec_defaults);
this.src = src;
this.encode = encode || identity;
this.decode = decode || identity;
} | [
"encodeData(type, value) {\n return this.getEncoder(type)(value);\n }",
"function srs_publiser_get_codec(\n vcodec, acodec,\n sl_cameras, sl_microphones, sl_vcodec, sl_profile, sl_level, sl_gop, sl_size, sl_fps, sl_bitrate,\n sl_acodec\n) {\n acodec.codec = $(sl_acodec).val();\n aco... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the sum of the digits of a number. | function getSumOfDigits(num) {
var num = num;
sum = 0;
while (num) {
sum += num % 10;
num = Math.floor(num / 10);
}
return sum;
} | [
"function getDigitsSum(inputNumber) {\n inputNumber += '';\n let sumOfDigits = 0;\n const inputNumberLength = inputNumber.length;\n \n for (let index = 0; index < inputNumberLength; index += 1) {\n sumOfDigits += parseInt(inputNumber[index]);\n }\n \n return sumOfDigits;\n}",
"function digitalSum(n){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool InputInt3(const char label, int v[3], ImGuiInputTextFlags extra_flags = 0); | function InputInt3(label, v, extra_flags = 0) {
const _v = import_Vector3(v);
const ret = bind.InputInt3(label, _v, extra_flags);
export_Vector3(_v, v);
return ret;
} | [
"function InputInt(label, v, step = 1, step_fast = 100, extra_flags = 0) {\r\n const _v = import_Scalar(v);\r\n const ret = bind.InputInt(label, _v, step, step_fast, extra_flags);\r\n export_Scalar(_v, v);\r\n return ret;\r\n }",
"function InputInt2(label, v, extra_flags = 0) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if a survey cookie exists. Call optionally with a type. | function CookieUtilities_surveyCookieExists(cookieType)
{
var t = '';
if (cookieType) t = cookieType;
return (document.cookie.indexOf(SiteRecruit_Config.cookieName + '=' + t) != -1)
} | [
"function userHasConsented() {\n return typeof Cookies.get(\"cookieConsent\") !== \"undefined\";\n}",
"function cookieExists() {\n return typeof $.cookie(cookie) !== 'undefined';\n }",
"function cookieExists() {\n if (typeof $.cookie('accessToken') === 'undefined') {\n return false;\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders three lines of texts to indicate the study status. | function setStatusText(text1, text2, text3) {
svg.select(".studyStatusText1").text(text1);
svg.select(".studyStatusText2").text(text2);
svg.select(".studyStatusText3").text(text3);
} | [
"function changeStatus() {\n var text = \"Time Range Bar: <b>\" + boolToOnOff(mainfocus)\n + \"</b>, Time Range Filter: <b>\" + boolToOnOff(timeBarFilter)\n + \"</b>, Normalised: <b>\" + boolToOnOff(isMainNormalised)\n + \"</b>, Night Mode: <b>\" + boolToO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_readBaseIRI` reads the IRI of a base declaration | _readBaseIRI(token) {
const iri = token.type === 'IRI' && this._resolveIRI(token.value);
if (!iri)
return this._error('Expected valid IRI to follow base declaration', token);
this._setBase(iri);
return this._readDeclarationPunctuation;
} | [
"_readBaseIRI(token) {\n const iri = token.type === 'IRI' && this._resolveIRI(token.value);\n\n if (!iri) return this._error('Expected valid IRI to follow base declaration', token);\n\n this._setBase(iri);\n\n return this._readDeclarationPunctuation;\n }",
"_setBase(baseIRI) {\n if (!baseIRI) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and attach the MDC Foundation to the instance | createFoundation() {
if (this.mdcFoundation !== undefined) {
this.mdcFoundation.destroy();
}
if (this.mdcFoundationClass) {
this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter());
this.mdcFoundation.init();
}
} | [
"init(actor) {\n this.host = actor\n }",
"static init()\n {\n let aeFDC = Component.getElementsByClass(document, PCx86.APPCLASS, \"fdc\");\n for (let iFDC = 0; iFDC < aeFDC.length; iFDC++) {\n let eFDC = aeFDC[iFDC];\n let parmsFDC = Component.getComponentParms(eFDC);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
On main panel, show the user panel | function showUserPanel() {
lcSendValueAndCallbackHtmlAfterErrorCheckPreserveMessage("/user/index",
"#userDiv", "#userDiv", null);
} | [
"function openUserEditor(){\n\n\t$('.content-panel').hide();\n\n\t$('#editUserPanel').show();\n\n}",
"function showUser(){\n\t\t\tdocument.getElementById('user-div').style.display = 'block';\n\t\t\tdocument.getElementById('user-btn').style.backgroundColor = 'white';\n\t\t\tdocument.getElementById('user-btn').styl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert to a string from a charCode | function toStr(ch) {
return String.fromCharCode(ch);
} | [
"function string(c) /* (c : char) -> string */ {\n return _char_to_string(c);\n}",
"function getLetterFromCode(num){\n return String.fromCharCode(num+96);\n}",
"function getCodeFromLetter(str){\n return str.charCodeAt(0)-96;\n}",
"_aec(code) {\n return String.fromCharCode(27) + \"[\" + code;\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. Which of the top 20 horror movies have no spoken language besides English? | function filterSpokenLanguage(movieObject){
//console.log(movieObject)
let englishOnly = movieObject.filter(object => object.spoken_languages.length == 1 && object.spoken_languages[0].iso_639_1=="en")
.map(object => object.title)
console.log("3. Which of the top 20 horror movies have no spoken language besides ... | [
"relevance(that){cov_25grm4ggn6.f[9]++;let total=(cov_25grm4ggn6.s[47]++,0);let words=(cov_25grm4ggn6.s[48]++,Object.keys(this.count));cov_25grm4ggn6.s[49]++;words.forEach(w=>{cov_25grm4ggn6.f[10]++;cov_25grm4ggn6.s[50]++;total+=this.rank(w)*that.rank(w);});//return the average rank of my words in the other vocabul... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Params from Actions are: [Doc Link, Applicant, Attribute, Filename] | handleAddAttribute(params) {
this.applicant = params[1];
this.applicant[params[2]] = params[0];
this.applicant[`${params[2]}File`] = params[3];
} | [
"function AttachmentsAction({ files, onUpload, onDelete }) {\n return (\n <Fragment>\n <UploadAction onUpload={onUpload} />\n {files.map(file => (\n <FileAction key={file.id} onDelete={onDelete} file={file} />\n ))}\n </Fragment>\n );\n}",
"function copyDocuments(pFromCapId, pToCapId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' 'Title : cmdUpdateReceived_ClickCase5 'Function : 'Input : 'Output : 'Remark : ' | function cmdUpdateReceived_ClickCase5() {
console.log("cmdUpdateReceived_ClickCase5");
if (config.DefaultReceiveQty) {
if (config.skipReceiveQty) {
$scope.strparaPreScrapQty = 0;
//3 - actual receive qty WIP-td3_1
... | [
"function cmdUpdateReceived_ClickCase100() {\n console.log(\"cmdUpdateReceived_ClickCase100\");\n //fetch WO summary\n GenerateWOSummary();\n //fetch WO summary - scrap + unaccountable qty\n GenerateWOSummaryScrap();\n\n if (config.BypassExecutionSta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to trigger calculation of the last route | function reCalculateRoute(){
calculateRoute(lastRouteURL);
} | [
"function calcRoute() {\n\t// Prepare the API call\n\tvar start = start_location.geometry.location;\n\tvar end = end_location.geometry.location;\n\tvar request = {\n\t\torigin: start,\n\t\tdestination: end,\n\t\ttravelMode: 'DRIVING'\n\t};\n\n\t// Call Google Maps API\n\tdirectionsService.route(request, function (r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
allConfig returns a copy of the full config map. | function allConfig() {
const config = parseConfig();
return Object.assign({}, config);
} | [
"get rawConfig() {\n return this.conf || readOnly(this.defaults);\n }",
"static merge (config) {\n currentConfig = assign({}, currentConfig, config);\n }",
"getAllProjects() {\n return new Map(this.allWorkspaceProjects);\n }",
"function getConfigs() {\n\n // use embedded configurations if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show disclaimer text on click of disclaimer link | function showDisclaimer() {
window.alert("The maps used do not imply the expression of any opinion on the part of the International Federation of Red Cross and Red Crescent Societies or National Societies concerning the legal status of a territory or of its authorities.");
} | [
"get disclaimer() {\n\t\treturn this.__disclaimer;\n\t}",
"function displayWarning(text) {\n\tvar warning = document.getElementById(\"warning\");\n\t\n\tif(text) warning.style.display = \"block\";\n\telse warning.style.display = \"none\";\n\t\n\twarning.innerHTML = text;\n}",
"function showRemarksActivityAdmin(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a plot with the given stock symbol. | removePlot(symbol) {
if (this.data.hasOwnProperty(symbol)) {
this.g.select('.plot-line-' + symbol)
.remove();
this.g.selectAll('.price-point-' + symbol)
.remove();
// Finally, add the used color back, and remove symbol data
var co... | [
"removeStockFromChart(symbol) {\n for (let i = 0, n = this.stockChart.series.length; i < n; i++) {\n const series = this.stockChart.series[i];\n if (series.name === symbol) {\n this.stockChart.series[i].remove();\n return;\n }\n }\n }",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Expose the brightness API. | static availableAPI(builder) {
builder.state('brightness')
.type('percentage')
.description('The brightness of this light')
.done();
builder.event('brightness')
.type('percentage')
.description('The brightness of the light has changed')
.done();
builder.action('brightness')
.description('Ge... | [
"function Light_2(){\n this.brightness = 0;\n this['turnon'] = function turnon (){\n this.brightness += 1 ;\n }\n this['turnoff'] = function turnoff(){\n if(this.brightness > 0){\n this.brightness -= 1;\n }\n }\n this['toggle'] = function toggle(){\n this.brightness += 2 ;\n }\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This property stores the available streams, indexed by the content identifier, and contains the stream data, the video plugin and the player, for each content identifier. | get streams() {
return this._streams;
} | [
"getSystemStreamsList () {\n if (!SystemStreamsSerializer.systemStreamsList) {\n let systemStreams = [];\n let i;\n const streamKeys = Object.keys(this.systemStreamsSettings);\n\n for (i = 0; i < streamKeys.length; i++) {\n systemStreams.push({\n name: streamKeys[i],\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mousePressed() Checks if the player clicked on the target and if so tells them they won | function mousePressed() {
// Check if the mouse is in the x range of the target
if (mouseX > targetX - targetImage.width/2 && mouseX < targetX + targetImage.width/2) {
// Check if the mouse is also in the y range of the target
if (mouseY > targetY - targetImage.height/2 && mouseY < targetY + targetImage.hei... | [
"function mousePressed() {\n // Check if the mouse is in the x range of the target\n if (mouseX > targetX - targetImage.width/2 && mouseX < targetX + targetImage.width/2) {\n // Check if the mouse is also in the y range of the target\n if (mouseY > targetY - targetImage.height/2 && mouseY < targetY + target... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write hash entry data | function writeHashEntry(score, bestMove, depth, hashFlag) {
// init hash entry
var hashEntry = hashTable[(hashKey & 0x7fffffff) % hashEntries];
// adjust mating scores
if (score < -MATE_SCORE) score -= searchPly;
if (score > MATE_SCORE) score += searchPly;
// write hash entry data ... | [
"function writeToDoc(hash) {\n hash['url'] = discoverTrueUrl(hash);\n //currentUrl is now the correct URI\n var followedPost = UrlFetchApp.fetch(hash['url'], {'followRedirects': true, 'muteHttpExceptions': true});\n hash['dump'] = followedPost.getContentText();\n //companyName\tLink\trecipient\tsubmitted?\tEff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
8. Write a program that calculates a number of appearances of a given number in a given array. Inputs: a = [2, 4, 7, 8, 7, 7, 1], e = 7 Result: 3 | function appear(a){
var number = 0;
var e = 7;
for (var i = 0; i < a.length; i++){
if (e === a[i]){
number++;
}
}
return number;
} | [
"function numOfAppear(a, array) {\n var i;\n var n = 0;\n for (i = 0; i < array.length; i++) {\n if (array[i] == a) {\n n++;\n }\n }\n return n;\n}",
"function countOf(array, element) {\n var x = 0;\n for (var i = 0; i < array.length; i++) {\n if (array[i] == e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if move triggers win condition, so all of wLand is occupied by bg or all of bLand is occupied by wg | checkWin() {
if all bgWLand|| or wgBLand
} | [
"checkIfWin(){\n\t\tconst g = this.state.grid;\n\t\tvar hits = 0;\n\n\t\tfor(var i = 0; i < this.gridSize; i++) {\n\t\t\tfor(var j = 0; j < this.gridSize; j++) {\n\t\t\t\tif (g[i][j] === \"Hit\") {\n\t\t\t\t\thits++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(hits === this.maxNumberOfShips*2){\n\t\t\tvar theWinner = \"\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`lasso' creates a new lasso instance, based on the `overlay' svg dom element. In addition to collecting the points selected by the user it also performs a user specified action on the start and end of lassoing. The lasso only collects the selected region, and passes it to the user. The search for any data in the graphi... | function lasso(overlay, parentobj) {
_classCallCheck(this, lasso); // Declare the most important attributes. Note that the lasso does NOT find it's own selected data! The `selected' attribute is only a placeholder here to allow the user to store the results in it. This is to simplify the lasso code by moving the ... | [
"function addPlot(overlay, val, type){\n var gate = false;\n if(type == \"id\"){\n for(var i = 0; i < data.length;i++){\n var name = type + String(val);\n if(data[i].id == val){\n gate = true;\n overlay[name] = L.polygon(data[i].geometry.coordinates);\n overlay[name].bindPopup(\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete all file and dir expert root dir by dirPath | function rmDir(dirPath) {
var files = fs.readdirSync(dirPath);
if (files.length > 0) {
for (var i = 0; i < files.length; i++) {
var filePath = path.join(dirPath, files[i]);
if (fs.statSync(filePath).isFile()) {
fs.unlinkSync(filePath);
} else {
... | [
"function DeleteOutput (dir) {\n if(dir === \"\") {\n dir = dir_path;\n }\n\n if(fileExists (dir)) {\n var list = fs.readdirSync(dir);\n for(var i = 0; i < list.length; i++) {\n var filename = path.join(dir, list[i]);\n var stat = fs.statSync(filename);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets last selected hero state and passes the data to parent | onChangeHero(hero) {
this.setState({lastSelectedHero: hero, nameChange: false});
this.props.hero(hero);
} | [
"function SelectHero( heroName ) {\n\t//Send the pick to the server\n\tGameEvents.SendCustomGameEventToServer( \"SelectHero\", { HeroName: heroName} );\n\n}",
"opponentSelectionDone(opponent) {\n const trainingOpponentSelection = opponent.selection;\n\n this.setState({\n mode: Modes.ShipS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the provided `args` object satisfies the `LocalProgramArgs` interface. | function isLocalProgramArgs(args) {
return args.workDir !== undefined;
} | [
"function isInlineProgramArgs(args) {\n return args.projectName !== undefined && args.program !== undefined;\n}",
"canExecute(args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (args.length > 1) {\n\t\t\t\tthis.$errors.failWithoutHelp(\"This command accepts only one argument.\");\n\t\t\t}\n\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pre: array of usernames, and boolean stating if we are adding a user Post: null Purpose: takes a list of names and if we are adding them removes them from the offline list in view, if applicable, and adds them to the online list. For removing is is the same process but in the opposite direction | function modifyUsers(userlist, add) {
let newList;
let oldList;
if (add) {
oldList = document.getElementById('offline');
newList = document.getElementById('online');
} else {
oldList = document.getElementById('online');
newList = document.getElementById('offline');
}... | [
"function initUsers(userlist) {\n let online = document.getElementById('online');\n let offline = document.getElementById('offline');\n\n userlist.map(user => {\n let li = document.createElement('li');\n li.innerText = user.name;\n\n if (user.active) {\n online.appendChild(l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if `val` has leading zeros, or a similar valid pattern. | function hasZeros(val) {
return /[^.]\.|^-*0+[0-9]/.test(val);
} | [
"function hasAZero(num){\n return num.toString().split('').some(function(num){\n return num === '0';\n })\n}",
"function test (regex, numbers) {\n const append = '8888'\n const res = true\n const rex = new RegExp('^' + regex + '(.*)$')\n\n numbers.forEach(function (n) {\n n = n.replace(/x/g, '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function gets the run number and instrument name from the UI elements. In addition the date code is obtained from the run list file | function getRunInstrumentDateAndPlot(plotFunc,awareControl) {
var startRun=getStartRunFromForm();
var plotName=getPlotNameFromForm();
var instrumentName=getInstrumentNameFromForm();
var runListFile=getRunListName(instrumentName,startRun);
function handleRunList(jsonObject) {
var gotRun=0;
for(... | [
"onRunNameFocus (e) {\n if (typeof this.runOpts.runName !== typeof 'string' || (this.runOpts.runName || '') === '') {\n this.runOpts.runName = this.theModel.Model.Name + '_' + (this.isReadonlyWorksetCurrent ? this.worksetCurrent?.Name + '_' : '') + Mdf.dtToUnderscoreTimeStamp(new Date())\n }\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API not exist (404) | function not_found_handler(req, res, next) {
res.status(404);
res.json({
message: 'api not exist or wrong HTTP method'
})
} | [
"function fileNotFound(req, h){\n const response = req.response\n //Preguntamos que si la response es un mensaje de boom y si el codigo es 404\n if (!req.path.startsWith('/api') && response.isBoom && response.output.statusCode === 404) {\n //Retornamos la vista de la pagina que muestra el error 404 ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the playlist from uri in to list view | function loadPlaylistUri(uri)
{
if( ( uri != undefined || !uri ) && ( uri.split(":")[3] == "playlist" ) )
{
console.log("Appending " + uri );
$('#playlist-drop').hide();
$('#player-content').fadeIn();
thisPlaylist = models.Playlist.fromURI(uri);
var playlistArt = new views.Player();
playlistArt.track ... | [
"async loadPlaylists(url) {\n\t\tlet response = await utils.apiCall(url, this.props.access_token);\n\t\tthis.setState({ playlists: response.items, nplaylists: response.total, nextURL: response.next,\n\t\t\tprevURL: response.previous });\n\n\t\tplaylists.style.display = 'block';\n\t\tsubtitle.textContent = (response... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Xpath for Career 1st up | get horseProfile_Career_1stUp() {return browser.element("//android.view.ViewGroup[11]/android.view.ViewGroup/android.view.ViewGroup[9]/android.widget.TextView[1]");} | [
"get horseProfile_Career_3rdUp() {return browser.element(\"//android.view.ViewGroup[11]/android.view.ViewGroup/android.view.ViewGroup[11]/android.widget.TextView[1]\");}",
"get horseProfile_Career_2ndUp() {return browser.element(\"//android.view.ViewGroup[11]/android.view.ViewGroup/android.view.ViewGroup[10]/andr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |