query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Constructs a block object / If isVoid == true, the block is "out of the game" / X and Y coordinates are the TOPLEFT of the block | function block(x, y, width, height, blockCode, isVoid)
{
this.isVoid = isVoid;
this.x = ((x * blockWidth) + ((x + 1) * blockSpacing));
this.y = ((y * blockHeight) + ((y + 1) * blockSpacing) + CANVAS_Y_OFFSET);
this.width = width;
this.height = height;
} | [
"function spawnNewBlock() {\n // TODO Change spawning location per block just outside top of the screen\n var decider = Math.round(Math.random() * 6 + 1);\n switch (decider) {\n case 1:\n currentBlock = new block(new coordinate(200, -50), BLOCKS.lBlock);\n break;\n case ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Switch multiple dom elements clockwise. Examples: roulette(el1, el2); roulette(el1, el2, el3); | function roulette() {
var tmp = 0;
for(var l = arguments.length - 1; l > 0; l--) {
roulette.two(arguments[l + tmp++], arguments[l-1]);
}
} | [
"function swapRotor(val) {\n // Gets current rotor value\n var el = document.getElementById(\"wheelVal\" + val);\n const current = el.innerHTML;\n const states = [\"I\", \"II\", \"III\", \"IV\", \"V\"];\n // Increases the rotor value by 1\n const nIndex = (states.indexOf(current) + 1) % states.len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new FpgaDeviceInfo. Describes the FPGA accelerator for the instance type. | function FpgaDeviceInfo() {
_classCallCheck(this, FpgaDeviceInfo);
FpgaDeviceInfo.initialize(this);
} | [
"static of(acceleratorClass, instanceSize) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_stepfunctions_tasks_AcceleratorClass(acceleratorClass);\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ec2_InstanceSize(instanceSize);\n }\n catch (error) {\n if (process.e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Closes the type warning modal, which is shown when a user types a noninteger value into a week | closeTypeWarningModal() {
this.setState({ openTypeWarning: false });
} | [
"function closeInteractionTypeSheet() {\n vm.interactionTypesVisible = false;\n }",
"function closeReviewWindow(type){\r\n if (type === \"save\") {\r\n Daily.saveEverything(starRatingSet, currentItemToSave);\r\n }\r\n Daily.reviewClosed();\r\n clicked = false;\r\n decolorStars(starRa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if `prop` is a data property. | function data(prop) {
return prop.length > 4 && prop.slice(0, 4).toLowerCase() === 'data';
} | [
"function data(prop) {\n\t return prop.length > 4 && prop.slice(0, 4).toLowerCase() === 'data';\n\t}",
"function data(prop) {\n return prop.length > 4 && prop.slice(0, 4).toLowerCase() === 'data'\n}",
"isProp(node) {\n return (\n typeof node === 'object' &&\n node.length === 1 &&\n typeof no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns file path for given name in temp dir | function getTempFilePath(name) {
if (!tmpDir) {
tmpDir = fs.mkdtempSync(os.tmpdir() + path.sep + 'vscode-go');
}
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir);
}
return path.normalize(path.join(tmpDir, name));
} | [
"getTemp(filename) {\n invariant(this.tempFolder, 'No temp folder');\n return path.join(this.tempFolder, filename);\n }",
"resourceTempPath (name) {\n return path.join(this.tmpPath, name)\n }",
"function getTempFilePath(file){\n file = file || \"temp-file\";\n file = crypto.randomBytes(4).readU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pops up a browser window and gives it focus. opens three standard sizes: s(mall), m(edium), and l(arge) ui_popupPrintableWin('../partnership/crm_create2a.htm','relnwin','m'); | function ui_popupPrintableWin(str_url,str_windowname, str_winsize) {
str_winsize = str_winsize.toUpperCase();
var ht = screen.availHeight;
var wd = screen.availWidth;
var left = 0;
var top = 10;
if (str_winsize == "S") scalar = 0.33;
else if (str_winsize == "M") scalar = 0.50;
else scalar = 0.75;
w... | [
"function openLargePopup( url, windowname ) {\r\n var popup = window.open( url , windowname, \"toolbar=yes,status=yes,scrollbars=yes,menubar=yes,locationbar=no,top=50,left=70,outerWidth=643,outerHeight=468,width=643,height=468,resizable=yes\");\r\n if (popup) popup.focus();\r\n}",
"function PopUpXY(path,title,w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for addonLinkersLinkerKeyValuesGet_0 | addonLinkersLinkerKeyValuesGet_0(incomingOptions, cb) {
const Bitbucket = require('./dist');
let defaultClient = Bitbucket.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = incomingOptions.apiKey;
// Uncomment... | [
"addonLinkersLinkerKeyValuesGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detect if the HTML or the BODY tags has a [mdthemesdisabled] attribute If yes, then immediately disable all theme stylesheet generation and DOM injection | function detectDisabledThemes($mdThemingProvider) {
var isDisabled = !!document.querySelector('[md-themes-disabled]');
$mdThemingProvider.disableTheming(isDisabled);
} | [
"function detectDisabledThemes($mdThemingProvider) {\n\t var isDisabled = !!document.querySelector('[md-themes-disabled]');\n\t $mdThemingProvider.disableTheming(isDisabled);\n\t}",
"function disableThemesDirective() {\n themeConfig.disableTheming = true;\n\n // Return a 1x-only, first-match attribute directi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create an alement and init tags based on the "moreFlags" array contenente moreFlags must be a keyvalue list | betterCreateElement(type, moreFlags) {
let el = document.createElement(type);
if (type.substring(0, "functionResult".length) == "functionResult") {
el.appendChild(window[type.split("-")[1]]());
}
if (!isNullOrUndefined(moreFlags)) {
for (let i = 0; i < moreFla... | [
"with_tags(more_tags) {\n var tags = {\n 'host': this.host\n };\n\n this.extra_tags.forEach(function (t, v) {\n tags[t] = v;\n });\n\n if (more_tags != null && typeof(more_tags) != 'undefined') {\n more_tags.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PATCH messages/:id Toggle a message's flagged state. | toggleMessageFlagged(id) {
const message = _.find(this.state.messages, {id: Number(id)});
const flagged = !message.flagged;
axios.patch(`messages/${id}`, {flagged})
.then(() => this.setState({
messages: this.state.messages
.map(message => message.id !== id
? message
... | [
"toggleMessage() {\n // this.message === true ? this.message = false : this.message = true\n this.message = !this.message;\n }",
"function markSeen(id) {\n for (i=0; i<messageListData.length; i++) {\n if (messageListData[i].id == id) {\n if (messageListData[i].seen) {\n return;\n } els... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates empty modal window structure to the DOM via D3.js DOM structure is this: .modal | .content .modalcontent | .header .modalheader | .body .modalbody | .footer .modalfooter | create(){
const modal = d3.select(this.parentNode)
.append('div')
.classed('modal', true)
.attr('id', this.DOM_ID);
const content = modal.append('div')
.classed('content', true)
.classed('modal-content', true);
const header = content.... | [
"static createModal() {\n const modal = document.createElement(\"div\");\n modal.id = \"uwu__modal1312\";\n modal.classList.add(\"uwu__hide1312\");\n\n modal.onmousedown = function (e) {\n if (e.currentTarget !== e.target) return;\n modal.classList.remove(\"uwu__show1312\");\n };\n\n doc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
counts how many standard deviations above or below the mean a particular value is, imposing a max of 3 and a min of 3. | function zScore(mean, sd, value) {
var score = (value - mean) / sd;
if (score < -2.9) {
return -2.9;
} else if (score > 3) {
return 3;
} else {
return score;
}
} | [
"function devi(items) {\n var m = mean(items);\n var a = m - min(items);\n var b = max(items) - m;\n return a > b ? a : b;\n}",
"function standardDeviation(values) {\r\n\t\tvar avg = getAvg(values);\r\n\r\n\t\tvar squareDiffs = values.map(function(value) {\r\n\t\t\tvar diff = value - avg;\r\n\t\t\tvar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::Kendra::DataSource.SalesforceChatterFeedConfiguration` resource | function cfnDataSourceSalesforceChatterFeedConfigurationPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnDataSource_SalesforceChatterFeedConfigurationPropertyValidator(properties).assertSuccess();
return {
DocumentDataFieldName: cdk.string... | [
"function cfnDataSourceSalesforceConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDataSource_SalesforceConfigurationPropertyValidator(properties).assertSuccess();\n return {\n ChatterFeedConfiguration: cfnDataSourceSales... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FitCubic : Fit a Bezier curve to a (sub)set of digitized points | function FitCubic(d, first, last, leftTangent, rightTangent, error)
{
var bezCurve = []; /* Control points of fitted Bezier curve*/
var u; /* Parameter values for point */
var uPrime; /* Improved parameter values */
var maxRet;
var maxError; /* Maximum fitting error */
var splitPoint; ... | [
"function FitCubic(d, first, last, tHat1, tHat2, error, DrawBezierCurve)\n // Vector2 *d; /* Array of digitized points */\n // int first, last; /* Indices of first and last pts in region */\n // Vector2 tHat1, tHat2; /* Unit tangent vectors at endpoints */\n // double error; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Splits the incoming passthrough context apart in an internal and an external normalized context the internal one is just for our internal processing | function resolveContexts(context) {
/**
* we split the context apart into the external one and
* some internal values
*/
let externalContext = ExtDomQuery_1.ExtConfig.fromNullable(context);
let internalContext = externalContext.getIf(Const_1.CTX_PARAM_MF_INTERNAL);
if (!internalContext.is... | [
"function prepareContext(context) {\n return context_1.toInternalContext(context);\n}",
"function resolveContexts(context) {\n /**\n * we split the context apart into the external one and\n * some internal values\n */\n var externalContext = mona_dish_1.Config.fromNullable(context);\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generates unique and duplicate hashes for bnodes | function hashBlankNodes(unnamed) {
var nextUnnamed = [];
var duplicates = {};
var unique = {};
// TODO: instead of N calls to setImmediate, run
// atomic normalization parts for a specified
// slice of time (perhaps configurable) as this
// will better utilize CPU and improve performance
... | [
"function hashBlankNodes(unnamed){var nextUnnamed=[];var duplicates={};var unique={};// TODO: instead of N calls to setImmediate, run\n// atomic normalization parts for a specified\n// slice of time (perhaps configurable) as this\n// will better utilize CPU and improve performance\n// as JS processing speed improve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs an edge with 2 Vertex and the cost of transition | function Edge(from, to, cost) {
this.from = from;
this.to = to;
this.cost = cost;
this.toString = function () {
return this.from + ' --'+this.cost+'-> ' + this.to;
};
} | [
"function GraphEdge(_fromNodeID, _toNodeID, _cost) {\n\t// start node\n\tthis.fromNodeID = _fromNodeID || '';\n\t// end node\n\tthis.toNodeID = _toNodeID || '';\n\t// cost of edge (g value)\n\tthis.cost = _cost || 0;\n}",
"function GraphEdge(_fromNodeID, _toNodeID, _cost, _showCost) {\n\t// start node\n\tthis.fro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End Add To Path View Add Shortest Path | function addShortestPath() {
if (additionPending) {
alert("hold on, waiting for server");
return;
}
if (isNaN(textFieldOne.value)) {
alert(textFieldOne.value + " is not a sequence number");
return;
}
if (isNaN(textFieldTwo.value)) {
alert(textFieldTwo.value + " is not a sequence numbe... | [
"function displayShortestPath(node){\n\tif(node.prev != null){\n\t\tvar ctx = $('#grid')[0].getContext('2d');\n\t\t//erase previous \n\t\tctx.beginPath();\n\t\tctx.moveTo(node.X,node.Y);\n\t\tctx.lineTo(node.prev.X, node.prev.Y);\n\t\tctx.lineWidth = 2;\n\t\tctx.strokeStyle = 'white';\n\t\tctx.stroke();\n\t\t//draw... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Informing the server to end the conference, when end call button is clicked by the initiator | function endConference(){
console.log('initiator ending the call');
$endConference.style.display = 'none';
sendMessage('endConference');
} | [
"function endCall() {\r\n\r\n // Send end call to all contacts,\r\n // and remove the contacts from the\r\n // list.\r\n webrtc.webrtcadapter.sendEndCallToAllContacts();\r\n webrtc.webrtcadapter.removeContactPeers();\r\n\r\n // For each conference contact.\r\n conferenceContactList.forEach(func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
intended usage: When one language truly requires another Unlike `getLanguage`, this will throw when the requested language is not available. | function requireLanguage(name) {
var lang = getLanguage(name);
if (lang) { return lang; }
var err = new Error('The \'{}\' language is required, but not loaded.'.replace('{}',name));
throw err;
} | [
"function requireLanguage(name) {\n var lang = getLanguage(name);\n if (lang) {\n return lang;\n }\n var err = new Error(\"The '{}' language is required, but not loaded.\".replace(\"{}\", name));\n throw err;\n }",
"function requireLanguage(name) {\n var lang = getLanguage(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to create a mobilefriendly button click handler | function mobileButtonClick(selector, handler) {
selector.on('click touchstart', handler);
} | [
"handleButton() {}",
"function clickHandler(event) {\n\tpressButton(event.target);\n}",
"handleClick() {}",
"function handler_click() {\n\t\t//\tStuff to do on the click\n\t}",
"performClickFunctionality(){}",
"handleButtonPress()\r\n\t{ }",
"clickHandler() {\r\n\t\tif (this.clickMethod && this.targetCo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dispatch an action and set the state | function dispatch() {
state = update(state, this)
console.log(state)
refreshDOM()
} | [
"function dispatch(action){\n state = reducer(state, action)\n render()\n }",
"coreDispatch(action) {\n const newState = this.useReducers(action, this.state);\n\n if (!this.equalStates(newState, this.state)) {\n this.state = newState;\n this.trigger('change', this.state);\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the selector box text with the current body, colour, wheels and flags indices | function updateSelectorBox()
{
//Get the element we're going to change
var selectorBox = document.getElementById("selector-box");
//Set it's value to nothing, reset it.
selectorBox.value = "";
//Finally, just append each index to the string
selectorBox.value += ("flag: "+ flagIndex + " | ")
selectorBox.value... | [
"function updateSelText () {\r\n if (selLocIndex == -1) { document.getElementById(\"selText\").innerHTML = \"\"; }\r\n else {document.getElementById(\"selText\").innerHTML = locArray[selLocIndex].p.innerHTML; }\r\n}",
"function updateCustomSelectorText(multi_select, selections) {\n var option = multi_select.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function returns Quantity for an item in diffrent bins | function getBinwiseQtyDetailsforItem(binId,itemid,location)
{
nlapiLogExecution('DEBUG', 'binId,location,itemid', binId+','+location+','+itemid);
var qtyArray=new Array();
var filterStrat = new Array();
filterStrat.push(new nlobjSearchFilter('internalid',null,'anyof', itemid));
if(location!=null && location!='')
... | [
"function cuts_left(job)\n{\n var total = 0;\n for(var i = 0; i < job.cuts.length; i++)\n total += job.cuts[i].quantity;\n return total;\n}",
"function total_volume_bids(asks) {\n let quantity = 0;\n for (let order of asks) {\n quantity += order['quantity'];\n }\n return quantit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take a list of prices by region and a zone and return an object which maps the instanceType in that region to the price of that instanceType in that region | _findSpotPricesForRegion({pricePoints}) {
debugger;
let zones = {};
for (let pricePoint of pricePoints) {
let instanceType = pricePoint.InstanceType;
let time = new Date(pricePoint.Timestamp);
let price = toFloat(pricePoint.SpotPrice, 10);
let zone = pricePoint.AvailabilityZone;
... | [
"_findMaxPrices(res, zones) {\n // type -> zone\n let pricing = {};\n\n for (let pricePoint of res.SpotPriceHistory) {\n let type = pricePoint.InstanceType;\n let price = parseFloat(pricePoint.SpotPrice, 10);\n let zone = pricePoint.AvailabilityZone;\n\n // Remember that we only want to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Preformat the dynamics text | preFormat() {
let total_width = 0;
// Iterate through each letter
this.sequence.split('').forEach((letter) => {
// Get the glyph data for the letter
const glyph_data = TextDynamics.GLYPHS[letter];
if (!glyph_data) throw new Vex.RERR('Invalid dynamics character: ' + letter);
const si... | [
"format() {\n if(this.properties[\"text\"]) {\n this.formattedText = this.addLineBreaks(this.properties[\"text\"], 27);\n }\n }",
"postFormat() {\n if (this.postFormatted) return;\n\n // Calculate a smart slope if we're not forcing the beams to be flat.\n if (this.notes[0].getCategory() === '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws a player for a noise or an animal call recording noise: noise object to play visualization string 'wave' | 'spectro' mode string 'noise'|'call' | play(noise, visualization, mode='noise', speed=1) {
// var volume = (noise.field=='near')? 1.0:0.25; // far-away noises are played quieter
var volume = 1;
var wave_selectedClass = "";
var spectro_selectedClass = "";
wave_selectedClass = (visualization == 'wave' && noise.active)? ... | [
"function drawPlayerNameDisplay() {\n\t\tif(whoAmI === \"none\") {\n\t\t\t$(\"#playerIntro\").html(\"You are currently spectating.\");\n\t\t}\n\t\telse if(whoAmI === \"player1\") {\n\t\t\t$(\"#playerIntro\").html(\"Hi, \" + p1Name + \"! You are player 1.\");\n\t\t\t$(\"#p1c1\").addClass(\"player1Rock\");\n\t\t\t$(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check SVG SMIL animation support | function isSVG() {
var ret, svgNode, name,
create = document.createElementNS,
SVG_URL = 'http://www.w3.org/2000/svg';
if (create) {
create = create.bind(document);
svgNode = create(SVG_URL, 'animate');
... | [
"function isSVG() {\n const createNS = document.createElementNS;\n const SVG_URL = 'http://www.w3.org/2000/svg';\n \n if (!createNS)\n return false;\n \n const create = createNS.bind(document);\n const svgNode = create(SVG_URL, 'animate');\n const name = svgNode.toString();\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add tweet to object e is the tweet event | function addTweetToQueue(e) {
if (isReply(e)) {
// eslint-disable-next-line no-console
console.log('====================')
// eslint-disable-next-line no-console
console.log(`=IS REPLY RETURNING=`)
// eslint-disable-next-line no-console
console.log('====================')
return
}
twee... | [
"function tweetEvent(tweet) {\n // Who sent the tweet?\n var name = tweet.user.screen_name;\n // Who is the recipient?\n var reply_to = tweet.in_reply_to_screen_name;\n // What is the text?\n var text = tweet.text;\n // What is the tweet ID?\n var id = tweet.id_str;\n\n // Check that the tweet isn't its ow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Approve tokens for transfer | async approveTokensForTransfer() {
const { setProtocol } = this.state;
const tokenAddresses = this.state.tokensToApprove;
tokenAddresses.forEach(async function(address) {
console.log("approving..", address);
const txhash = await setProtocol.setUnlimitedTransferProxyAllowanceAsync(
addre... | [
"async function approveTokens() {\n try{\n await preRequisites()\n accounts = await web3APIs.getAccounts()\n fromAccount = accounts[7]\n let tokenTransferProxyAdd = tokenTransferProxyInstance.address\n txHash = await bcTokenInstance.approve(tokenTransferProxyAdd, 500, {from: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a single Mentor based on ID | static find(id) {
let promiseFind = new Parse.Promise();
let query = new Parse.Query(Mentor);
query.get(id).then(function(mentor) {
promiseFind.resolve(mentor);
}, function(err) {
promiseFind.reject(err);
});
return promiseFind;
} | [
"retrieveMentor(name, id) {\n return axios.get(`${JPA_API_URL}/users/${name}/mentors/${id}`);\n }",
"getMonsterById(id) {\n return this.db.findFirst(id).then(monster => monster? new MonsterResolver(monster) : null);\n }",
"getById(id) {\r\n return new Member(this, id);\r\n }",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
much less efficient than Integer.bitCount, but no choice? | function bitCount(i) {
i = i - ((i >>> 1) & 0x55555555);
i = (i & 0x33333333) + ((i >>> 2) & 0x33333333);
return (((i + (i >>> 4)) & 0x0F0F0F0F) * 0x01010101) >>> 24;
} | [
"bitCount(n) {\n var count = 0;\n while (n) {\n count += n & 1;\n n >>= 1;\n }\n return count;\n }",
"bitCount() {\n\t\t// return number of 1 bits in x\n\t\tconst cbit = x => {\n\t\t\tvar r = 0;\n\t\t\twhile (x != 0) {\n\t\t\t\tx &= x - 1;\n\t\t\t\t++r;\n\t\t\t}\n\t\t\treturn r;\n\t\t}\n\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether the document name exists or Not if it exists resolve(true) if not resolve(false) if there is only 1 documentName exist else reject(err) | isDocumentExisted(documentName) {
var checkExistedProcess = this.dbConnect.then((connection) => {
return new Promise ((resolve, reject) => {
connection.query('SELECT id FROM ' + dbDocumentInfo + ' WHERE documentName = ?', documentName, (err, results, fields) => {
if (!err) {
var ... | [
"isDocumentStored(documentName) {\n var pathToDocument = config.documentStorageLocation + '/' + documentName\n return new Promise((resolve, reject) => {\n var checkDocumentStoragePro = fs.stat(pathToDocument, (err, stats) => {\n if (!err) {\n resolve(stats.isFile())\n } else {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to build the URL need to search for a city | function buildURL(citySearch){
var userCity = $("#userInput").val().trim();
userCity = userCity.replace(/\s+/g, "");
localStorage.setItem('lastSearch', userCity)
var citySearch = 'https://api.openweathermap.org/data/2.5/forecast?q=' + userCity + '&appid=7a55a4098897a5f61d... | [
"function buildQueryURL(city) {\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\";\n return queryURL + city + \"&appid=\" + apiKey;\n }",
"function buildUrl(city) {\r\n return `https://api.weatherbit.io/v2.0/current?city_id=${cityID[city]}&key=82ac8b5cacf346c69247141d3b9281... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns the node with the same key, might find reordering, will change _state.iter | function findSame(nodes, key) {
for (var i = 0, il = nodes.length; i < il; i++) {
var node = nodes[i]
if (node.key === key) {
if (i > _state.iter) _state.iter = i
return node
}
}
return null
} | [
"get(key) {\n const found = this.hash[key];\n\n if (found) {\n this.list.moveNodeToHead(found);\n return found;\n }\n\n return -1;\n }",
"findNodeByKey (key) {\n return Tree.findEntry2 (key, this.rootEntry);\n }",
"firstKey() {\n const nodes = this.nodes;\n if (nodes) {\n r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
format the text at the end of the breadcrumbs | formatBreadcrumbText(sequence, value, percentage) {
if (sequence.length > 0 && _.has(sequence[sequence.length - 1].data, "conversion_type")) {
return sequence[sequence.length - 1].data.conversion_type;
} else {
return ""
}
//return value + " (" + (percentage < 0.1... | [
"function setBreadcrumbs() {\n if (arguments[0] === undefined) {\n console.log('No breadcrumbs supplied');\n return;\n }\n var output = '';\n for (let crumb of arguments) {\n output += crumb + ' / ';\n }\n var regex = new RegExp(' / $');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query the tracker for the most recent downloads that the server subscribes to (tags or users) This is called every 15 minutes. | function pollTracker() {
var parts = url.parse(config['tracker']);
var req = http.request({
method: "GET",
hostname: parts['hostname'],
port: parts['port'],
path: "/tracker/api/my/downloads",
headers: {
"X-Server-Auth": config['token'],
"User-Agent": "server-" + config['id']
}
... | [
"function getChannelCompletedStreams(id, username) {\n request.get(`https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&channelId=${id}&type=video&eventType=completed&key=${apiKey}`, (_error, _res, body) => {\n let data = JSON.parse(body)\n if (data.pageInfo.totalResults === 0) {\n co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
post asynchronous message to extension | function _postMessage(command, args, cb) {
try {
var msg = args || {};
msg.req_id = _getNextReqId();
msg.cmd = command;
_callbacks[msg.req_id] = cb;
extension.postMessage(JSON.stringify(msg));
} catch (e) {
ERR('PostMessage Exception : ' + e);
}
} | [
"function postMessage(msg, callbackId) {\n msg[asyncCallbacks.key] = callbackId;\n extension.postMessage(JSON.stringify(msg));\n}",
"async _postMessage() {\n if (!this.composer.canPostMessage) {\n if (this.composer.hasUploadingAttachment) {\n this.env.services['notification'].no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
automatically deactivate up/down arrows after some inactivity | function deactivateUpDownArrows() {
return setTimeout(function() {
$("#menu i").removeClass("activated", 1000);
}, 1000 * 60);
} | [
"function arrowsFastStop() {\n clearInterval(self.intervalId);\n\n $(event.target).unbind('mouseup', arrowsFastStop);\n $(document).unbind('mouseup', arrowsFastStop);\n }",
"function onPointerUp() {\n if (pointerActive) {\n pointerActive = false;\n }\n }",
"up... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A SimpleStream wraps an EventHandler and provides convenience methods of `map`, `filter`, `split`, and `pluck` to transform one stream into another. | function SimpleStream(){
EventHandler.call(this);
} | [
"function SimpleStream(){\n\t EventHandler.call(this);\n\t }",
"function map(f) {\n return stream => {\n return event => {\n const res = f(event.get('data'));\n if (res && res.then) {\n res\n .then(value => forward(stream, event.set('data', value)))\n .catch(reason... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new venue | function create(value, args) {
console.log('Inserted venue in DB');
let venue = new models.venue(args.venue);
return venue.save();
} | [
"function addVenue(request, response) {\n\tvar venueName = request.body.venueName;\n\tvar street = request.body.street;\n\tvar city = request.body.city;\n\tvar state = request.body.state;\n\tvar zip = request.body.zip;\n\tvar phone = request.body.phone;\n\tvar email = request.body.email;\n\tconsole.log(\"Adding new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
the filter function filters the films according to the ratings | function filter(films, margins) {
if (margins[0]==10&&margins[1]==100) {
}else{
items.innerHTML="";
var searchedFilms = [];
var filmRating;
for (var i=0; i<films.length; i++) {
var content = defLa[0] + i + defLa[1] + i + defLa[2] + films[i].image + defLa[3] + " Title: " +films[i].title + " <br>Genre: " + ... | [
"function filterByRating(rating){\n\t\treturn movies.filter((movie) => {\n\t\t\tconst average = getAvarageRating(movie);\n\t\t\treturn average >= rating && average < rating + 1;\n\t\t});\n\t}",
"function filter_search_rating(rating) {\n var filtered_list = []\n\n if (rating == 0) {\n return render_re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
limpia todos los spans utilizados para mensajes de error (esta funcion es necesario que este por separado de la de limpiar para poder colocarla al inicio de cada funcion) | function limpiarMensajesError(){
let spans = document.querySelectorAll(".error"); //Limpio todos mis mensajes de error que puse en etiquetas span
for (let i = 0; i < spans.length; i++) {
spans[i].innerHTML = "";
}
} | [
"function format_errors() {\n\n // For each span with id \"error\" (all errors)\n $('.error').each(function(index){\n // Replace the title text (error code) with the full error name\n // Uses error name dictionary defined at top of file\n $(this).prop('title', error_names[$(this).attr('ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
AutoFits the items by shrinking the last item. | _autoFitLastItem(lastItem, collapsedItems, lockedItems) {
const that = this,
itemsCount = that._items.length;
let lastLockedItem;
if (itemsCount === 1 && that._items[0].locked) {
lastLockedItem = that._items[0];
lastLockedItem.locked = false;
}
... | [
"_autoFitLastItem(lastItem, collapsedItems, lockedItems) {\n const that = this,\n itemsCount = that._items.length;\n let lastLockedItem;\n\n if (itemsCount === 1 && that._items[0].locked) {\n lastLockedItem = that._items[0];\n lastLockedItem.locked = false;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End $.fn.SPFilterNode //// PRIVATE FUNCTIONS //////// Wrap an XML node (n) around a value (v) | function wrapNode(n, v) {
var thisValue = typeof v !== "undefined" ? v : "";
return "<" + n + ">" + thisValue + "</" + n + ">";
} | [
"function __NodeFilter() {}",
"function isFilterValueNode(node) {\n return node && node.attribs && _.has(node.attribs, 'data-filter-value');\n}",
"function WrappedParsedTreeNodes(value) {\n this.value = value;\n }",
"replaceNode(n, value) {\n n.val = value;\n this.remove(n);\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `ServerSideEncryptionConfigurationProperty` | function CfnIndex_ServerSideEncryptionConfigurationPropertyValidator(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 ob... | [
"function CfnBucket_ServerSideEncryptionRulePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n errors.collect(cdk.propertyValidator('serverSideEncryptionByDefault', CfnBucket_ServerSideEncryptio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
csv to JSON to get list of Cohorts in json format | function csvToJSON(cohorts) {
var lines=cohorts.split("\n");
var result = [];
var headers=lines[0].split(",");
for(var i=1;i<lines.length;i++){
var obj = {};
var currentline=lines[i].split(",");
for(var j=0;j<headers.length;j++){
obj[headers[j]] = currentline[j];
}
result.push(obj);
}
... | [
"function createJSON(){\n const readStream = fs.createReadStream('./in-out/cohort.txt', 'utf-8');\n const writeStream =\n fs.createWriteStream('./in-out/input.json','utf-8');\n\n readStream.on('data', (chunk)=>{\n let cohort = {};\n const file = chunk;\n let rc = file.split('||');\n\n for (let i = 0... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse value to Int, checking the minimum and maximum values 0255 | function checkValue(value, radix = 10){
value = parseInt(value, radix);
if (value < 0 || isNaN(value)) return 0;
if (value > 255) return 255;
return value;
} | [
"static toInt (value, min, max, userInput = false) {\n const number = parseInt(value)\n if (number.toString() !== '' + value) {\n throw newTypeError(`${value}: invalid integer`, userInput)\n }\n if (min != null) {\n if (typeof min !== 'number' || min !== parseInt(min)) {\n throw new Typ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks config for attrs option to serialize records as objects containing id and types | hasSerializeIdsAndTypesOption(attr) {
var option = this.attrsOption(attr);
return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');
} | [
"hasDeserializeRecordsOption(attrs, attr) {\n\n var alwaysEmbed = this.hasEmbeddedAlwaysOption(attrs, attr);\n var option = this.attrsOption(attrs, attr);\n var hasSerializingOption = option && (option.deserialize || option.serialize);\n return alwaysEmbed || hasSerializingOption /* opti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for converting lat, lon and time to position object | function createPositionObject(lat, lon, time) {
var position = {
coords: {
latitude: null,
longitude: null,
accuracy: 999,
altitude: null,
altitudeAccuracy: null,
heading: null,
speed: null,
},
timestamp: null,
};
position.coords.latitude = lat;
position.coords.longitude = lon;
positio... | [
"function coordsToPosition(data){\n return {\n 'coords':{\n 'latitude':data.latitude,\n 'longitude':data.longitude,\n }\n }\n}",
"function convertPosition(position) {\n\tvar latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n var po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
eslintenable function to display the different screens | function displayScreens() {
if(screenDisplay==='orderHistory') return (<UserOrders/>)
if(screenDisplay==='accountConfig') return (<UserInfo user={user} />)
if(screenDisplay==='wishlist') return (<Wishlist/>)
} | [
"function mobileScreen(opt)\n{\n switch(opt)\n {\n case 'welcome':\n skillsWindow('none');\n toWelcome();\n break;\n case 'skills':\n let closeWelc = document.getElementById('welcome-section');\n let closeProj = document.getElementById('proj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================== Sets the release time (in msec) representing the amount of time, in seconds, required to increase the gain by 10 dB | set releaseTime( value )
{
const [minValue, maxValue] = OldSmartFader.releaseTimeRange;
this._releaseTime = utilities.clamp( value, minValue, maxValue );
this._updateCompressorSettings();
} | [
"releaseTime(value){\n this.audioSynth.releaseTime = value; \n }",
"set time (value) {\n this._time = value;\n\n // update the slider time\n this.sliderElement.value = (this._time * 100) / this.audio.duration;\n\n // updated the current duration\n this.ti... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
optimized for a situation where an array is NEARLY sorted already. if an array is already sorted after a few iterations, no need ot keep going. | function optimized(array) {
let noSwaps;
for (let i = array.length; i > 0; i--) {
noSwaps = true;
for (let j = 0; j < i - 1; j++) {
if (array[j] > array[j + 1]) {
swap(array, j, j + 1);
noSwaps = false;
}
}
if (noSwaps) break;
}
return array;
} | [
"function buble_sort_optimized(arr) {\n\tvar passes = 0;\n\tvar swapped;\n\tfor(var i=0; i<arr.length; i++){\n\t\tswapped = false;\n\t\t\n\t\t// last i elements are sorted already\n\t\tfor(var j=0; j<arr.length-i-1; j++){\n\t\t\tif(arr[j]>arr[j+1]){\n\t\t\t\tvar tmp = arr[j+1];\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to focus the first focusable element that is a child or child's child of the rootElement. | function focusFirstChild(rootElement) {
var element = getNextElement(rootElement, rootElement, true, false, false, true);
if (element) {
element.focus();
return true;
}
return false;
} | [
"function focusFirstChild(rootElement) {\n var element = getNextElement(rootElement, rootElement, true, false, false, true);\n if (element) {\n focusAsync(element);\n return true;\n }\n return false;\n}",
"function findFirstFocusableElement(element) {\n if (isFocusable(element)) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handles read / unread buttons and UI rebuilding arguments: btn: element that got clicked / fired the event > must contain pk and target as attributes options: panel_caller: this button was clicked in the notification panel | function updateNotificationReadState(btn, panel_caller=false) {
// Determine 'read' status of the notification
var status = btn.attr('target') == 'read';
var pk = btn.attr('pk');
var url = `/api/notifications/${pk}/`;
inventreePut(
url,
{
read: status,
},
... | [
"notificationMarkAsReadClicked(e) {}",
"notificationMarkAsReadClicked(e) {\n\n }",
"function attach_handlers(){\n /*Message nav first*/\n $(\"#show_received_messages\").click(function(){messageNav(\"received_messages\")});\n $(\"#show_sent_messages\").click(function(){messageNav(\"sent_messages\")});\n $(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace all instances of replaced with newstr | function replace_all(phrase, replaced, newstr) {
var temp = new RegExp(replaced, "g");
return phrase.replace(temp, newstr);
} | [
"function replaceAll(str, toReplace, replacement) {\n return str.split(toReplace).join(replacement);\n }",
"function replaceAll(str, search, repl) {\n while (str.indexOf(search) != -1)\n str = str.replace(search, repl);\n return str;\n}",
"function stringReplace() {\n result = phrase.rep... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
go through all games and clear up any mess caused by disconnecting players also let affected players know their opponent has disconnected if possible | function cleanup_games() {
for (var game in games) {
var d = games[game];
var remove_game = false;
if (d['p1'].disconnected) {
remove_game = true;
if (!d['p2'].disconnected) {
d['p2'].emit('opponent_disconnect');
}
}
else if (d['p2'].disconnected) {
remove_game = true;
if (!d['... | [
"kickAllPlayers() {\n for (let i = 0; i < this.public.seatsCount; i += 1) {\n if (this.seats[i]) {\n this.playerSocketEmitter(\n this.seats[i].socket,\n 'kicked',\n JSON.stringify({\n title: 'You have been removed from the table.',\n body: 'The game en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Uses forcegraph to draw the network graph as a HTML canvas using the graphData input. | function drawGraph(graphHtmlContainerId, graphData)
{
graph = ForceGraph()(document.getElementById(graphHtmlContainerId))
.width(window.innerWidth - 20)
.height(window.innerHeight - 20)
.nodeId('id')
.nodeLabel(node =>
{
return node.label;
})
.nodeRelSize(NODE_RELATIVE_SIZE)
.onN... | [
"drawForceChart(){\n\t\tlet data = this.getNodesAndLinks();\t\t\n\t\tthis.drawCorrelation(data);\n\t}",
"function DrawGraph() {\n RemoveNetwork(\"networkContainer\");\n //initailize the vis network global objects\n VISJS_NODES = new vis.DataSet({});\n VISJS_EDGES = new vis.DataSet({});\n\n VISJS_OP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables administrators to quickly look up if the |targetPlayer| might be another player who's recently been on the server. Results will be displayed with a level of certainty. | async onWhoisCommand(player, targetPlayer) {
const results = await this.database_.whois(targetPlayer.ip, targetPlayer.serial);
if (!results.length) {
return await alert(player, {
title: `Who is ${targetPlayer.name}?!`,
message: `No results were found for ${tar... | [
"async scoutPlayer(channel, target) {\n\t\tlet now = new Date().getTime();\n\t\tlet player = await sql.getPlayer(channel, target);\n\t\tif(!player) {\n\t\t\tconsole.log('Player not found');\n\t\t\treturn null;\n\t\t}\n\t\tlet embed = new Discord.RichEmbed();\n\t\tembed.setTitle(`SCANNING ${player.name.toUpperCase()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom middleware to uppercase user's name | function upperCase(req, res, next) {
req.upperName = req.body.name.toUpperCase();
next();
} | [
"function upperCase(req, res, next) {\n const name = req.body.name;\n if (req.method === \"POST\" || req.method === \"PUT\") {\n req.body.name = name.toUpperCase();\n next(); // keep on running through the usersRouter. If you don't do this, then it won't hit usersRouter middleware.\n } else {\n next(); ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
objAtt Return the value of HTML attribute a for HTML element o. If the optional v argument is supplied, attribute a will be set before being returned. Prototype: string objCss(Object o, string p[, string v]) Arguments: o ... An HTML element a ... An HTML attribute name v ... An optional attribute value Results: The str... | function objAtt(o, a, v) {
if (! o) return null;
// Neither gecko-based browsers nor IE can use o.getAttribute if o is an
// iframe that was added with
//
// doment.body.appendChild(document.createChild("iframe"))
//
// Ugh.
var ga = o.getAttribute;
if (ga == null && a.toLowerCase() ==... | [
"function _att(a, v) {\r\n return objAtt(this, a, v);\r\n}",
"function objCss(o, p, v) {\r\n if (o == null) return null;\r\n if (v != null) o.style[p] = v;\r\n\r\n // Check the inline style first.\r\n var s = o.style[p];\r\n if (s != '' && s != null) {\r\n return s;\r\n }\r\n\r\n // Check MSIE's curren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if number is Cubic | function checkCubic(str) {
return str == str.split('').map((num) => num ** 3).reduce((a, b) => +a + +b)
} | [
"function CubicPoly() {}",
"function CubicPoly() {\n\n\t \t}",
"function CubicPoly(){}",
"function CubicPoly() {\r\n\t\r\n\t\t}",
"function css__KHZ_ques_(cssPrimitiveType) /* (cssPrimitiveType : cssPrimitiveType) -> bool */ {\n return (cssPrimitiveType === 18);\n}",
"function SolveCubic() {\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Routine Description: Reset stdout and stderr buffers. Arguments: Return value: void | function CleanBuffer()
{
StdOutStr = "";
StdErrStr = "";
} | [
"resetWrite() {\n process.stdout.write = stdout;\n process.stderr.write = stderr;\n }",
"function unsetOutput() {\n did_set_output = false;\n $B.stdout = $B.modules._sys.stdout = scope.__stdout__;\n $B.stderr = $B.modules._sys.stderr = scope.__stderr__;\n }",
"reset() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a boolean for whether the view is attached | function viewAttached(view) {
return (view[FLAGS] & 16 /* Attached */) === 16 /* Attached */;
} | [
"function viewAttached(view) {\n return (view.flags & 8 /* Attached */) === 8 /* Attached */;\n}",
"function viewAttached(view) {\n return (view[FLAGS] & 8 /* Attached */) === 8 /* Attached */;\n}",
"function viewAttachedToChangeDetector(view) {\n return (view[FLAGS] & 128 /* LViewFlags.Attached */) === ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unauthorized function, send 401 | function unauthorized(res) {
res.set('WWW-Authenticate', 'Basic realm=Authorization Required');
return res.send(401);
} | [
"function unauthorized () {\n this.error('You are not authorized.', 401)\n}",
"function unauthorized() {\n this.error('You are not authorized.', 401);\n}",
"function unauthorized(req, res, next) {\n res.sendStatus(403);\n }",
"function unauthorizedErrorHandler(res,err){\n res.send({error:201, cause:\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Definimos y ejecutamos los minutos | function cargarMinutos(segundos){
let txtMinutos;
if(segundos == -1 && minutos !== 0){
setTimeout(() =>{
minutos--;
},500)
}else if(segundos == -1 && minutos == 0){
setTimeout(() =>{
minutos = 59;
},500)
}
//Mostrar Minutos en pa... | [
"function cont_mas_1min(){\r\n tiempoRestante +=60000;\r\n actualizarContadorAtras(tiempoRestante);\r\n }",
"function zerarCronometro(){\n //zera as variaveis de hora, min e sec\n hora = 0;\n min = 0;\n sec = 0;\n //para o cronometro\n pararCr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Union by size, return final root | _union(A_data, B_data) {
let A_root = this._find(A_data);
let B_root = this._find(B_data);
// already the same set
if (A_root.self === B_root.self) return A_root;
// find the bigger one, make A_root be the bigger one
if (A_root.size < B_root.size) {
[A_root, B_root] = [B_root, A_root];
... | [
"union(p, q) {\n let i = this.root(p),\n j = this.root(j);\n\n if(i == j) return;\n \n if(this.sizes[i] < this.sizes[j]) { // tree i is shorter\n this.ids[i] = j;\n this.sizes[j] += this.sizes[i]\n } else { // tree j is shorter\n this.id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates proper element structure with single `style` element disregarding all other styles. Use to create more specific configuration file, but preserving previous attributes. Function assumes that the structure of the input `element` is correct (`element.elements[name = resources].elements[name = style, attributes.nam... | function elementWithStyleElement(element) {
var _a, _b;
const result = { ...element };
const resources = (_a = element.elements) === null || _a === void 0 ? void 0 : _a.find(el => el.name === 'resources');
if (!resources) {
return;
}
const styleElement = (_b = resources === null || resou... | [
"createStyle(style) {\n let element = document.createElement('style');\n element.type = 'text/css';\n element.appendChild(document.createTextNode(style));\n return element;\n }",
"function removeStyleElement(element) {\n var _a, _b, _c, _d;\n const resources = (_a = element.el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
After encrypting, return a json object with the content and iv | function encrypt(text) {
var iv = crypto.randomBytes(8).toString("hex");
var cipher = crypto.createCipheriv(algorithm, password, iv);
var encrypted = cipher.update(text.toString(), 'utf8', 'hex');
encrypted += cipher.final('hex');
return {
content : encrypted,
iv... | [
"function encrypt(obj) {\n var json = JSON.stringify(obj);\n\n // First generate a random IV.\n // AES-256 IV size is sixteen bytes:\n var iv = crypto.randomBytes(16);\n\n // Make sure to use the 'iv' variant when creating the cipher object:\n var cipher = crypto.createCipheriv('aes-256-cbc', cryp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the current/prev/next category content for each up/down event | function set_category(direction) {
//set previous panels and category
prev_category = curr_category;
prev_panel = curr_panel;
timer.start();
switch (direction) {
case "up":
curr_panel = 1;
if(curr_category == 1) {... | [
"_handleUp() {\r\n if (0 != this.tag('MenuList').index) {\r\n this.tag('MenuList').setPrevious()\r\n }\r\n }",
"function setNextCategory(){\n if (skipVisible){\n skipVisible = false;\n deleteButtons(true); // Delete specifically the skip button thanks to the \"true\" boo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
= Description Release a responder bound to the HValue instance itself. = Parameters +_responder+:: Any responder that is derived from HControl or any other class instance that implements HValueResponder or has compatible typing. | releaseResponder(_responder) {
} | [
"bindResponder(_responder) {\n if (typeof _responder === 'undefined') {\n throw new Error('HValueBindError: responder is undefined!');\n }\n if (!this.views.includes(_responder)) {\n this.views.push(_responder);\n _responder.setValueObj(this);\n }\n }",
"bindResponder(_responder) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
unfortunately, we can't serialize the activeFilters object directly because it's full of functions, DOM objects, and things that don't serialize cleanly, so manually run through it, copying useful stuff into another object, and serialize that copy. | function serializeFilters() {
var filtersCopy = {},
facetName
for (facetName in activeFilters) {
if (hasOwnProperty.call(activeFilters, facetName)) {
var originalValues = activeFilters[facetName].values
var valuesCopy = []
var dataType
var i,
n = originalVal... | [
"encodedFilters() {\n return btoa(encodeURIComponent(JSON.stringify(this.filters)))\n }",
"function getCurrentFilters(){\n\tvar filters = {};\n\tfilters['price'] = getCheckedPrices();\n\tfilters['radius'] = getRadius();\n filters['categories'] = getCategories();\n filters['sort'] = getSortBy()\n\tre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function will return the details of bought item matching with the 'transectionID' | getBoughtItemByTransectionId(transectionID) {
for (let i = 0; i < window.Database.DB.bought.length; ++i) {
if (window.Database.DB.bought[i].transaction_id == transectionID) {
return window.Database.DB.bought[i];
}
}
} | [
"function allItemsBought(buyerID) {\n return itemsBought[buyerID]; \n}",
"function getItemDetails(listingID) {\n \n}",
"function allItemsBought(buyerID) {\n return itemsBought[buyerID]\n}",
"getTransactions(item) {\n let item = this.items[item];\n return item.transactions;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the DOM representation of the text of a line. Also builds up a 'line map', which points at the DOM nodes that represent specific stretches of text, and is used by the measuring code. The returned object contains the DOM node, this map, and information about linewide styles that were set by the mode. | function buildLineContent(cm, lineView) {
// The padding-right forces the element to have a 'border', which
// is needed on Webkit to be able to get line-level bounding
// rectangles for it (in measureChar).
var content = elt("span", null, null, webkit ? "padding-right: .1px" : null);
var build... | [
"function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = elt(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
blend semitransparent color with white | function blend(c, a) {
return 255 + (c - 255) * a;
} | [
"function blend(c, a) {\n return 255 + (c - 255) * a;\n}",
"function fadeToWhite() {\n\tprevBgColor = bgColor;\n\tprevAlphaValue = alphaValue;\n\n\tfadeAlphaValueTemp = fadeAlphaValue;\n\talphaValue = fadeAlphaValueTemp;\n\n\tblendMode(ADD);\n\tisFading = true;\n}",
"function blend(c, a) {\n\treturn 255 + (c -... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
~~~~~~~~~~~~~~~~~~~~ Highcharts timeline~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Highchart's tooltip show flag info (QC not checked) | function tooltipFlags() {
// ' ' + Highcharts.dateFormat('%m/%d/%y %H:%M:%S', new Date(this.x)) +
return stationsMeta[sensor]['name']+'<br>'+
'<b>'+jsMoment(this.x, 'pac', 'normal')+' Pacific Time</b><br>'+
//ISO '%Y-%m-%dT%H:%M:%SZ'
Highcharts.dateFormat('%m/%d/%Y %H:%M:%S', new Date(this.x))+' (UTC)... | [
"function tooltipNoFlags() {\n\treturn stationsMeta[sensor]['name']+'<br>'+\n '<b>'+jsMoment(this.x, 'pac', 'normal')+' Pacific Time</b><br>'+\n//ISO '%Y-%m-%dT%H:%M:%SZ'\n Highcharts.dateFormat('%m/%d/%Y %H:%M:%S', new Date(this.x))+' (UTC)'+\n '<br><b>' + this.series.name +': </b>'+this.y+' '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert custom icon sets, return empty set on failure | function convertCustomSets(data, importIcons = true) {
if (!data.iconSets || !data.iconSets.length) {
return exports.emptyConvertedSet;
}
// Merge
let merge = 'only-custom';
switch (data.merge) {
case 'custom-first':
case 'custom-last':
case 'only-custom':
... | [
"get customIconSets() {\n\t if (this._data.customIconSets === void 0) {\n\t this._data.customIconSets = customSets.emptyConvertedSet;\n\t }\n\t return this._data.customIconSets;\n\t }",
"function parseIconSet(data, callback, list) {\n if ( list === void 0 ) list = 'none';\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check the dropdown box for the currently selected data type and update the bar chart accordingly. There are 4 attributes that can be selected: goals, matches, attendance and teams. | function chooseData() {
// ******* TODO: PART I *******
// Copy over your HW2 code here
var selected = document.getElementById('dataset');
updateBarChart(selected.options[selected.selectedIndex].value);
} | [
"chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n //Get selected choice\n var choice = document.getElementById('dataset').value;\n updateBarChart(choice);\n\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get coin value without decimal point it is required because javascript will consider 5.6 as 6 if we do Math.round() | function getRoundFigureCoinValue(x) {
return (x * 10 - ((x * 10) % 10)) / 10;
} | [
"getUserCoinValue(amount) {\n return (amount * this.props.currency.quote.USD.price).toFixed(2);\n }",
"function updateCoins() {\n //limit the coin's number to 2 digits after comma\n let roundedCoins = coins.toFixed(2);\n $('#coinNumber').text(roundedCoins);\n}",
"get price() {\n const actualPric... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GraphQL query to get dropDown data for specified entity | function entityDropDownListDataQuery(entityName, client, filter, columns, callback, sortColumns = [],) {
// Order
let orderBy = {};
sortColumns.forEach(function (val) {
const key = Object.keys(val)[0];
orderBy[key] = {
method: 'ALPHANUMERIC',
direction: val[key],
... | [
"get selectRequestSayHelloNestedFromDropDown() {\n return app.client.$(\"a=SayHelloNested\");\n }",
"async function getDepartmentChoices() {\n let departments = await query.getDepartments();\n let departmentChoices = [];\n for (let dept of departments) {\n departmentChoices.push({\n name: dept.name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Call a nonstandard get API endpoint that returns an observable | _getObservableWithOptions(options) {
let url;
if (options.url) {
url = options.url;
}
else {
url = UrlUtil.join(this.apiRoot, this._baseEndpoint, options.url);
}
if (options.id) {
url = UrlUtil.join(url, options.id);
}
i... | [
"get(url, options = {}) {\n return this.request('GET', url, options)\n }",
"GET() {\n this.execute('GET');\n }",
"function requestGet(url) {\n return request('GET', url);\n}",
"async get() {\n\t\treturn await this._run('GET');\n\t}",
"getAsync() {\n this.handleAsync('get', arguments);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
handle errors post ad second step | function renderWithErrors(errors) {
res.render('ads/misc-post-second-step', {
ad: req.body,
errors: errors
})
} | [
"function update_error(){\n // your code when post failed\n console.log(\"error!\");\n}",
"function renderWithErrors(errors) {\n\n res.render('ads/post-second-step', {\n ad: req.body,\n errors: errors\n })\n }",
"function handleError() {}",
"function postToAirtableHandleErrors... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds another typeahead box. | function add_another(data){
$('#inputs').append($(typeahead_templ));
var input = $("input.typeahead").typeahead({
name: data.name.replace(/[\/:-]/g, "_"),
prefetch: '/collect/person/json/',
limit: 10,
template: [
'<div>',
'<p>{{value}}</p>',
'<p class="muted">{{_i... | [
"function add_another(data){\n $('#inputs').append($(typeahead_templ));\n var input = $(\"input.typeahead\").typeahead({\n name: data.id.replace(/[\\/:-]/g, \"_\"),\n prefetch: '/collect/geo/child_id_json/'+ data.id,\n limit: 10,\n template: [\n '<div>',\n '<p>{{value}}</p>',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if at least one member of radio or checkbox group is selected | function isChecked(grp)
{
if (typeof(grp.length) != 'undefined')
{
for ( var i=0;i< grp.length;i++ )
{
if ( grp[i].checked )
{
return true;
}
}
return false;
}
else
{
return grp.checked;
}
} | [
"function isChecked(grp)\r\n{\r\n if (typeof(grp.length) != 'undefined')\r\n {\r\n for ( var i=0;i< grp.length;i++ )\r\n {\r\n if ( grp[i].checked )\r\n {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n else\r\n {\r\n return grp.checked;\r\n }\r\n}",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function prints the value of index1 at the top of the while loop | function topindexprt(data2) {
console.log('The content of index index1 at the top of the while loop is ' + data2)
} | [
"function topindexprt(data2) {\n console.log('The content of index index1 at the top of the while loop is ' + data2)\n\n}",
"function bottomindexprt(data3) {\n console.log('The content of index index1 at the bottom of the while loop is ' + data3)\n\n}",
"function bottomindexprt(data3) {\n console.log('Th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes and sets the mapping of phonemes from English letters to Amharic. | setMapping(){
this.amharicPhoneticMap.set('h', 'ህ');
this.amharicPhoneticMap.set('ha', 'ሃ');
this.amharicPhoneticMap.set('he', ['ሄ', 'ሀ']);
this.amharicPhoneticMap.set('hi', 'ሂ');
this.amharicPhoneticMap.set('ho', 'ሆ');
this.amharicPhoneticMap.set('hu', 'ሁ');
this.amharicPhone... | [
"function arabicToAsci(char_code)\n{\n return genericMap(char_code,ARABIC.CODE_0,ARABIC.CODE_9,ARABIC.CODE_DECIMAL);\n}",
"function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Appended div containing "No Results" message Creates, appends and styles "No results found" message to the div with class page | function ResultsMessage() {
noResultsDiv = document.createElement("div");
let noResultsMessage = document.createElement("span");
noResultsMessage.innerHTML = "No results found";
noResultsDiv.appendChild(noResultsMessage);
noResultsDiv.style.textAlign = "center";
noResultsDiv.style.display = "none";
... | [
"function displayNoResultsMessage() {\n var $noResultsDiv = $(document.createElement('div'));\n $noResultsDiv.addClass('no-social-results');\n $noResultsDiv.text(noResultsMsg);\n $host.append($noResultsDiv);\n }",
"function noResultsFound(mainDiv) {\n\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh the UI of the constraint controls based on the configuration of the currently focused morph. | refreshConstraints () {
const { constraints } = this.models;
const { layout } = this.targetMorph.owner;
if (!layout) {
// display fixed height and left
constraints.verticalConstraint = 'fixed';
constraints.horizontalConstraint = 'fixed';
return;
}
if (layout.name() === 'Const... | [
"updateAppearance() {\n // Clear selector\n this.__updateSelector = true;\n\n // Add to appearance queue\n qx.ui.core.queue.Appearance.add(this);\n\n // Update child controls\n var controls = this.__childControls;\n if (controls) {\n var obj;\n for (var id in control... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
req argument is only needed for PrepareSerializer.deserialize() and QuerySerializer.deserialize() | static deserialize(pm, reader, req) {
pm.startRead(reader, req);
return pm.serializer(this.name).deserialize(reader, req,
pm.serialVersion);
} | [
"function reqSerializer(req) {\n if (!req || !req.connection) return {}\n\n const rval = {\n method: req.method,\n url: req.originalUrl || req.url,\n accept: req.header('Accept'),\n guid: req.header('Request-Guid'),\n agent: req.header('User-Agent'),\n hostname: req.hostname,\n referer: req.h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the position of a dom node relative to the entire page. | function getDomNodePagePosition(domNode) {
var bb = domNode.getBoundingClientRect();
return {
left: bb.left + StandardWindow.scrollX,
top: bb.top + StandardWindow.scrollY,
width: bb.width,
height: bb.height
};
} | [
"function nodePagePos(node) {\n var rect = getDomNode(node).getBoundingClientRect();\n var res = getWindowScroll();\n res[0] += rect.left;\n res[1] += rect.top;\n return res;\n}",
"function getDomNodePagePosition(domNode) {\n var bb = domNode.getBoundingClientRect();\n return {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlights the send moves received from server | function highlightSendMoves(data) {
toHighlight = data.pieces;
player_id = data.player_id;
if (player_id == saveCurrentState.playerTurn) {
for (var i = 0; i < toHighlight.length; i++) {
setHighlight(toHighlight[i], saveCurrentState);
}
}
} | [
"function highlightMoveSpots(piece, on_off) {\n var x = piece.gridX;\n var y = piece.gridY;\n\n //piece must be alive to even hilight move spots\n if(!piece.alive){\n return;\n }\n\n \n\n //if there are jumps available this piece can only jump\n if (piece.canJump()) {\n if (pie... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs a new VenafiTargetDetails. | constructor() {
VenafiTargetDetails.initialize(this);
} | [
"constructor() { \n \n EKSTargetDetails.initialize(this);\n }",
"constructor() { \n \n ArtifactoryTargetDetails.initialize(this);\n }",
"constructor() { \n \n SalesforceTargetDetails.initialize(this);\n }",
"constructor() { \n \n WindowsTargetDe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creado por: Paola Mejia Descripcion: Obtiene la lista de Meses | function obtenerMeses(){
cxcService.getParMes({}, {},serverConf.ERPCONTA_WS, function (response) {
//exito
console.info("libroCompras: Meses",response.data);
$scope.listaMeses = response.data;
}, function (responseError) {
console.log(responseError);
... | [
"async function getAllMemes() {\n const response = await fetch(BASEURL + '/memes');\n const memeJson = await response.json();\n if (response.ok) {\n return memeJson.map((m) => Meme.from(m));\n } else {\n throw memeJson; // un oggetto che contiene l'errore proveniente dal server \n }\n}",
"async functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the parent of a node at a specific path. | parent(root, path) {
var parentPath = Path.parent(path);
var p = Node.get(root, parentPath);
if (Text.isText(p)) {
throw new Error("Cannot get the parent of path [".concat(path, "] because it does not exist in the root."));
}
return p;
} | [
"parent(root, path) {\n var parentPath = Path.parent(path);\n var p = Node$1.get(root, parentPath);\n\n if (Text.isText(p)) {\n throw new Error(\"Cannot get the parent of path [\".concat(path, \"] because it does not exist in the root.\"));\n }\n\n return p;\n }",
"function parentPath (path) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the report property dialog | function showReportPropertyDialog(options) {
return spReportPropertyDialog.showModalDialog(options);
} | [
"showTablePropertiesDialog() {\n if (this.tablePropertiesDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.tablePropertiesDialogModule.show();\n }\n }",
"function popUpFormFieldPropertiesDialog(whichOne){\n var commandFileName = whichOne + \" Properties.htm\";\n var rowOb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Envoi de la commande d'ajout d'equipe lors de la validation du formulaire | function onSubmitAjout(e) {
e.preventDefault();
//On execute la requete sur le serveur distant
let request = constructRequest("index.php?page=equipeajoutws", "POST", $(this).serialize() );
//En cas de succe de la requete
request.done(function( infos ) {
//on verifie si il n'y pas eu d'erre... | [
"function onValidateNiv1(form){\n var ret = null;\n var msg=\"\";\n var mail_to=\"\";\n var mail_cc=\"\";\n var blnValNiv2 = false;\n\n try {\n if(form===undefined ) throw 'null form';\n if(form.identifiant=='' ) throw 'null form';\n // Recuperation des donnees de la DA\n getInfoDA(form.identifian... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//SETS SINGLE LABEL/VALUE ITEM FOR A SPECIFIC PROJECT | setProjectAttribute(projects, project) {
let label = '';
let description = '';
return Object.keys(projects[project]).map((index) => {
label = this.formatting.formatLabel(index, 2);
description = this.formatting.formatContent(projects[project][index], 10);... | [
"function setVal(itemName, value)\n{\n \treturn get(itemName).setText(value);\n}",
"function setProject(project) {\n $scope.selectedProject = project;\n }",
"function setProject() {\n var sheet = SpreadsheetApp.getActiveSheet();\n var cell = sheet.getActiveCell();\n var valu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check that a store has a sufficient contract for this API | function validStore(store) {
return store &&
typeof store.getSelf === 'function' &&
typeof store.getDevices === 'function' &&
typeof store.getDevice === 'function' &&
typeof store.getSources === 'function' &&
typeof store.getSource === 'function' &&
typeof store.getSenders... | [
"function vendorHasStore(store) {\n if (!store) customError(\"STORE_NOTFOUND\", 404);\n}",
"async HiringContractExists(ctx, id) {\n const hireJSON = await ctx.stub.getState(id);\n return hireJSON && hireJSON.length > 0;\n }",
"_ensureCompatibility(store, storeFindMethod) {\n if (isEmpty(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
used to create new sheetArr and insert into sheetListArr | function initSheetDB() {
// rows-> 100
// col - > 26
let sheetArr = [];
for (let i = 0; i < rows; i++) {
let row = document.createElement("div");
row.setAttribute("class", "row");
let rowArr = [];
for (let j = 0; j < columns; j++) {
let cell = document.create... | [
"createSheet () {\n let headers = [];\n for(let i in this.headers){\n headers.push(this.headers[i].name);\n }\n\n let sheetStx = {\n name: this.name,\n headers: headers,\n rows: this.rows\n }\n\n this.parent.sheets.push(sheetStx);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |