query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Project Page File Listing | function ProjFileList() {
this._project = "";
this._team = null;
//allow for an auto refresh
this._timeout = null;
//how often to retry an auto update -- this only occurs if an update failed, in seconds
this._refresh_delay = 3;
//when was it 'born', milliseconds since epoch
this._birth = new Date().valueOf();
... | [
"function getProjList () { \n fs.readdir(__dirname + \"/lib/projectStructure/\", function (err,list) {\n if (err) {\n console.error(err);\n return;\n }\n console.log(\"Avilable Project Structures Are:-\");\n list.forEach(function (item) {\n console.log... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create array 60 bricks | function createBricks(){
let brickX = 2,brickY=10,j=0,a=0;
for(var i=0;i<60;i++){
let brick={
x: brickX,
y: brickY,
w: brickWidth,
h: 10,
color: colors[j]
}
bricks.push(brick);
brickX+=brickWidth+2;
if(brickX+brickWidt... | [
"function createBricksL2() {\n brick.rows = 6;\n for (r = 0; r <brick.rows; r++) {\n bricks[r]=[];\n for (c = 0; c < brick.columns; c++) {\n bricks[r][c]={\n x: c*brick.x + 70,\n y: r*brick.y + 20,\n unbroken:true\n };\n }\n }\n}",
"function generateBricks() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getProperties(dict) Returns properties (for `transitionproperty`) for dictionary `props`. The value of `props` is what you would expect in `jQuery.css(...)`. | function getProperties(props) {
var re = [];
jQuery.each(props, function(key) {
key = jQuery.camelCase(key); // Convert "text-align" => "textAlign"
key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;
key = uncamel(key); // Convert back to dasherized... | [
"function getProperties(props) {\r\n var re = [];\r\n\r\n jQuery.each(props, function(key) {\r\n key = jQuery.camelCase(key); // Convert \"text-align\" => \"textAlign\"\r\n key = jQuery.transit.propertyMap[key] || jQuery.cssProps[key] || key;\r\n key = uncamel(key); // Convert back to dasherize... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compile pug files into HTML | function pugHtml() {
return src('src/pug/pages/*.pug')
.pipe(
pug({
pretty: true,
})
)
.pipe(dest('dist'));
} | [
"function pugToHtml() {\n return src('src/pug/*.pug')\n .pipe(pug({\n pretty: true\n }))\n .pipe(dest('dist/'));\n}",
"function pugToHtml() {\n return src('src/pug/*.pug')\n .pipe(pug({pretty: true}))\n .pipe(dest('dist/'));\n}",
"function html() {\n return s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
var fatcat_sprite_sheet; var hitcat_sprite_sheet; var fatcat_animation; var hitcat_animation; | function preload() {
//fatcat_sprite_sheet = loadSpriteSheet('images/fatcat.png', 123, 112, 8);
//hitcat_sprite_sheet = loadSpriteSheet('images/hitcat.png', 124, 116, 10);
fatcat = loadImage("images/fatcat.png");
hitcat = loadImage("images/hitcat.png");
yarn = loadImage("images/yarn.png");
} | [
"function story_spritesheets(){\n\t//2_baker\n\tspritesheets['measurecup'] = new createjs.SpriteSheet({\n\t\t\"frames\": [[0, 0, 256, 128, 0, 256, 0], [256, 0, 256, 128, 0, 256, 0], [0, 128, 256, 128, 0, 256, 0], [256, 128, 256, 128, 0, 256, 0], [0, 256, 256, 128, 0, 256, 0], [256, 256, 256, 128, 0, 256, 0]], \n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function:checkInNotification() Description: function is used to show checkin Form of perticular flight with its flight number. Author: Kony | function checkInNotification(flightNo) {
var allFlightsData = kony.store.getItem("AllFlightsData");
if (allFlightsData != null) {
allFlights = allFlightsData["flightdetails"];
for (var i = 0; i < allFlights.length; i++) {
var com = "completed";
var update = "true";
... | [
"function sendCheckinReminderMessage(sender, token) {\n\tlet intro_message = \"Check-in is available now.\"\n\tlet message = {\n\t\t\"attachment\": {\n\t\t\t\"type\": \"template\",\n\t\t\t\"payload\": {\n\t\t\t\t\"template_type\": \"airline_checkin\",\n\t\t\t\t\"intro_message\": intro_message,\n\t\t\t\t\"locale\": ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trims all whitespaces from lines include blank lines and returns result as separate lines | function trim_lines(lines) {
if (lines == null) return lines;
var result = '';
temp = lines.split('\n');
for (var i = 0; i < temp.length; i++) {
line = temp[i].replace(/\s+/g,' ').trim();
if (line.length > 0) {
result += (i == temp.length - 1) ? line : line + '\n';
... | [
"function stripBlankLines(text) {\n return text.split(EOL).filter(line => line.trim() !== '').join(EOL);\n}",
"function trim_lines(lines) {\r\n var result = '';\r\n // Use a regex to split the String literal by all whitespace (i.e. spaces/newlines/tabs). \r\n var temp = lines.split(/\\s+/g);\r\n for (var i =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resets all of the y gate coordinates and set a new random fall rate to each gate. | function resetGates(gate){
if(gate == 1){
changeGate(1);
gate1.rate = Math.floor((Math.random() * 4) +1);
while(gate1.rate == gate2.rate || gate1.rate == gate3.rate){
gate1.rate = Math.floor((Math.random() * 4) +1);
}
gate1.y = -200;
}
else if(gate == 2){... | [
"resetSpawnRate() {\n this.spawnTimer = 0;\n this.spawnDelay = GageLib.math.getRandom(\n this.spawnRate[0],\n this.spawnRate[1]\n );\n }",
"reset(){\n let yPathIndex = Math.floor(Math.random() * Math.floor(3));\n this.x = -90;\n this.y = Y_POSITIONS[yPathIndex];\n this.randomSpeed(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create stack of consumer components | function stackConsumers(retFn) {
const values = [];
let fn = () => retFn(values);
for (let i = 0; i < contexts.length; i++) {
const Context = contexts[i];
const childFn = fn;
fn = () => (
<Context.Consumer>
{(value) => {
values[i] = value;
return childFn();
... | [
"function stack() {\n return composeSubcomponents(component.config.subcomponents);\n }",
"compose() {\n if(this.props.createContainer) {\n this.composeWith(`${_consts.GENERATOR_NAME}:${_consts.SUB_GEN_CONTAINER}`, {\n containerName: this.props.componentName\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a camper by ID | async function removeCamperByID(id) {
try {
const response = await axios.delete('http://localhost:3013/rest/camper/id/' + id);
return response.data;
}catch (err) {
console.log("Can not connect to server.");
console.log(err);
}
} | [
"function remove(id) {\n return db('prayers').where({ id }).del();\n}",
"function remove(id) {\n return db('people').where({ id }).del();\n}",
"function remove(_id){\n fhir.delete({type: \"Patient\",id: _id})\n .then((res) => {\n //Implemente su función aqui\n console.log(res)\n // INIC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Entry point for down synchronization (download changes) | function syncDown(callback) {
providerList = _.values(providerMap);
providerDown(callback);
} | [
"function download() {\n 'use strict';\n if (downloadList.length === 0) {\n //doDeckScan();\n updateCardId();\n uploadcover();\n screenMessage.html('<span style=\"color:white; font-weight:bold\">Update Complete! System Messages will appear here.</span>');\n\n return;\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns Message of cars Powering On or Off depending of Parameter ages | function checkDriveAges(ages){
if(ages === 18){
return "Congratulation in your first year of driving. Enjoy de Ride";
} else if(ages > 18){
return "Powering On. Enjoy your Ride";
}else{
return "Sorry!. You are too young to drive this car. Powering off";
}
} | [
"function checkDriverAge(age) {\n if (Number(age) < 18) {\n alert(\"Sorry, you are too young to drive this car. Powering off\");\n } else if (Number(age) > 18) {\n alert(\"Powering On. Enjoy the ride!\");\n } else if (Number(age) === 18) {\n alert(\"Congratulations on your first year of driving. Enjoy t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render processed data into comparative histogram and associated stats. The renderData() function is designed to take in the data after it has been processed render (draw) the comparative histogram and the associated percentages. | function renderData(container, processed_data) {
// Different Container Div States and how to function in each state.
//
// 1. Neither height nor width is specified for the containing dv.
//
// In this state the widget should be defined by the sum of all its
// children. Hence, intell... | [
"render (data) {\n this.data = data\n this.renderAxis(data)\n this.renderBars(data)\n }",
"function renderVis(data){\n data_all = init_data(data);\n console.log(data_all);\n tableCreate(data_all);\n}",
"function calculateClosedPercentage(x){\n console.log('here is allData in calc function'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private function that evaluates a precondition Used to see if an action can be traversed to ARGUMENTS: precondition(Precondition) the precondition to be evaluated RETURN bool is the precondition true | function evaluatePrecondition(precondition){
//find the character for that characteristic
var char = that.characterDB.getCharacter(precondition.characterName);
var characteristics = char.characteristics;
//Get the characteristic
var characteristic = char.characteristics[precondition.cls][preconditio... | [
"function validatePrecondition(arg, value, allowExists) {\n if (typeof value !== 'object' || value === null) {\n throw new Error('Input is not an object.');\n }\n const precondition = value;\n let conditions = 0;\n if (precondition.exists !== undefined) {\n ++conditions;\n if (!a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience function to get forum data and discussions. | function fetchForumDataAndDiscussions(refresh) {
return $mmaModForum.getForum(courseid, module.id).then(function(forumdata) {
forum = forumdata;
$scope.title = forum.name || $scope.title;
$scope.description = forum.intro || $scope.description;
$scope.forum = foru... | [
"getForum() {\n return Request.get({\n url: URLS.FORUM,\n includes: [\n RequestIncludes.USERS,\n ],\n });\n }",
"async function getForumStructure() {\n const manForumPageUrl = `${forumParams.url}adm/index.php?sid=${acpSessionId}&i=acp_forums&icat=6... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
give visual feedback for drag action | drag_feedback(){
this.dragging = true;
} | [
"function drag(){\n console.log(\"Being dragged around\");\n}",
"function mouseDragged() {}",
"onMouseDrag(e){}",
"mouseDrag(prev, pt) {}",
"dragleave_feedback(){\r\n this.dragging = false;\r\n }",
"startDrag(x, y) {}",
"showDragFeedback(dragDescriptor) {\n if (this.editor && this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add an item to the cache | addItem(key: string, value: any) {
const stringValue = isString(value) ? value : JSON.stringify(value);
this._cache.setItem(key, stringValue);
} | [
"function addItemToCache(key,item) {\n if (key in cache && cache[key] && cache[key].length) {\n cache[key].push(item);\n } else {\n cache[key] = item;\n }\n}",
"add(key,value){\r\n this.updatePosition(key);\r\n this.cache.set(key,value);\r\n this.count++; \r\n }",
"addItem(key: string, valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
transfer finalized contact from the component store to the main store | addContact () {
store.addContact(this.store.newContact)
this.store.newContact = { name: '', email: '' }
} | [
"function saveNewContact(contact){\r\n store.push(contact);\r\n}",
"save(contact) {\n this.Contacts.save(contact)\n .then(() => this.canExit = true)\n .then(() => {\n this.$state.go(\"^\");\n });\n }",
"function onSaveSuccess(contact) {\n\t//\tONCE THE CANTACT IS SAVED TO THE PIM \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the capital expenses for the current turn | function calcCAPEX() {
var expenses = 0.0;
var current;
for (var i=0; i<agileModel.SITES.length; i++) {
for (var j=0; j<agileModel.SITES[i].siteBuild.length; j++) {
current = agileModel.SITES[i].siteBuild[j];
if (!current.capEx_Logged) { // Ensures capital cost for build is only counted once
... | [
"getExpenses () {\n\t\treturn this.expenses;\n\t}",
"returnExpenses() { return this.expenses; }",
"getImovelInvestPerc() {\n if (this.ImovelInvestPerc) {\n return this.ImovelInvestPerc;\n }\n return 0;\n }",
"function getExpenses(evt){\n\tlet choice = this.value;\n\tlet earnings = Number($(\"#e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get direct parent path for key ex)parent: "parent",childkey: ":a/b/c"=> parent:a/b parent: null,childkey: ":a/b/c"=> :a/b parent: "parent",childkey: ":a"=> parent parent: "parent",childkey: ""=> null | function rawGetParentKey(parent, childkey, separator, allow_empty)
{
if(!rawIsSafeString(childkey)){
return null;
}
var child_hierarchy_arr = rawExpandHierarchyArray(parent, childkey, separator, allow_empty);
if(null === child_hierarchy_arr || !(child_hierarchy_arr instanceof Array) || 0 === child_hierarchy_arr.l... | [
"function keyParent(mkey) {\n var path = keyToPath(mkey)\n , pathLen = path.length\n return pathLen === 1 ? null : path[pathLen - 2]\n}",
"_parentKey(key){\n return key\n .split(\".\")\n .reduce((parentKey, subKey, idx, arr) =>\n parentKey + ((idx !== arr.length -1) ?`.${subKey... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes the position state based on the specified origin position. This is used if the tab is becoming visible immediately after creation. | _computePositionFromOrigin(origin) {
const dir = this._getLayoutDirection();
if ((dir == 'ltr' && origin <= 0) || (dir == 'rtl' && origin > 0)) {
return 'left-origin-center';
}
return 'right-origin-center';
} | [
"getPosition(absState) {\n return absState % (this._w + 1);\n }",
"getPosition(originX = 0.5, originY = 0.5) {\n const x = originX * this.card.displayWidth - this.card.displayWidth / 2;\n const y = originY * this.card.displayHeight - this.card.displayHeight / 2;\n const p = this.container.local... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Applies the Resource Rarity Strategy | function calculateResourceRarity() {
for (i = 0; i < positions.length; i++) {
var sum = 0;
for (x = 0; x < positions[i].tiles.length; x++) {
sum += positions[i].tiles[x].dotRarity
}
positions[i].resourceRarityScore = sum
}
} | [
"function assignRarity() {\n console.log(\"Assigning Rarity Scores... Please Wait\");\n attributesCombinations.forEach(combo => {\n let set = new Set(combo);\n let diff = combo.length - set.size;\n let index = attributesCombinations.indexOf(combo);\n combo.push({\"trait_type\": \"rarity\", \"value\": ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates chart that shows both WOW variables | function drawWowChart(distance, air_temperature, datetimes, rainfall) {
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'datetime');
data.addColumn('number', 'air_temp');
data.addColumn('number', 'rainfall');
for (i = air_temperature.length - 1; i >= 0; i--) {
var... | [
"function setup_weekly_chart(json_data) {\n var weekly_data = json_data[\"data\"];\n var weekly_weather = [[\"Date\", \"Temperature High\", \"Temperature Low\"]];\n var weekly_rain = [[\"Date\", \"Chance of Precipitation\",\n \"Inches of Precipitation\", \"Max Inches of Precipitation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If specified row has a Read Closed Message button, schedule a task to fetch the closed reason and hook the button to pop up the reason when hovered over. | function initClosedReason(row) {
var link = getClosedReasonButtonForRow(row);
if (!link) return;
//var _self = this; // note this function can be called from within a loop
link.onmouseover = function(evt){showClosedReasonPopup(evt, row, true)};
link.onmouseout = function(evt){showClosedReasonPopup(evt,... | [
"function taskRowCallback(row) {\n popups.forEach(popup => {\n popup.classList.remove(\"popup\");\n popup.classList.add(\"hidden\");\n });\n addRefreshState = 1;\n clickedRow = row;\n addRefreshButton.innerHTML = \"Refresh task\";\n deleteTaskButton.classList.remove(\"hidden\");\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
declare function that locks a color to a word | function lockColor (className){
// console.log('locking color to', className);
// check if word is locked, if locked -> unlock, UNLESS MAINSWITCH IS TRUE
if (selectedClasses.includes(className)){
// find position of word in lockedWords and unlock the word & color
for (let i = 0; i < selec... | [
"function randColor() {\n\n // Set random word\n\n\n // Set random word color\n\n\n }",
"function colorChanger(color){\n\n mouse.color = color;\n hold.style.background = color;\n\n\n\n\n}",
"function changeRed(n){\r\n domMod[n] = \"\";\r\n for(var a =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Document per day (dpd) | function DocumentPerDay() {
this.preload = function() {
this.db = db.getSisterDB("labs_cpu").dpd
};
this.init = function() {
this.db.drop()
this.db.ensureIndex({'server' : 1, 'day' : 1})
};
this.store = function( server_name, cpu_measurement, timestamp ) {
var ts... | [
"function DocumentPerDay() { \n\n this.store = function( server_name, cpu_measurement, timestamp ) { \n // implement the mongodb method to store a sample\n\tvar date = new Date(timestamp);\n\tvar hour_for_date = date.getHours().toString();\n\t\n\tdate.setHours(0);\n date.setMinutes(0);\n dat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse a viewBox definition: x, y, width, height. | function parseViewBox(value) {
var viewBox = value.split(/[, ]+/);
for (var i = 0; i < viewBox.length; i++) {
viewBox[i] = parseFloat(viewBox[i]);
if (isNaN(viewBox[i])) {
viewBox[i] = 0;
}
}
while (viewBox.length < 4) {
viewBox.push(0);
}
return viewBox;
} | [
"function parseViewBox(value) {\n\tvar viewBox = value.split(/[, ]+/);\n\tfor (var i = 0; i < viewBox.length; i++) {\n\t\tviewBox[i] = parseFloat(viewBox[i]);\n\t\tif (isNaN(viewBox[i])) {\n\t\t\tviewBox[i] = 0;\n\t\t}\n\t}\n\twhile (viewBox.length < 4) {\n\t\tviewBox.push(0);\n\t}\n\treturn viewBox;\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cache buster puts a cache avoidance param on a url with a random number invoke with: cdc_cache_bust(' = YourUrl?cacheReset=rand cdc_cache_bust(' = YourUrl?foo=rand cdc_cache_bust(' = YourUrl&cacheReset=rand cdc_cache_bust(' = YourUrl&cacheReset=rand | function cdc_cache_bust (url,param){
if (!param) {param = 'cacheReset'};
var delim = "?";
// if url is ng-prod1(bam) or has ?, set param delimeter to &
if (url.match(/(ng-prod1|\?)/)) {delim = "&"};
var fullParam = delim+param+'=';
// degug alert(url+fullParam+cdc_rand_num());
return url+fullParam+cdc_... | [
"function generateCachebust() {\n return `?cb=${CACHEBUST}`;\n}",
"function cacheBuster () {\n return \"?v=\" + Math.random();\n }",
"function cachebust()\n{\n\tvar base64set = \"+-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\tvar str = \"?v=\";\n\t\n\tfor (var i = 0; i < 12; i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getMapsApiKey Get the maps api key from the database | getMapsApiKey() {
return new Promise(function (resolve, reject) {
firebase.database().ref("/globals/hkey/").once('value').then(function (dataSnapshot) {
resolve(dataSnapshot.val());
}).catch(error => {
console.log(error);
reject(error);
});
});
... | [
"function getMapBoxAPIKey() {\n \n var mapboxAPIKey = \"\";\n\n mapboxAPIKey = C_MAPBOX_API_KEY;\n \n // Later = Replace API key fetch from DB \n // mapboxAPIKey = d3.request(apiUrlMapboxKey).get({retrun});\n\n return mapboxAPIKey;\n\n}",
"async function getMapKey() {\n const responseFromServer = await ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Work to get billing information when we get the id of the selected person name | function getBillInformationByMemberId(memberId) {
var proPublicaBillsByMembers = `https://api.propublica.org/congress/v1/members/${memberId}/bills/introduced.json`;
$.ajax({
url: proPublicaBillsByMembers,
method: "GET",
dataType: 'json',
headers: {
... | [
"function showBillingInfo(event) {\n \n const selectedBill = $(event.target).attr(\"data-billingid\");\n console.log(selectedBill);\n const selectedBillInfo = allUserBillInfo.filter(user => user.id === selectedBill)[0];\n console.log(selectedBillInfo)\n $(\".modal-bills\").... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the user is used to 12 hour time. | usesTwelveHourTime() {
return (
_.endsWith(new Date().toLocaleString(), 'AM') ||
_.endsWith(new Date().toLocaleString(), 'PM')
)
} | [
"get is12Hour() {\n var hourFormat= this.config.time_format ? this.config.time_format : 12\n switch (hourFormat) {\n case 24:\n return false;\n default:\n return true;\n }\n}",
"function is24HourTime() {\n const date = new Date();\n const localeString = date\n .toLocaleTimeString(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ParticleUtility node for calling basic utility functions via the Particle JS API | function ParticleUtility(n) {
// note: code in here runs whenever flow is re-deployed.
// the node-RED 'n' object refers to a node's instance configuration and so is unique between ParticleSSE nodes
var that = this;
RED.nodes.createNode(this, n);
// Get all properties from node instance settings
this.pcl... | [
"function ParticleUtils() {}",
"function Particle() {\n}",
"function createParticleElements(){\n\n }",
"function ParticleFunc(n) {\n\t\t// note: code in here runs whenever flow is re-deployed.\n\t\t// the node-RED 'n' object refers to a node's instance configuration and so is unique between ParticleFunc node... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the next arc in a dissolved polygon ring | function getNextArc(obj, depth) {
var next = getNextSegment(obj, segments, shapes),
match;
depth = depth || 0;
if (next != obj) {
match = findDissolveArc(next);
if (match) {
if (depth > 100) {
error ('deep recursion -- unhandled topology problem');
... | [
"function getNextArc(obj, depth) {\nvar next = getNextSegment(obj, segments, shapes),\n match;\ndepth = depth || 0;\nif (next != obj) {\n match = findDissolveArc(next);\n if (match) {\n if (depth > 100) {\n error ('[dissolve] deep recursion -- unhandled topology problem');\n }\n // if (match.part... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
list of stack indices of stacks considered "acro lines" / Constructors for FloorRoutine, FloorStack, FloorSkill | function FloorRoutine() {
this.stacks = []; // array of FloorStacks
this.all = []; // array of skills
} | [
"function StacksInSingleArray(){\n this.stacksTopIndex = [0,0,0];\n this.data = [];\n}",
"initStacks() {\n this.stacks = {\n \"opaque\": {\n length: 0,\n programs: [],\n order: [],\n },\n \"transparent\": {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating 3 cards in the 3nd column | function colThree(){
randText();
for(var j = 0; j<3; j ++){
newCardThree(ren[j]);
}
} | [
"function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card');\n cards.innerHTML = `<div class='back'>${imgList[i]}</div>\n <div class='front'><i class=\"fa fa-line-chart\" style=\"font-size:2em;color:#ffff... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents a single network in the hierarchy. |force| If true, sets a pref on this object. This makes sure the object is "known" next time we load up (since we look for any prefs). |show| If true, the object still exists even if the magic pref is not set. Thus, allows an object to exist without any prefs set. | function PrefNetwork(parent, name, force, show)
{
if (":" + name in parent.networks)
return parent.networks[":" + name];
this.parent = parent;
this.unicodeName = name;
this.viewName = name;
this.canonicalName = name;
this.collectionKey = ":" + name;
this.encodedName = name;
... | [
"getNetworkObject() {\n return new Network(this.getNetwork());\n }",
"function showNodeNetwork(node, show) {\n\n var pathElems = node.pathElems;\n var paths = node.paths;\n var nbrElems = node.nbrElems;\n var nbrLabelElems = node.nbrLabelElems;\n var nbrThumbElems = n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method used to update/set up discord hooks | setDiscordHook() {
const hooks = this.get('discordHooks') || {};
discordReports.setHooks(hooks);
} | [
"async setup() {\n this.hooks = await this.github.genHooks();\n this.is_setup = true;\n }",
"bindHooks() {\n //\n }",
"function updateHooks() {\n Object.keys(require.extensions).forEach(function (ext) {\n var fn = require.extensions[ext];\n if (typeof fn === 'function' &&... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CPU current speed in GHz | function getCpuCurrentSpeedSync() {
let cpus = os.cpus();
let minFreq = 999999999;
let maxFreq = 0;
let avgFreq = 0;
if (cpus.length) {
for (let i in cpus) {
if (cpus.hasOwnProperty(i)) {
avgFreq = avgFreq + cpus[i].speed;
if (cpus[i].speed > maxFreq) maxFreq = cpus[i].speed;
... | [
"function getCpuCurrentSpeedSync() {\n\tvar output = \"\";\n\tvar result = \"0.00\";\n\tif (fs.existsSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\")) {\n\t\toutput = fs.readFileSync(\"/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq\").toString();\n\t} else if (fs.existsSync(\"/sys/devices/syst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens vertical menu area by adding 'active' class on that element | function openVerticalArea() {
verticalMenuObject.addClass('active');
if(verticalLogo.length) {
verticalLogo.addClass('active');
}
scrollPosition = $(window).scrollTop();
} | [
"function openVerticalArea() {\n verticalMenuObject.addClass('active');\n\n if(verticalLogo.length) {\n verticalLogo.addClass('active');\n }\n scrollPosition = $(window).scrollTop();\n }",
"function menuActive() {\n v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws all the text, including the tweet | function drawText(canvas, context, textSize) {
context.fillStyle = fgColor.value;
context.font = "bold 1em sans-serif";
context.textAlign = "left";
context.fillText("I saw this tweet", 20, 40);
// draw the tweet!
var tweet = tweets.options[tweets.selectedIndex].value;
context.font = "italic " + textSize + "px ... | [
"function drawText(canvas, context) {\n\t//var selectObj = document.getElementById(\"foregroundColor\");\n\tvar index = document.getElementById(\"foregroundColor\").selectedIndex;\n\tCOLORTXT = document.getElementById(\"foregroundColor\").value;\n\n\tcontext.fillStyle = COLORTXT;\n\tFONTSIZE = document.getElementBy... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load the specified type from the given assembly. The "preserve" argument provides control over clearing the constructor arguments after object creating | function LoadTypeWithParams(assemblyPath, classType, preserve)
{
try
{
return _builder.LoadTypeWithParams(assemblyPath, classType, preserve);
}
catch(e)
{
return null;
}
} | [
"set loadType(value) {}",
"function loadClass(loader) {\n const instCls = loader.subject, scriptInst = create(instCls._);\n const metacls = instCls.$, scriptMeta = create(protoTable);\n // non-enumerable script keywords remain visible\n lockProperty(scriptInst, '$', instCls);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to get alpha from a RGB(A) string | function getAlpha(rgba) {
rgba = rgba.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i);
return (rgba && rgba.length === 6) ? rgba[4] : '1';
} | [
"function acp_get_alpha_value_from_color( value ) {\n\tvar alphaVal;\n\n\t// Remove all spaces from the passed in value to help our RGBa regex.\n\tvalue = value.replace( / /g, '' );\n\n\tif ( value.match( /rgba\\(\\d+\\,\\d+\\,\\d+\\,([^\\)]+)\\)/ ) ) {\n\t\talphaVal = parseFloat( value.match( /rgba\\(\\d+\\,\\d+\\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
playWithCurrentPet will reduce the currentPet's boredom by 1 every time it is called. It is attached to a button that will call it whenever it is clicked. | playWithCurrentPet() {
if(this.currentPet.boredom > 1) {
this.currentPet.boredom -= 1;
if(this.currentPet.age < 2){
$('.petAlive').hide()
$('.petPlay').append($petPlayImage).velocity("fadeOut", {
duration: 1500
})
setTimeout(function (){
game.fadeInPetAlive()
duration: 2100
}... | [
"feedCurrentPet() {\n\t\tif(this.currentPet.hunger > 1){\n\t\tthis.currentPet.hunger -= 1;\n\t\tif (this.currentPet.age < 2) {\n\t\t\t$('.petAlive').hide()\n\t\t\t$('.petEat').append($petEatImage).velocity(\"fadeOut\", {\n\t\t\t\tduration: 1000\n\t\t\t})\n\t\t\tsetTimeout(function () {\n\t\t\t\tgame.fadeInPetAlive(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return data uri mime type. | function mime(uri) {
return uri.split(';')[0].slice(5);
} | [
"function dataUrl(mimetype, string) { return \"data:\"+mimetype+\";base64,\"+base64(string); }",
"function dataUrl(mimetype, string) {\n return \"data:\"+mimetype+\";base64,\"+base64(string);\n}",
"getMimeType() {\n\t\treturn this.mime;\n\t}",
"function mime(uri) {\n return uri.split(';')[0].slice(5);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if `lexeme` is illegal according to `mode`. | function isIllegal(lexeme, mode) {
return !ignore && test(mode.illegalRe, lexeme);
} | [
"function isIllegal(lexeme, mode) {\n return !ignore && test(mode.illegalRe, lexeme)\n }",
"function isValid(lexeme) {\n for (var key in Token.Kind) {\n var kind = Token.Kind[key];\n if (lexeme.match(kind.pattern)) {\n return true;\n }\n }\n return false;\n}",
"check... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stop video and stop updating videoprogress | function stopVideo() {
player.stopVideo();
clearInterval(videoProgress);
} | [
"function stopVideo() {}",
"function stopVideo() {\n videoAtika1.stopVideo();\n videoAtika2.stopVideo();\n videoAtika3.stopVideo();\n videoAtika4.stopVideo();\n }",
"function stopVideo() {\n\tplayer.stopVideo();\n}",
"function stopVideo() {\n video.pause();\n video.current... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the widths of isotope thumbnails, depending on the current screen size | function getThumbWidth() {
var windowWidth = $(window).width();
if(windowWidth <= 400) {
return Math.floor($portfolioContainer.width());
}
else if(windowWidth <= 855) {
return Math.floor($portfolioContainer.width() / 2);
}
else if(windowWidth <= 1280) {
return Math.floor($portfolioCont... | [
"function captureWidths() {\n for (var k = 0; k < noOfPix; k++) {\n var item = $photos[k];\n capWidth[k] = $(item).width() + 'px';\n }\n return;\n}",
"function getResponsiveWidth() {\n return obj.width() / numberOfVisibleSlides;\n }",
"function blogIsotopeWrapper... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the number of seconds left until a date stored in a GM value | function timeLeftGM(GMvalue) {
var timeToCompare = getGMTime(GMvalue);
var d = new Date();
d.setMilliseconds(0);
return Math.max(timeToCompare-(d.getTime()/1000), 0);
} | [
"function timeLeftGM(GMvalue){\n var timeToCompare = getGMTime(GMvalue);\n var d = new Date();\n d.setMilliseconds(0);\n return Math.max(timeToCompare-(d.getTime()/1000), 0);\n}",
"function timeLeftGM(GMvalue) {\r\n var timeToCompare = getGMTime(GMvalue);\r\n\r\n var d = new Date();\r\n d.setMilliseconds(0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================= Noinit_Spriteset_Battle extension Used to get battleback names dynamically but without instantiating load ============================================================================= | function Noinit_Spriteset_Battle() {this.initialize.apply(this, arguments);} | [
"function Spriteset_BattleLMBS() {\n this.initialize.apply(this, arguments);\n}",
"function PBSpritesetBattle() {\n this.initialize.apply(this, arguments);\n}",
"loadBeaches () {\n let grass = this.game.make.sprite(0, 0, 'grass')\n for (var i = 0; i < 16; i++) {\n let bin = (i >>> 0).toString(2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This creates the CSV report | function createReport(people, startTime, endtime, fileName) {
var rows = [];
console.log(endtime);
rows.push(["Name", "Id Number", "Category", "Date", "Start Time", "End Time"]);
endtime = new Date(endtime);
endtime = endtime.getTime();
console.log(endtime);
for (var id in people) {
... | [
"function spCSVReportGeneration() {\n spCommonReportCreating('client_csv_report_genrating.py', 'UBR_CSV_Report.csv');\n}",
"function spCSVReportGeneration(){\n\tspCommonReportCreating('client_csv_report_genrating.py','UBR_CSV_Report.csv');\n}",
"function genPrjIssueReportCSV() {\n var prjName = this.para... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the slider is moved to change the year, move the circles | function moveCircles() {
newYear = yearSlider.value;
d3.select("svg").selectAll(".datapoint")
.transition()
.duration(duration)
.attr("transform",function(d){
if(d.data.cpw && d.data.ipp){
if (d.data.cpw[newYear] != undefined){var cp... | [
"function initYearSlider() {\n\n // Continually update the label...\n $(\"#year-slider\").slider().on('change', function (event) {\n if (event.value != $(\"#year-value\").text()) {\n $(\"#year-value\").text(event.value);\n index.update();\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the UI to indicate whether the API is supported. | function isSupported(kind) {
console.log('supported', kind);
const divNotSupported = document.getElementById('notSupported');
divNotSupported.classList.toggle('hidden', true);
butSet.removeAttribute('disabled');
butClear.removeAttribute('disabled');
badgeVal.removeAttribute('disabled');
} | [
"function updateUI() {\n if (isRecorderReady && isRecognizerReady) {\n updateStatus('Can start');\n }\n ;\n }",
"function showNotSupportedMsg() {\n updateTool($not_supported_text);\n }",
"_updateOkButtonStatus() {\n\t\tif (this._psychoJS.config.environment === PsychoJS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clear login user token cookies | clearTokenCookies() {
this.cookies.set('token', null);
} | [
"function deleteUserToken() {\n setCookie('token', '', 0);\n}",
"function logout() {\n console.log(\"[INFO] Logging out user. Clearing session.\");\n\n localStorage.setItem(\"user_token\", null);\n Cookies.remove('user_token');\n\n location.reload();\n}",
"function logout() {\n token = null;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a flag from the array of placed flags | function removeFromFlagArray(square) {
const index = placedFlags.indexOf(square);
const temp = placedFlags[placedFlags.length - 1];
placedFlags[placedFlags.length - 1] = placedFlags[index];
placedFlags[index] = temp;
placedFlags.pop();
numPlacedFlags--;
} | [
"clearFlags() {\n for (let i = 0; i < Defines.NUMFLAGS; i++) {\n this.flags[i] = false;\n }\n }",
"function clearFlag(flag) {\n flagstore[flag]=0\n}",
"function remove(item, array) {\n var i = array.indexOf(item)\n if (~i) array.splice(i, 1)\n}",
"removeFlags(substr) {\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets validation error messages visibility | setErrorMessageVisibility(visible) {
this.rootSectionReflection.setErrorMessageVisibility(visible);
} | [
"setValidationText() {\n //TODO: When reactive initial field changes is ok, update here for this\n const element = this._messageElement;\n const errorKeys = Object.keys(this.validationErrors);\n if ((errorKeys.length > 0) && this.showErrorMessage) {\n element.style.display = \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the instances to the given array. Used as a callback for after data retrieval has been successfully completed. | function setInstances(newInstances) {
this.instances = newInstances;
} | [
"mapToInstanceSet(callback) {\n return new InstanceSet(this.classModel, [...this].map(callback));\n }",
"function SetCustomMultiArray () {\n\troids= new GameObject [roidsCount];\n}",
"set bannedInstances(newValue) {\n this.load();\n this.__data.banned_instances = newValue || [];\n }",
"sync()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the current git commit. | getCurrentCommit() {
return new Promise((resolve, reject) => {
child_process_1.exec("git rev-list --no-merges --abbrev-commit -n 1 HEAD", (error, stdout, stderr) => {
const failed = error || stderr !== "";
resolve(failed ? "HEAD" : filename_utils_1.trimLineEnding(stdo... | [
"async function getCurrentCommit( ctx ) {\n const { repoPath, branch } = ctx;\n const { id } = await Git.readCurrentCommit( repoPath, branch );\n return id;\n }",
"function getCurrentCommitSha() {\n return spawnSync('git', ['rev-parse', 'HEAD']).stdout.toString().trim();\n}",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return number of digitized monsters encountered since it was last cast | function getDigitizeMonsterCount() {
return (0, _property.get)("_sourceTerminalDigitizeMonsterCount");
} | [
"function getDigitizeMonsterCount() {\n return property_1.get(\"_sourceTerminalDigitizeMonsterCount\");\n}",
"function getDeadNumber() {\r\n var c = 0;\r\n for (var i = 0; i < getNumMonsters(); i++) {\r\n if (isMonsterDead(i)) {\r\n c++;\r\n }\r\n }\r\n return c;\r\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isNonpositiveInteger (STRING s [, BOOLEAN emptyOK]) Returns true if string s is an integer <= 0. For explanation of optional argument emptyOK, see comments of function isInteger. | function isNonpositiveInteger (s)
{ var secondArg = defaultEmptyOK;
if (isNonpositiveInteger.arguments.length > 1)
secondArg = isNonpositiveInteger.arguments[1];
// The next line is a bit byzantine. What it means is:
// a) s must be a signed integer, AND
// b) one of the following m... | [
"function isNonpositiveInteger(s) {\r\n var secondArg = defaultEmptyOK;\r\n\r\n if (isNonpositiveInteger.arguments.length > 1)\r\n secondArg = isNonpositiveInteger.arguments[1];\r\n\r\n // The next line is a bit byzantine. What it means is:\r\n // a) s must be a signed integer, AND\r\n // b) one of the fol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
gets or creats the tick cache | function getOrCreateTickCache(element, context) {
var cache = element.data('alphaSynthTickCache');
if(!cache) {
playerTickUpdateCache(element, context);
cache = element.data('alphaSynthTickCache');
}
return cache;
} | [
"function setupCaching() {\n cache();\n new CronJob({\n cronTime: \"00 30 00 * * *\", //toda meia-noite e meia de todo dia\n start: true,\n onTick: cache\n });\n}",
"put(cacheKey,value){return this._cacheStore.put(cacheKey,value);}",
"generateCacheObject() {\n return {\n St... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getAll() > only use case is to return all choices by a question_id so that's what this does | static async getAll({ question_id }) {
let result = await db.query(`
SELECT id, question_id, title, content, content_type
FROM choices
WHERE question_id=$1
`,
[question_id]
);
return result.rows.map(q => new Choice(q));
} | [
"getAllChoices() {\n this.choices[0] = this.fixedChoice;\n return this.choices;\n }",
"static async getAll() {\n try {\n const data = await database.select('*', 'questions');\n const response = [];\n data.forEach((r) => {\n response.push(new Question(r));\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::WAFv2::WebACL.SqliMatchStatement` resource | function cfnWebACLSqliMatchStatementPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnWebACL_SqliMatchStatementPropertyValidator(properties).assertSuccess();
return {
FieldToMatch: cfnWebACLFieldToMatchPropertyToCloudFormation(properties.fi... | [
"function cfnWebACLXssMatchStatementPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnWebACL_XssMatchStatementPropertyValidator(properties).assertSuccess();\n return {\n FieldToMatch: cfnWebACLFieldToMatchPropertyToCloudFormation(prop... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
InitializeRows handles appending all of our constructed Event HTML inside eventFeed | function initializeRows() {
eventFeed.empty();
const eventsToAdd = [];
for (let i = 0; i < events.length; i++) {
eventsToAdd.push(createNewRow(events[i]));
}
eventFeed.append(eventsToAdd);
} | [
"function initializeRows() {\n eventContainer.empty();\n var eventsToAdd = [];\n for (var i = 0; i < events.length; i++) {\n eventsToAdd.push(createNewRow(events[i]));\n }\n eventContainer.append(eventsToAdd);\n }",
"function initializeRows() {\n blogContainer.empty();\n var requestsToA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
:slotted can only accept simple selectors and not combinators since the adjucent sibling selector cannot be used, we apply css via javascript | _adjustMarginOnMultipleSlottedElements() {
const slotNode = this.shadowRoot.querySelector('slot');
const slottedNodes = slotNode.assignedNodes();
slottedNodes.forEach(slotElement => {
this._applyCssForButtonElement(slotElement);
this._applyCssForButtonGroupElement(slotE... | [
"function processSlotContent(el){\nvar slotScope;\nif(el.tag==='template'){\nslotScope=getAndRemoveAttr(el,'scope');\n/* istanbul ignore if */\nif(slotScope){\nwarn$2(\n\"the \\\"scope\\\" attribute for scoped slots have been deprecated and \"+\n\"replaced by \\\"slot-scope\\\" since 2.5. The new \\\"slot-scope\\\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
'text' or 'binary' Generate a new closure build routine. | function closureBuilder(entrypoint) {
const isRelease = argv.buildtype === 'RELEASE' || argv.release;
const isInternal = argv.privacy === 'INTERNAL';
const isBeta = argv.buildtype === 'BETA' || argv.beta;
const standardDefines = [
`bloombox.SERVICE_MODE='${serviceMode}'`,
`bloombox.API_ENDPOINT=${apiEnd... | [
"build()/*: { code: string }*/ {\n const types = this.iterateOverTypes()\n\n return this.buildProgram(this.buildModule(types))\n // return generate(bt.program(this.buildModule(types), [], 'module'))\n }",
"function build(){blockIndex=0;labelNumber=0;labelNumbers=undefined;lastOperationWasAbrupt=false;la... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the parent folder, if available | get parentFolder() {
return tag.configure(Folder(this, "parentFolder"), "f.parentFolder");
} | [
"folder() {\r\n return getParentFolder(this.path);\r\n }",
"get parentFolder() {\r\n return new Folder(this, \"parentFolder\");\r\n }",
"get _parentFolderId()\n {\n let folderId = this._folderIdForParent;\n let isLocal = helpers.mediaId.isLocal(folderId);\n if(!isLoca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rename a single file. | rename( file, callback ) {
// Verify that the path exists.
if( context.fs.exists(file) ) {
// Rename the file.
utils.rename(file, callback);
}
} | [
"rename(newFilePath) {\n }",
"function renameFile(f,fn){return f.setName(fn(f))}",
"rename(newFilePath) {\n fs.renameSync(this.fileObj.versions[this.versionName].path, newFilePath);\n }",
"async renameFile(filePath, newFilePath) {\n const die = getDier(this, \"renaming file\", { projectId: this.projec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
event on selected the quality | onQualitySelect(quality) {
if (this.callback) {
this.callback(quality);
}
if (this.sources) {
// tries to find the source with this quality
let source = this.sources.find(ss => ss.format === quality.code);
if (source) {
this.player.src({ src: source.src, type: source.type }... | [
"set quality(value) {}",
"function handleQualityChange (event) {\n console.log(event.target.value)\n event.preventDefault()\n if(event.target.value === \"Low\") {\n setState({\n online: state.online,\n volume:state.volume,\n notifications: [...state.notifications, \"Musi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This decorator is used to mark classes that will be an entity view. Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it. | function ViewEntity(nameOrOptions, maybeOptions) {
var options = (typeof nameOrOptions === "object" ? nameOrOptions : maybeOptions) || {};
var name = typeof nameOrOptions === "string" ? nameOrOptions : options.name;
return function (target) {
__1.getMetadataArgsStorage().tables.push({
ta... | [
"_decorateClassDoc(classDoc) {\n // Classes can only extend a single class. This means that there can't be multiple extend\n // clauses for the Dgeni document. To make the template syntax simpler and more readable,\n // store the extended class in a variable.\n classDoc.extendedDoc = cla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of build resource IDs associated with a provided prerelease version. | function getAllBuildIDsForPrereleaseVersion(api, id, query) {
return api_1.GET(api, `/preReleaseVersions/${id}/relationships/builds`, {
query,
})
} | [
"function getAllResourceIDsForPrereleaseVersionsForBuild(api, id) {\n return api_1.GET(api, `/builds/${id}/relationships/preReleaseVersion`)\n}",
"function listAllBuildsForPrereleaseVersion(api, id, query) {\n return api_1.GET(api, `/preReleaseVersions/${id}/builds`, { query })\n}",
"function getAllPrerel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
mention below function will count the number of checked box is checked and return the value | totalChecked() {
return this.state.items.filter(props => props.checked).length;
} | [
"function countChecked(){\n\t\tvar numItems = $('.checked').length;\n\t\treturn numItems;\n\t}",
"async function countChecked() {\n var n = $( \"input:checked\" ).length;\n return n;\n }",
"function getCheckedCount(checkbox)\n{\n var selectedCount = 0;\n if (checkbox.length)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
promt the user to request how many pictures they wish to see | function addPicture(){
picCount = prompt ("How many GreyDwarfs do you wish to slay?")
url= "https://i.imgur.com/PdFrWUa.jpg"
if (picCount >=15){
let button = confirm ("That's way to many! Try less next time...");
}
else {
for(let i = 0; i <picCount; i ++){
document.write(... | [
"set imageCount(value) {}",
"getNumPics()\n {\n return this.numpics;\n }",
"function CountNumberOfPhotos() {\n var NumberOfPUFields = $('.pu_area').length;\n $(\"input[name='NumberOfPhotoUploadFields']\").val(NumberOfPUFields);\n $('#main_wrapper').addClass('photos'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prepares buffer to draw elements into pipe in the desired order | async preparePipeBufferForDraw(pipeBuffer) {
if (pipeBuffer.length == 1) {
return pipeBuffer;
}
var resultArray = []
if (pipeBuffer.length == 2) {
resultArray[0] = pipeBuffer[1]
resultArray[1] = pipeBuffer[0]
return resultArray;
}
if (pipeBuffer.length == 3) ... | [
"drawFromBuffer () {\n\t\tdisplaySystem.updateBufferFOV();\n\t\tdisplaySystem.updateBuffer();\n\n\t\tdisplay.clear();\n\t\tlogger.showMessages();\n\t\tfor (let i = 0; i < bufferOptions.width; i++) {\n\t\t\tfor (let j = 0; j < bufferOptions.height; j++) {\n\t\t\t\tlet pos = i + (j * bufferOptions.width);\n\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the specified node is descendant of the root node per the assigned low and lim attributes in the tree. | function isDescendant(tree, vLabel, rootLabel) {
return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
} | [
"function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim}",
"function isDescendant(tree,vLabel,rootLabel){return rootLabel.low<=vLabel.lim&&vLabel.lim<=rootLabel.lim;}",
"function isDescendant(tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If an option is selected in Key Name and Key Value, add it to Business Key Filter Queue as colonseparated pair, key:value | function addSelectedKeyPair()
{
(function($) {
var keyName = $('#edit-revive-business-key').val();
var keyNameText = $('#edit-revive-business-key option:selected').text();;
var keyValue = $('#edit-revive-business-key-value').val();
var currentQueue = "<option value='" + keyNa... | [
"function addFilterListEntry(key) {\n var checkbox = document.createElement('input');\n checkbox.type = \"checkbox\";\n checkbox.id = key;\n checkbox.addEventListener(\"click\", function() {\n saveOptions();\n });\n var label = document.createElement('span');\n if (filterListAuthors[key]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
destory root's subtrees to clear subtotals | function destorySubtrees(state) {
destorySubtreesRecursively(state.rootNode);
} | [
"function destorySubtreesRecursively(lroot) {\n if (lroot.children.length == 0) {\n return;\n }\n\n for (var i = 0; i < lroot.children.length; i++) {\n destorySubtreesRecursively(lroot.children[i]);\n lroot.children[i] = null;\n }\n lroot.children = [];\n lroot._childrenSector... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true the task will be add to manager | async beforeAddTask(task) {
// await mongo.persist(async (client) => {
// await client.collection('demo').insertOne({type: 'list'});
// });
return true;
} | [
"async beforeAddTask(task) {\n return true;\n }",
"async beforeAddTask(task) {\n return true;\n }",
"async beforeAddTask(task) {\n if (task.params.time != 'sec' || task.retry) {\n return true;\n }\n return await mongo.persist(async (client) => {\n let result = await client.colle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if inline is in field result | inlineIsInFieldResult(fieldBegin, inline) {
if (!isNullOrUndefined(fieldBegin.fieldEnd) && !isNullOrUndefined(fieldBegin.fieldSeparator)) {
if (this.isExistBeforeInline(fieldBegin.fieldSeparator, inline)) {
return this.isExistAfterInline(fieldBegin.fieldEnd, inline);
}
... | [
"static _isInline( node ) {\n return INLINES.has( node.type );\n }",
"isInline(editor, value) {\n return Element.isElement(value) && editor.isInline(value);\n }",
"isInline(editor, value) {\n return Element$1.isElement(value) && editor.isInline(value);\n }",
"canAddInline() {\n const ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper that recursively merges two data objects together. | function mergeData(to,from){if(!from){return to;}var key,toVal,fromVal;var keys=Object.keys(from);for(var i=0;i<keys.length;i++){key=keys[i];toVal=to[key];fromVal=from[key];if(!hasOwn(to,key)){set(to,key,fromVal);}else if(isPlainObject(toVal)&&isPlainObject(fromVal)){mergeData(toVal,fromVal);}}return to;} | [
"function mergeData(to,from){if(!from){return to;}var key,toVal,fromVal;var keys=Object.keys(from);for(var i=0;i < keys.length;i++) {key = keys[i];toVal = to[key];fromVal = from[key];if(!hasOwn(to,key)){set(to,key,fromVal);}else if(isPlainObject(toVal) && isPlainObject(fromVal)){mergeData(toVal,fromVal);}}return to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object representing a creative within the ad | function VastCreative(node, parent){
var me = this;
var par = parent;
this.sequence = node.getAttribute('sequence');
this.adId = node.getAttribute('adid');
this.id = node.getAttribute('id');
this.apiFramework = node.getAttribute('apiFramework');
/**
* @function
* Retrieve companion ads associate... | [
"function Creative(model) {\n\t\tthis.model = model || {};\n\t}",
"function CreativeUnit(uniqId){\n\n\t this.id = uniqId; \n\t\tthis.playerParamsMap = {\"reportingURL\":\"https:\\/\\/evs.jivox.com\",\"creativeUnitType\":\"18\",\"bDim\":\"728x90\",\"bUnitId\":\"1800\",\"siteId\":\"05f91e886b6e15\",\"campaignId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split the job into two jobs: first job with a single operation matching requestedPathOnDisk second job with all other operations so the two resulting jobs are only different by their operations | function splitOperationsByRequestedFile(job, requestedPathOnDisk) {
const matchingJob = {
...job,
args: { ...job.args, operations: [] },
}
const jobWithRemainingOperations = {
...job,
args: { ...job.args, operations: [] },
}
job.args.operations.forEach(op => {
const operationPath = path.r... | [
"execute (opperation, db, tabel, sel, obj) {\n\n let file = path.resolve(this.baseDir, db + '.json'); // db file\n\n // The job that is the executor of the promise that is to be returned\n let job = (resolve, reject) => {\n\n setTimeout(()=>{ // We use a timeout just to give the caller\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a goal from a user's list of goals | deleteGoal(request, response) {
goalStore.removeGoal(request.params.userid, request.params.id);
response.redirect('back');
} | [
"removeGoal(userId, goalId) {\n let goalList = this.getGoalList(userId);\n _.remove(goalList.goals, { id: goalId });\n this.store.save();\n }",
"function deleteGoal(goal) {\n // Remove goal from view\n viewModel.goals.remove(goal);\n \n // Delete goal from database \n addon.port.emit(\"DeleteGoal\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generateCourseEdge: generates course edge from every element of courseCodePrereq to courseCode | function generateCourseEdge(courseCode, courseCodePrereq) {
const courseEdge = {
id: courseCodePrereq + " -> " + courseCode,
title: courseCodePrereq + " -> " + courseCode,
from: courseCodePrereq,
to: courseCode,
arrows: 'to',
color: '#bdbdbd',
}
return courseE... | [
"function generateCourseNode(courseCode, courseName, courseDesc, courseLevel, courseSeasons, coursePrereq) {\n const courseDescription = courseCode + \" (\" + courseName + \")\\n\"\n + \"--------------------------------\" + \"\\n\"\n + stringParse(courseDesc);\n const courseTitle = (courseCode =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1.function gcb_manifest_content will write any other files underpackage of course builder. / 2.function gcb_manifest will call gcb_manifest_content() to write the manifest.json. / function gcb_manifest_content will write any other files under package of course builder. | function gcb_manifest_content(filepath){
var fs = require("fs");
var y = document.getElementById("fileImportDialog");
var file = y.files[0];
var new_file_name = file.name.replace(/ELO/, "");
var gcb_path = file.path.replace(file.name, "") + "GCB" + new_file_name.replace(/ /g, "_");
fs.appendFile(gcb_path + "/ma... | [
"function gcb_manifest(){\n\tvar fs = require(\"fs\");\n\tvar y = document.getElementById(\"fileImportDialog\");\n\tvar file = y.files[0];\n\tvar new_file_name = file.name.replace(/ELO/, \"\");\n\tvar gcb_path = file.path.replace(file.name, \"\") + \"GCB\" + new_file_name.replace(/ /g, \"_\");\n\tvar count = 0;\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================ / Delete all the markers of a query and type. /============================================================================ | function deleteAll(query,type) {
closeMapWindows();
closeDeleteAll();
showMamufasMap();
if (convex_hull.isVisible()) {
mamufasPolygon();
}
var remove_markers = [];
var occsCopy = $.extend(true,{},occurrences);
... | [
"function deleteAllMarkers() {\n clearMarkers();\n markers = [];\n searchArr = [];\n}",
"function deleteMarkers() {\n clearMarkers();\n}",
"function deleteMarkers() {\n clearMarkers();\n markers = [];\n cleanCoords = [];\n}",
"function deleteMarkers(){\r\n setAllMap(null);\r\n markers = [];\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Following example validate a American Express credit card starting with 34 or 37, length 15 digits. | function cardnumber(ccnum)
{
var cardno = /^(?:3[47][0-9]{13})$/;
if(ccnum.value.match(cardno))
{
return true;
}
else
{
alert("Not a valid Amercican Express credit card number!");
return false;
}
} | [
"function creditCardValidation() {\n return /^[0-9]{13,16}$/.test(cardNumber.value);\n}",
"function isCreditCardValid(creditCard){\n return /^\\d{13,16}$/.test(creditCard);\n}",
"function creditcardValidator() {\n const cardValue = cardNumber.value;\n const cardIsValid = /^\\d{13,16}?$/.test(cardValue);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
middlewares make sure input is a valid ID | function isValidId(req, res, next) {
if (!isNaN(req.params.id)) return next();
next(new Error("invalid ID"));
} | [
"function validatedId(request, response, next) {\n let id = request.params.id;\n if (/^[0-9a-z]{24}$/.test(id)) { // /^[0-9a-z]i$/ i desativa o case sensitive\n return next();\n }\n let err = new Error('invalid id');\n err.status = 422; // unprocessable error\n next(err);\n}",
"function validatedId(reque... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Alert user about episode being active | function doEpsiodeActiveAlert(c)
{
if (typeof c == 'undefined' || c == '')
{
c = '<p>This episode is currently activated. As a result, no changes can be made in this state.</p><p>To make changes, first deactivate the episode.</p>';
}//end if
doInfoAlert('Episode is active', c);
} | [
"function toggleEpisodeStatus(objEpisode) {\n\t\tif (objEpisode.active == 1)\n\t\t{\n\t\t\tif (confirm('Are you sure you want to deactivate this episode?') == true)\n\t\t\t{\n\t\t\t\t//let the process continue\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}//end if\n\t\t}//end if\n\t\t\n\t\tif (objEpisode.active ==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an array of nodes, remove any member that is contained by another. | function removeSubsets$1(nodes) {
var idx = nodes.length;
/*
* Check if each node (or one of its ancestors) is already contained in the
* array.
*/
while (--idx >= 0) {
var node = nodes[idx];
/*
* Remove the node if it is not unique.
* We are going through the array from the end, so we ... | [
"function removeSubsets$1(nodes) {\n var idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n var node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
loading in all textures | function initTextures() {
textureArray.push({});
loadFileTexture(textureArray[textureArray.length - 1], "cone.jpg");
textureArray.push({});
loadFileTexture(textureArray[textureArray.length - 1], "body.jpg");
textureArray.push({});
loadFileTexture(textureArray[textureArray.length - 1], "fin.jp... | [
"function initTextures() {\n for(var i = 0; i<texturesToLoad; i++){\n (function (i){\n worldTextures[i] = gl.createTexture();\n worldTextures[i].image = new Image();\n worldTextures[i].image.onload = function () {\n handleTextureLoaded(worldTextures[i])\n }\n worldTextures[i].ima... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to update the options array | function updateOptions() {
// Reset the options and set them
options.length = 0;
optionsEls.forEach((optionEl) => {
if (optionEl.checked) options.push(optionEl.name);
});
updateReplay();
} | [
"function updateAllOptions() {\n\tupdateOptions(\"cmsc\");\n\tupdateOptions(\"math\");\n\tupdateOptions(\"sci\");\n}",
"updateOptions (options) {\n this.options = _extend({}, this.options, options);\n\n _forOf(this.blocks, (block) => {\n block.options = _extend({}, block.options, options);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a JavaScript program to test the first character of a string is uppercase or not. // true or false.. // someSTR = false; // Html = true.. first char is uppercase. ^ == always search from the start of line.. $ == always search from the end of line.. m == search from the multi line. | function firstUpperChar(str) {
let regex = /^[A-Z]/;
if (regex.test(str)) {
console.log(true);
} else {
console.log(false);
}
} | [
"function upper_case(str)\n{\n regexp = /^[A-Z]/;\n if (regexp.test(str))\n {\n console.log(\"String's first character is uppercase\");\n }\n else\n {\n console.log(\"String's first character is not uppercase\");\n }\n}",
"function upperCase(str)\n{\n\tregEx = /^[A-Z]/;\n\n\tif (regEx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to generate normal density | function normal (x, mu, ss)
{
var fun = jStat.normal.pdf;
return fun(x, mu, ss);
} | [
"function normalDistribution() {\r\n let u = 0,\r\n v = 0;\r\n while (u === 0) u = Math.random(); //Converting [0,1) to (0,1)\r\n while (v === 0) v = Math.random();\r\n let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);\r\n num = num / 10.0 + 0.5; // Translate to 0 -> 1\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
api call (POST) new contact message, validate access token via header, and pass content via body | createContactMessage(name,emailAddress,message,userId) {
return axios({
method: 'POST',
url: API_URL + 'new',
headers: authenticationHeader(),
data: {
name: name,
emailAddress: emailAddress,
... | [
"function postContactData() {\n\n var args = {\n data: ebContacts,\n headers: {\"Content-Type\": \"application/json\"}\n };\n\n ebclient.post(\"https://api.everbridge.net/rest/contacts/\" + eborgId.toString() + \"/batch\", args, function (data, response) {\n console.log(response);\n console.log(data.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ham nay de khoi tao bien count=0 trong localStorage | function khoitao()
{
//kiem tra kho
var c=window.localStorage.getItem("count");
if(c==null)
{
window.localStorage.setItem("count",0);
}
} | [
"function init() {\n if (window.localStorage.getItem(\"count\") == null)\n window.localStorage.setItem(\"count\", 0);\n}",
"count() {\n try {\n return localStorage.length;\n }\n catch (error) {\n console.error(error);\n }\n }",
"function saveCountTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Footer Section Starts pop over for the clip Search menu single Camera calling the clip search model and getting the clip search on load when clip is clicked in the footer menu. Datacontext clipsearch expects the clipviewmodel ko binding winth div clpsrch. | function onpopovershown() {
if (datacontext.CurrentPanelmodel == undefined || datacontext.CurrentPanelmodel == null) {
Hidepopover();
return;
}
var cameraid = datacontext.CurrentPanelmodel.sessionmodel.cameraid();
if (cameraid == undefined || cameraid == "") {
... | [
"function C012_AfterClass_Pub_Search() {\n\tCurrentTime = CurrentTime + 50000;\n\tif (!GameLogQuery(CurrentChapter, \"Player\", \"PubFindCrop\")) {\n\t\tGameLogSpecificAdd(CurrentChapter, \"Player\", \"PubFindCrop\");\n\t\tOverridenIntroText = GetText(\"FindCrop\");\n\t\tPlayerAddInventory(\"Crop\", 1);\n\t}\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sort all class by start time (increase) | function sortByStartTimeForClass(myClassList) {
var classList = myClassList.slice(0);
classList.sort(function (class_1, class_2) {
var startTime1 = new Date(class_1.startTime);
var startTime2 = new Date(class_2.startTime);
return startTime1 - startTime2;
});
... | [
"function sortByEndTimeForClass(myClassList) {\n var classList = myClassList.slice(0);\n classList.sort(function (class_1, class_2) {\n var endTime1 = new Date(class_1.endTime);\n var endTime2 = new Date(class_2.endTime);\n return endTime2 - endTime1;\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate over the history for the given state machine execution, and run the provided function for each event. If func returns false then the for loop exits with a break | async function forExecutionHistory(executionArn, func) {
const stepFunctions = new AWS.StepFunctions();
const historyParams = { executionArn: executionArn };
do {
const historyResponse = await stepFunctions.getExecutionHistory(historyParams).promise();
historyParams.nextToken = historyResponse.nextToken;
... | [
"function LOOPCALL(state) {\n var stack = state.stack;\n var fn = stack.pop();\n var c = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'LOOPCALL[]', fn, c);\n }\n\n // saves callers program\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of a valueAccessor function | function evaluateValueAccessor (valueAccessor) {
return valueAccessor()
} | [
"function makeValueAccessor(value){return function(){return value;};} // Returns the value of a valueAccessor function",
"function evaluateValueAccessor(valueAccessor) {\n return valueAccessor();\n }",
"function evaluateValueAccessor(valueAccessor) {\n\t return valueAcce... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
main() function the OpenWhisk application that glues Twilio to our Watson Assistant NOT PRODUCTION QUALITY This code was written for a 24 hour hackathon | function main(params) {
//Use default values if we're using this on our test machines
if (params.From == null) {
params.From = DEFAULT_NUMBER;
params.Body = DEFUALT_BODY;
}
console.log("Using Twilio: " + USE_TWILIO);
return conversations.find({
se... | [
"async function main() {\n const queueHealthResponse = await lpClient(lpServiceName, apiEndpoint, apiOptions);\n const secret = await fetchSecret();\n updateConversationContextService(queueHealthResponse, secret);\n }",
"function Launch_iQ_Plus()\n{\n try \n {\n //Before launching iQ+ .Terminate if... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |