query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Periodically requests snapshots for existing symbols subscriptions which do not stream through JERQ. | function pumpSnapshotRefresh() {
if (__connectionState === state.authenticated) {
try {
var snapshotBatches = getSymbolBatches(getProducerSymbols([__listeners.marketUpdate]), getIsSnapshotSymbol);
snapshotBatches.forEach(function (batch) {
processSnapshots(batch);
});
} catch (e) {
... | [
"async startSubscriptions() {\n // Subscribe to the games/ID doc\n this.subscribeDoc('games', this.props.gameId, (gameDoc) => this.setState({ game: gameDoc }));\n const gameDoc = await this.gameIsUpdated(true);\n\n // Subscribe to all the players/ID docs for this game\n gameDoc.players.forEach((gameP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`. | function getAttributesFromExtensions(extensions) {
const extensionAttributes = [];
const { nodeExtensions, markExtensions } = splitExtensions(extensions);
const nodeAndMarkExtensions = [...nodeExtensions, ...markExtensions];
const defaultAttribute = {
default: null,
rendered: true,
... | [
"getAttributeList() {\n this.ensureParsed();\n return this.attributes_;\n }",
"static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
animate ship to move to new position this is an asynchronous function! owner is either NASA or USSR, ship is the ship number of the new position | function animateShip(isCorrect, owner, ship) {
//if incorrect then ship will be current position because xCorrect was never incremented.
//If correct then ship will be next position.
$("#interface").hide();
var lastId = "#" + owner + (ship-1);
var id = "#" + owner + ship; //mo... | [
"function moveShip( shipObj, newLocation )\n{\n DEBUG_MODE && console.log( \"Calling moveShip in ShipBO, new location:\" , newLocation );\n if ( shipObj == undefined )\n {\n DEBUG_MODE && console.log( \"ShipBO.moveShip: shipObj is undefined\" );\n return undefined;\n }\n\n if ( newLocat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears out the targets of this instance. | clear() {
this._targets.clear();
this._proxies.clear();
} | [
"function clear() {\n\t\tgenerations = [];\n\t\tfittest = [];\n\t}",
"_setTargets() {\n this._targets = Controller.getToggles(this._options.targets);\n if (this._toggle) {\n this._targets.push(this._toggle);\n }\n }",
"clearAllObject() {\r\n this.m_drawToolList.length =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a task for positive and negative patterns. | function convertPatternGroupToTask(base, positive, negative, dynamic) {
return {
base: base,
dynamic: dynamic,
positive: positive,
negative: negative,
patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern))
};
} | [
"function createTask(task = {}) {\n\tif (task.promise) return task\n\ttask.promise = new Promise((resolve, reject) => {\n\t\ttask.resolvers = {resolve, reject};\n\t});\n\ttask.id = `${Date.now()}-${Math.floor(Math.random() * 100000)}`;\n\treturn task\n}",
"createTasks() {\n let jobProfile = null; // \"arwe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Evaluate if two faces are the same | equals(face) {
// Throw an error if face is not a Face
validate({ face }, 'Face');
// Check that the faces equal the same value
return (this.toString() === face.toString());
} | [
"function gotSomethingDifferent(){\n if (prevDetections.length != detections.length){\n return true;\n }\n var prev = getCountedObjects(prevDetections);\n var curr = getCountedObjects(detections);\n for (var k in curr){\n if (curr[k] !== prev[k]){\n return true;\n }\n }\n for (var k in prev){\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SERIAL convert a date object into a serial number. | function SERIAL(date) {
// Credit: https://github.com/sutoiku/formula.js/
if (!ISDATE(date)) {
return error$2.na;
}
var diff = Math.ceil((date - d1900) / MilliSecondsInDay);
return diff + (diff > 59 ? 2 : 1);
} | [
"function DateSerial(yy, mm, dd) {\n return FormatDateTime(cvdate(mm+'/'+dd+'/'+yy),2);\n}",
"function DATE(year, month, day) {\n return SERIAL(new Date(year, month - 1, day));\n}",
"function excelDateToJSDate(serial) {\n return new Date((serial - (25567 + 2 - 0.00000001)) * 86400 * 1000);\n}",
"functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to delete all items in the shopping list | function deleteAllItems() {
//check if the targeting is working
//alert("I've just activated the deleteAllItems() function");
//find the UL container (in our case having the class shopping-list) which contains all the LIs and delete all the children inside it
$('.shopping-list').empty();
} | [
"function deleteAllProducts() {\n API.deleteAll()\n .then(res => {\n loadProducts();\n })\n\n }",
"deleteAll() {\n this.forEach(item => {\n this.delete(item);\n });\n }",
"function emptyShoppingList() {\n if (confirm('Are you sure you want to remove ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `emptyString`. Returns true if `data` is the empty string, false otherwise. | function emptyString (data) {
return data === '';
} | [
"function isNonemptyString( str )\n{\n\treturn ( typeof str === \"string\" && str.length > 0 );\n}",
"function isNullOrUndefinedOrEmptyString(variable){\r\n\tif(isNullOrUndefined(variable))return true;\r\n\tvar string = String(variable);\r\n\treturn string.length===0 || !string.trim();\r\n}",
"function empty( ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of target devices available for the given qbs target OS list. | function targetDevices(targetOS) {
for (var key in _platformDeviceMap) {
if (targetOS.contains(key))
return _platformDeviceMap[key];
}
} | [
"getAvailableDevices(controllerId) {\n\n var _thisSvc = this;\n\n var deviceList = [];\n\n var controllerInfo =\n _thisSvc.controllerInfoCollection[controllerId];\n\n for(var deviceId in controllerInfo.deviceInfoCollection) {\n\n var deviceInfo =\n controllerInfo.deviceInfoCollection[de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes a publish settings file in the directory if it is named PublishSettings.xml. If this file is removed, the function will return true. | function removePublishXML(doc){
var pubSetPath = removeFileName(doc.pathURI) + PUBLISH_SETTINGS + ".xml";
if(fl.fileExists(pubSetPath)){
FLfile.remove(pubSetPath);
fl.trace(PUBLISH_SETTINGS + " file was removed...");
}
} | [
"isClean () {\n const build_path = path.join(this.projectDir, 'build');\n // If the build directory doesn't exist, it's clean\n return !(fs.existsSync(build_path));\n }",
"function deleteManifest() {\n if (manifestExists()){\n fs.unlinkSync(testManifestPath);\n }\n}",
"remove () {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensure that Image is defined under Node.js | function getImage() {
var ImageNotSupported = function ImageNotSupported() {
_classCallCheck(this, ImageNotSupported);
};
return global.Image || ImageNotSupported;
} | [
"is_image() {\n if (\n this.file_type == \"jpg\" ||\n this.file_type == \"png\" ||\n this.file_type == \"gif\"\n ) {\n return true;\n }\n return false;\n }",
"static prepareImageElement(imageSource){if(imageSource instanceof HTMLImageElement){return imageSource;}if(typeof imageSou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function that puts the contents of the HTML body tag into a variable, then calls the addTwitterLinks function on the content. AddTwitterLinks then returns the content into the HTML body tag. | function updatetags(){
var e=document.getElementsByTagName("body").item(0).innerHTML;
document.getElementsByTagName("body").item(0).innerHTML=addTwitterLinks(e);
} | [
"function parse(body) {\n var author = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\n //array of links that we'll keep for later\n var matches = [];\n\n //keys of author\n var postKeys = (0, _keys2.default)(author);\n\n //set urls -- fails for javascript protocol (important) -->... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a property. param property: must be a string of characters param value: must be a string of characters | addProperty(property, value) {
this.properties.set(property, value);
} | [
"function editProperty(ruleStr,styleSheet,property,value,ruleRepeatCount)\r\n{\r\n\tvar rule = findRule(ruleStr,styleSheet.cssRules,ruleRepeatCount);\r\n var execStr = \"rule.style.\"+property+\"=\"+value;\r\n\trule.style[property] = value;\r\n}",
"onPropertySet(room, property, value, identifier) {\n room[p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the total height of all elements in the selection | function sumOfHeights(selection) {
var sum = 0;
selection.each(function() {
sum += $(this).outerHeight(true);
});
return sum;
} | [
"get height() {\n if ( !this.el ) return;\n\n return ~~this.parent.style.height.replace( 'px', '' );\n }",
"_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(this.options.height, { '%': this.jumper.getAvailableHeight() });\n\t\t}\n\n\t\treturn this.naturalHei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Maps each column that intersects with the given `Rect` argument. See Grid.mapCellsInRect for more details. | mapColumnsInRect(rect, callback) {
const results = [];
if (rect == null) {
return results;
}
const { columnIndexStart, columnIndexEnd } = this.getColumnIndicesInRect(rect);
for (let columnIndex = columnIndexStart; columnIndex <= columnIndexEnd; columnIndex++) {
... | [
"mapCellsInRect(rect, callback) {\n const results = [];\n if (rect == null) {\n return results;\n }\n const { rowIndexStart, rowIndexEnd } = this.getRowIndicesInRect(rect);\n const { columnIndexStart, columnIndexEnd } = this.getColumnIndicesInRect(rect);\n for (l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing Instance resource's state with the given name, ID, and optional extra properties used to qualify the lookup. | static get(name, id, state, opts) {
return new Instance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"static get(name, id, state, opts) {\n return new Snapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) {\n return new Key(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static get(name, id, state, opts) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ PLAYLISTENTRY OBJECT / This part represents a PlaylistEntry Object. A PlaylistEntry is a part of the PlaylistClip. / Creates a PlaylistEntry object | function PlaylistEntry(title) {
// alert("create new playlist entry.");
this.title = title;
this.url = "";
} | [
"function createPlaylistItem(videoID, entryID, title) {\n var url = createYoutubeUrl(videoID);\n var deleteButton = '<a class=\"deletebutton\" href=\"' + PLAYLIST_ENTRY_REM_URL +\n '\">X' + '</a>';\n var img = '<img src=\"https://img.youtube.com/vi/' + videoID + '/sddefault.jp' +\n 'g\" height=\"50\" width=\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check selected fields for highlighting | function HighlightSelectedFields(field_key){
for (var i = 0; i < fields.selected.length; i++) {
if (fields.selected[i] == field_key){
HighlightElement(true, field_key);
}
}
} | [
"highlightSelected() {\n\n this.highlighter.setPosition(this.xStart + this.selected * this.distance, this.yPosition + this.highlighterOffsetY);\n\n }",
"highlight() {\n this.model.set('isSelected', true);\n }",
"checkFeatureForHighlight(feature) {\n //Sanity check\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
water danger zone function starts here | function waterDangerZone() {
//* selects all indexes ranging from 9 - 44 for danger zone/water
if (flareonPosition >= 9 && flareonPosition <= 44 && (!cells[flareonPosition].classList.contains('floatAndFlareonLeft') && !cells[flareonPosition].classList.contains('floatAndFlareonRight'))) {
cells[flareonPosi... | [
"land(){\n while(this.location[2] > 0){ // z > 0\n let dz = this.location[2];\n // dz in feet i assume. 1 < power < 100\n let power = Math.max(1, Math.min(100, dz / 10));\n this.on_signal(Remote.signals().down, power);\n }\n }",
"function waterMovement(container) {\n\t/** Creating inte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new `AWS::S3ObjectLambda::AccessPointPolicy`. | constructor(scope, id, props) {
super(scope, id, { type: CfnAccessPointPolicy.CFN_RESOURCE_TYPE_NAME, properties: props });
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_s3objectlambda_CfnAccessPointPolicyProps(props);
}
catch (error) {
if (process.env.JSII_DEBUG ... | [
"function create(accessKeyId, secretAccessKey) {\n config.accessKeyId = accessKeyId;\n config.secretAccessKey = secretAccessKey;\n\n AWS.config.update(config);\n AWS.config.region = window.AWS_EC2_REGION;\n AWS.config.apiVersions = {\n cloudwatch: '2010-08-01',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When an alert is clicked, this function is called. It sets the property isRead of the Alert to true. | function markAsRead(id) {
var alert = $(`#alert${id}`);
if (!alert.hasClass('alertRead')) {
alert.addClass('alertRead');
res.alertcount = res.alertcount - 1;
updateAlertCount();
}
$.ajax(`/api/User/Alert/${id}/Read`,
{
type: 'PUT',
dataType: 'json'... | [
"static changeReadStatus(target) {\n if (target.classList.contains('read-btn')) {\n target.textContent === 'yes'\n ? (target.textContent = 'no')\n : (target.textContent = 'yes');\n // Success message\n UI.alertMessage('Read status changed', 'success');\n } else {\n return;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the global Bitcoin network. Used for v1 only. | function getNetwork() {
return bitcoinNetwork;
} | [
"static get network()\n\t{\n\t\treturn network;\n\t}",
"function getNetworkName(chainId) {\n if (chainId === CHAIN_ID_MAINNET_ETHEREUM) {\n return \"Mainnet - Ethereum\"\n } else if (chainId === CHAIN_ID_TESTNET_GOERLI) {\n return \"Testnet - Goerli\"\n } else if (chainId === CHAIN_ID_MAINNET_P... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
========================== NAME: addFriends INPUTS: void OUTPUTS: void DESCRIPTION: "addFriends()" clicks every "send friend request" button on the given page. ========================== | function addFriends() {
clickNextButton("Add", defaultAddFriendSelector);
} | [
"function addNewFriend(newfriendname) {\n\n\t$.get(\"/addfriend/\", {jid: newfriendname} );\n\tsendRequest(connection, my_user_name, newfriendname);\n\t\n\t// replace the button with \"Added\"\n\t$('#search-table tr[friendname=\"' + newfriendname + '\"] td:eq(2)').replaceWith('<td>' + '<button disabled=\"disabled\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the crown fire powerofthefire(ft+11 lb+1 ft2 s1). | function powerOfTheFire (fliActive) {
return fliActive / 129
} | [
"function powerOfTheWind (wspd20, rActive) {\n // Difference must be in ft+1 s-1\n const diff = positive((wspd20 - rActive) / 60)\n return 0.00106 * diff * diff * diff\n}",
"function flameLengthThomas (fli) {\n return fli <= 0 ? 0 : 0.2 * Math.pow(fli, 2 / 3)\n} // Active crown fire heat per unit area,",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Constructs an `Observable` that, when subscribed, causes a request with the special method `JSONP` to be dispatched via the interceptor pipeline. The [JSONP pattern]( works around limitations of certain API endpoints that don't support newer, and preferable [CORS]( protocol. JSONP treats the endpoint API as a JavaScrip... | jsonp(url, callbackParam) {
return this.request('JSONP', url, {
params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),
observe: 'body',
responseType: 'json',
});
} | [
"get(aUrl, aCallback)\n {\n let anHttpRequest = new XMLHttpRequest();\n anHttpRequest.onreadystatechange = function()\n {\n if (anHttpRequest.readyState === 4 && anHttpRequest.status === 200)\n aCallback(anHttpRequest.responseText);\n }\n \n anH... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show node with optional color, check if it satisfies possibly set filter | function showNode(node, color) {
if (color) {
setColor(node, color);
}
resetNode(node, 0);
} | [
"function node_colour() {\r\n if (this.value.match('[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]')) {\r\n for (let i = 0; i < nodes.length; i++) {\r\n nodes[i].layer.setStyle({'fillColor': '#' + this.value});\r\n }\r\n design.colours.nodes = this.value;\r\n true_url_encoding(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init MysqlDb If MySQL's config is detected, MySQL's client is stored in app | function initMysqlDb(app)
{
//Mysql
var dbConfig = app.get("config").mysql;
if(dbConfig) {
function handleDisconnect(app) {
var mysql = require('mysql');
connection = mysql.createConnection(dbConfig);
connection.connect(function(err) {
if(err) {... | [
"async _loadDbConfig() {\n //dont trow exception for the case where the database is not installed\n try {\n //get config from db\n const configs = await this._configModel.findAll({})\n //set the config on an object\n await utils.asyncMap(configs, config => {\n this._configs[config.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function: select a company for comparion return error message if more than 2 companies selected otherwise return success information | function onChangeCompcomparison (value){
var templist = [];
for (var i in basedata){
var name = basedata[i].name;
for (var j in value ){
if( name=== value[j]){
templist.push(basedata[i])
}
}
}
if(templist.length !== 0 && templist.... | [
"function onClickPortfolio2(){\n if(compnameComparison[1] === undefined){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operation Success',\n descript... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a list of currently rendered layers. Optionally filter by id. | getLayers({
layerIds
} = {}) {
// Filtering by layerId compares beginning of strings, so that sublayers will be included
// Dependes on the convention of adding suffixes to the parent's layer name
return layerIds ? this.layers.filter(layer => layerIds.find(layerId => layer.id.indexOf(layerId) === 0)) ... | [
"function getLayered() {\n categoryApiService.getLayered({\n categoryID: $scope.categoryId\n }).$promise\n .then(function(response) {\n var result = response.result || [];\n $scope.layered = result;\n angula... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If there are a few items in an element, it is sometimes pronounced as group | function showGroup() {
var ps = document.querySelectorAll('p, nav, section, article');
var i = 0;
while(i < ps.length) {
groupLength = ps[i].childNodes.length;
if(groupLength > 1) {
var groupChild = document.createElement('span');
groupChild.classList.add('vasilis-srm-group');
groupChild.innerHTML = " G... | [
"function isRepeatTest(groupEl) {\n if($(groupEl)[0].tagName !== 'group') {\n return false;\n }\n return $(groupEl).children('repeat').length === 1;\n }",
"visitGroup_by_elements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"facetComplexItems(aItems) {\n let attrKey =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
air hostess drop audio | airHostessAudio() {
$('#air-hostess').trigger('play');
} | [
"function mixedShot() {\n playSound(\"audioMixedShot\");\n }",
"loadSampleOver() {\n const audioOver = this.audioOver\n\n audioOver.defaultPlaybackRate = 1.0\n audioOver.src = db.alerts[0].src\n }",
"resetSampleOver() {\n this.audioOver.pause()\n this.audioOver.cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a list of all plugins installed in the Workspace. | listPlugins() {
return __awaiter(this, void 0, void 0, function* () {
const result = yield this.runPulumiCmd(["plugin", "ls", "--json"]);
return JSON.parse(result.stdout, (key, value) => {
if (key === "installTime" || key === "lastUsedTime") {
return n... | [
"function listPlugins(cmd) {\n\t// load config the same way we do in the run subcommand\n\tlet configFilePath = (cmd.config != null) ? cmd.config : path.join(configdir(\"webhookify\"), \"config.json\");\n\n\tvar config;\n\n\ttry {\n\t\tlet configFile = fs.readFileSync(configFilePath);\n\t\tconfig = JSON.parse(confi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An implementation of Seahaven Towers. Subclass of CardGame. | function seahaven(element, x, y) {
this.constructMe(element);
var i = 0;
this.x = (x==null) ? 0 : x;
this.y = (y==null) ? 0 : y;
this.deck = new CardDeck('seahaven', this.element);
this.holes = new Array(4);
this.stacks = new Array(10);
this.aces = {
spades: this.newLocation(this.x, this.y, 0, 0),... | [
"charlestonPass(player, charlestonPassArray) {\n const delta = player - PLAYER.BOTTOM;\n\n // Insert 3 cards from player 0-3 to the appropriate player\n for (let i = 0; i < 4; i++) {\n const from = i;\n let to = i + delta;\n if (to > 3) {\n to -= ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
How many lightsabers do you own? | function howManyLightsabersDoYouOwn(name) {
if (name === "Zach") {
return 18;
}
return 0;
} | [
"function no_of_on_lights(arr){\n arr = command_executor(arr, Light);\n let on_lights_arr = [];\n for( i = 0; i < 1000; i++){\n for( j = 0; j < 1000; j++){\n if(arr[i][j].on){\n on_lights_arr.push(arr[i][j]);\n }\n }\n }\n let length = on_lights_arr.length;\n return le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
resets interpreter and SequencerStore state to begin the program again, without reparsing code. | function resetInterpreterAndSequencerStore() {
_storesSequencerStoreJs2['default'].resetState();
/* SequencerStore now has new node/link refs,
update via function closure */
stateToNodeConverter = new _StateToNodeConverterStateToNodeConverterJs2['default'](_storesSequencerStoreJs2['default'].linkStat... | [
"function Sequencer() {\n\n var interpreter = undefined;\n var astWithLocations = undefined;\n var stateToNodeConverter = undefined;\n\n function displaySnackBarError(action, message) {\n _storesSequencerStoreJs2['default'].setStepOutput({\n warning: {\n action: action,\n message: '\"' + (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draws the start in the square | function drawStart(x, y, size, alpha){
var blue = color("blue");
blue.setAlpha(alpha);
fill(blue);
//rect(x+size/5, y+size/5, size*3/5);
rect(x+size/4, y+size/4, size/2);
} | [
"function drawSquareSideHouse() {\n moveForward(50);\n turnRight(90);\n}",
"function draw_s() {\n ctx.beginPath()\n canvas_arrow(ctx, passthroughCoords.x - 2, passthroughCoords.y - 2, refractedCoords.x + 2, refractedCoords.y + 2)\n ctx.stroke()\n }",
"function snakeDraw() {\r\n\tstroke... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function stores the data needed to create a slider. Sliders cannot be created unless these two conditions hold true: 1. The page is loaded 2. All the handles and tracks are visible rootPanelId id of the div that encompasses all these divs handleId id of the div that contains the draggable image trackId id of the d... | function addIndicatorSliderData(rootPanelId, handleId, trackId, initialValue, inputElement, indicator, subPanelId) {
// alert('adding indicator for ' + handleId + ', ' + trackId + ', ' + initialValue + ', ' + inputElement + ', ' + indicator + ', ' + subPanelId);
var newSliderData = {};
newSliderData.root... | [
"function addFactorSliderData(rootPanelId, handleId, trackId, sampleSpanId, indicatorId, initialValue, minValue, maxValue, increment, inputElement) {\n// alert('adding factor for ' + handleId + ', ' + trackId + ', ' + initialValue + ', ' + maxValue + ', ' + increment + ', ' + inputElement);\n var newSliderD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recalculate response profile cached objects. | static recalculate(options){
let kparams = {};
kparams.options = options;
return new kaltura.RequestBuilder('responseprofile', 'recalculate', kparams);
} | [
"function getCachedProfiles () {\n return cachedProfiles;\n}",
"_update() {\n var i, pr, inn=0, mer=0, ban=0, bui=0;\n\n for (i in this.profiles) {\n pr = this.profiles[i];\n bui += pr.builder;\n mer += pr.merchant;\n inn += pr.innovator;\n ban... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show Edit Location Detail Modal | function show_edit_location_details (detail_type, detail_id) {
$("#modal_title_location_details").html("Edit " + detail_type);
$("#location_detail_name_label").html( "Location " + detail_type + " name");
$("#location_detail_type").val(detail_type);
$("#location_detail_id").val(detail_id);
$("#location_detail_... | [
"function show_edit_location (location_id) {\n\t\t$(\"#modal_title_location\").html(\"Edit location\");\n\t\t$(\"#location_id\").val(location_id);\n\t\t$(\"#location_name\").val($(\"#location_name_\"+location_id).html());\n\t\t$(\"#location_place\").val($(\"#location_place_\"+location_id).val());\n\t\t$(\"#location... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if x is between a and b, false otherwise. If inclusive is true, also returns true if x equals a or b. | static between(x, a, b, inclusive) {
let greater = Math.max(a, b);
let lesser = Math.min(a, b);
return inclusive ? x >= lesser && x <= greater : x > lesser && x < greater;
} | [
"function between(v, a, b) {\n\treturn ((v >= a) && (v <= b)) || ((v >= b) && (v <= a))\n}",
"function range(a, b) {\n return (((a >= 40 && a <= 60 || a >= 70 && a <= 100)) && ((b >= 40 && b <= 60 || b >= 70 && b <= 100)))\n}",
"inRange (number, start, end) {\n if (end === undefined) {\n end = start\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For the AST in `UpdateExpression.value`: create nodes for pipes, literal arrays and, literal maps, update the AST to replace pipes, literal arrays and, literal maps with calls to check fn. WARNING: This might create new nodeDefs (for pipes and literal arrays and literal maps)! | _preprocessUpdateExpression(expression) {
return {
nodeIndex: expression.nodeIndex,
bindingIndex: expression.bindingIndex,
sourceSpan: expression.sourceSpan,
context: expression.context,
value: convertPropertyBindingBuiltins({
createLit... | [
"visitUpdate_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitFor_update_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function mutate(parser) {\n return transformer\n function transformer(node, file) {\n return hast2nlcst(node, file, parser)\n }\n}",
"visitComparison(ctx)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extends the angular scope with a child provided as a child from given object found by the given name | function extendWith(name, object) {
this[name] = {};
var obj = object[name];
angular.extend(this[name], obj);
} | [
"function extendWithAndListen(name, object) {\n var oldObj = this[name];\n\n //if it already exists under the same structure, don't readd, do it only when we have a different object structure\n if (oldObj != undefined && angular.equals(Object.keys(oldObj), Object.keys(object)))\n return;\n\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update Port Data in the Store & server by its ID. | update ({ commit, getters }, { processId, portId, id, data }) {
return new Promise( (resolve, reject) => {
// Try to send data on the server.
apiPortData.update( processId, portId, id, data ).then(response => {
// console.log("PortData Store, 'update' action, API response:")
// console.l... | [
"updateById(id, data) {\n return this.post('/' + id + '/edit', data);\n }",
"update ( data ) {\n this.store.update(data);\n }",
"set(id, data) {\n let oldData = this.raw();\n oldData[id] = data;\n this._write(oldData);\n }",
"update(req, res) {\n Origin.update(req.body, {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function fcnModifyWeekMatchReport() This function modifies the Week Number in the Match Report Form | function fcnModifyWeekMatchReport(ss, shtConfig){
var shtIDs = shtConfig.getRange(17,7,20,1).getValues();
var MatchFormEN = FormApp.openById(shtIDs[6][0]);
var FormItemEN = MatchFormEN.getItems();
var NbFormItem = FormItemEN.length;
var MatchFormFR = FormApp.openById(shtIDs[7][0]);
var FormItemFR = Matc... | [
"function fcnPostResultWeekWG(ss, ConfigData, ResultData, shtTest) {\n\n // Code Execution Options\n var OptTCGBooster = ConfigData[3][0];\n var OptWargame = ConfigData[4][0];\n var cfgWeekRound = ConfigData[10][0];\n var OptWeekEscalation = ConfigData[12][0];\n var ColEscalationBonus = ConfigData[29][0];\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Indicates whether the current item within a repeat context has an even index. | get isEven() {
return this.index % 2 === 0;
} | [
"itemCanBeRendered(index) {\n const { cols, lazyLoad } = this.props;\n const { scrolledOnce } = this.state;\n\n if (!lazyLoad || scrolledOnce) {\n return true;\n }\n\n return index <= cols;\n }",
"_updateItemIndexContext() {\r\n const viewContainer = this._nodeOutlet.viewContainer;\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
jobListMenuToggle function that scales the map with the job lists menu | function jobListMenuToggle(){
$('.sidebar').toggleClass('sidebarHide')
$('.item1').toggleClass('select')
if($('.map').hasClass('mapWithoutInfo')){
$('.map').toggleClass('mapWithoutAnything')
} else if ($('.map').hasClass('mapWithoutAnything')){
$('.map').toggleClass('mapWithoutAnything')... | [
"function jobStatsMenuToggle(){\n $('.jobStats').toggleClass('jobStatsHide')\n $('.item4').toggleClass('select')\n if($('.map').hasClass('mapWithoutList')){\n $('.map').toggleClass('mapWithoutAnything')\n } else if ($('.map').hasClass('mapWithoutAnything')){\n $('.map').toggleClass('mapWit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the left coordinate of the specified element relative to the specified parent. | function getRelativeLeft(element, parent) {
if (element === null) {
return 0;
}
var elementPosition = getTopLeftOffset(element);
var parentPosition = getTopLeftOffset(parent);
return elementPosition.left - parentPosition.left;
} | [
"getElementX(el) {\n var parent = this.myRef.current;\n var center = parent.clientWidth / 2;\n var left = el.offsetLeft - parent.offsetLeft;\n return left - center;\n }",
"function calculateOffsetLeft(r){\n return absolute_offset(r,\"offsetLeft\")\n}",
"function aeGetCenterLeft(a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to parse root element (child node of xs:schema) | function handleRootElement(root, obj, attr){
//name attribute should always be present for root element
var ele = {};
if(obj.attributes.name){
ele['name']= obj.attributes.name;
}
//specified the name of built-in type / simpleType / complexType
if(obj.attributes.type){
e... | [
"visitXmlschema_spec(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitXmlroot_param_standalone_part(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function cXparse(src) {\n var frag = new _frag();\n\n // remove bad \\r characters and the prolog\n frag.str = _prolog(src);\n\n // create a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine if the route handles a given method. | _handles_method(method) {
if (this.methods._all) {
return true;
}
let name = method.toLowerCase();
if (name === 'head' && !this.methods['head']) {
name = 'get';
}
return Boolean(this.methods[name]);
} | [
"function isMethod(node) {\n\t return node.kind() == \"Method\" && node.RAMLVersion() == \"RAML10\";\n\t}",
"function isMethod(node) {\n\t return node.kind() == \"Method\" && node.RAMLVersion() == \"RAML08\";\n\t}",
"function currentCFChasMethod(methodName)\n{\n\tvar CFCComponentRec = getCurrentCFCCompone... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load full data from data.ja (fleet) and store them in different arrays like car, dron, default of constructor | loadData(fleet) {
for (let data of fleet) {
switch (data.type) {
case 'car':
if (this.validateCarData(data)) {
let car = this.loadCar(data);
this.cars.push(car);
} else {
... | [
"read_data_info() {\n this.json.data_info = {};\n this.add_string(this.json.data_info, \"date_and_time\");\n this.add_string(this.json.data_info, \"scan_summary\");\n this.json.data_info.apply_data_calibration = this.ole.read_bool();\n this.add_string(this.json.data_info, \"data_calibration_file\");\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if other is an inclusive descendant of node, and false otherwise. | contains(other) {
if (!other) {
return false;
}
return other === this || this.isDescendant(other);
} | [
"function isDescendantOf(a, b){\n\tif (a === b) return true\n\tif (descendantsLookup[b]) {\n\t\tif (descendantsLookup[b].indexOf(a) >= 0) return true;\n\t}\n\treturn false;\n}",
"function isInclusiveDescendant(descendant, ancestor) {\n return descendant === ancestor || isDescendant(descendant, ancestor);\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
viewAnimals shows the user species index while thy are prompted to choose the index they want to view then it shows them the list of animals with their indexes, with the option to 'adopt' an animal they are viewing or return to the previous menu | viewAnimals() {
let speciesString = '';
for (let i =0; i < this.animalSpecies.length; i++) {
speciesString += i + ') ' + this.animalSpecies[i].name + '\n';
}
let index = prompt(`${speciesString}` + '\n' +
'----------------------------------------' + '\n' +
'En... | [
"surrenderAnimal() {\n let speciesString = '';\n for (let i =0; i < this.animalSpecies.length; i++) {\n speciesString += i + ') ' + this.animalSpecies[i].name + '\\n';\n }\n let info = 'species index: ' + '\\n' + `${speciesString}`;\n\n let selection = this.showSurrende... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates Program sheet when the number of projects is edited | function onEdit(e){
if (e.range.getA1Notation() === projectCountCell) {
var projectCountValue = sh.getRange(projectCountCell).getValue();
sh.getRange('A' + projectStartCell + ':B200').clear().clearNote().setDataValidation(null);
// Copies the project template range as many times as specified in projectCo... | [
"function updateProjectTaskHours() {\n var error = checkControlValues();\n if (error != \"\") {\n Browser.msgBox(\"ERROR:Values in the Controls sheet have not been set. Please fix the following error:\\n \" + error);\n return;\n }\n\n var successCount = 0;\n\n var result = JSON.parse(ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convenience function to create a TVML alert document with a title and description. | function createAlertDocument(title, description, isModal) {
// Ensure the text color is appropriate if the alert isn't going to be shown modally.
const textStyle = (isModal) ? "" : "color: rgb(0,0,0)";
const template = `<?xml version="1.0" encoding="UTF-8" ?>
<document>
<alertTemplate... | [
"function createNotificationTitanium(title, message) {\n notification.setTitle(title);\n notification.setMessage(message);\n notification.show();\n }",
"function createAlert_return(alert, textAlert) {\n var result = \"<div class=\\\"col-md-12\\\"><div class=\\\"alert alert-\" + alert + \"\\\">\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
> true Write a function called "isPersonOldEnoughToVote". Given a "person" object, that contains an "age" property, "isPersonOldEnoughToVote" returns whether the given person is old enough to vote. Notes: The legal voting age in the United States is 18. | function isPersonOldEnoughToVote(person) {
if(person.age >= 18){
return true;
} else{
return false;
}
} | [
"function votingAge(age) {\n if (age > 18) {\n return true;\n }\n\n return false;\n}",
"function isPersonOldEnoughToDrinkAndDrive(obj){\n \n //the condition below checks whether the age satisfies the condition. If the condition is met it returns false\n //because it is illegal to drive an... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes all Sass files and runs Sass Lint on them with default formatting. The force element nesting rule is disabled because to override bootstrap styles we often need really specific element nesting, and nesting them inside each other will violate the nesting depth rule, which is more important. | function sassLint() {
return gulp.src(paths.sass)
.pipe(plugins.sassLint({
rules: {
'force-element-nesting': 0
}
}))
.pipe(plugins.sassLint.format())
.pipe(plugins.sassLint.failOnError())
} | [
"function watchFiles() {\n watch(\n ['static/scss/*.scss', 'static/scss/**/*.scss'],\n { events: 'all', ignoreInitial: false },\n series(sassLint, buildStyles)\n );\n}",
"'css.stylelintPaths'(settings) {\n return [\n // `src/assets/css/**/*.scss`,\n `src/assets/scss/**/*.scss`,\n `src... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Defines the set of plugins used by Konekti and executes the KonektiMain function | uses(){
if( KonektiMain !== undefined ) this.plugin.load(arguments, KonektiMain)
else this.plugin.load(arguments)
} | [
"function _loadPlugins() {\r\n\tlogger.entry(\"_loadPlugins\");\r\n\r\n\t// for now just call load plugins, because the node process ends after each tool run and each call to flow.\r\n\tpluginLoader.loadPlugins();\r\n\t\r\n\tlogger.exit(\"_loadPlugins\");\r\n}",
"function init() {\n var _this = this;\n\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders a tile Sprite to a 2d context ad the x,y position. | function renderTile(targetContext, tileSprite, x, y) {
if(targetContext != null){
targetContext.drawImage(GameCircle.currentMap.tileMapManager.spriteImage, tileSprite.xPos, tileSprite.yPos,
GameCircle.currentMap.tileMapManager.tileWidth, GameCircle.currentMap.tileMapManager.tileHeight,
x,y, GameCircle.curren... | [
"function drawSprite(img, row,column, x,y, width,height) {\n\t//set default parameters if not specified\n\tif(!row) row = 0;\n\tif(!column) column = 0;\n\tif(!x) x = 0;\n\tif(!y) y = 0;\n\tif(!width) width = img.spriteWidth;\n\tif(!height) height = img.spriteHeight;\n\t\n\tvar sourceX=Math.floor(Math.floor(column) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate signature for a last.fm API call | function getAPISignature(params) {
var sig = '';
var keys = new Array();
for (var p in params) {
if (p != 'format' && p != 'callback') {
keys.push(p);
}
}
keys.sort();
for (var k in keys) {
sig = sig + keys[k] + params[keys[k]];
}
//append secret and generate MD5 hash... | [
"function genOAuthSig (options) {\n\n log(options.verbose,\"Now generating OAuth sig ...\");\n\n // Build an array of all the parameters we need to include in the signature.\n // Signature parameters are in the format {key,value}, both the key and the\n // value need to be RFC3986 percent encoded.\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If an occurrence occurs 5 times after a prefix, and the prefix's total is 43, the occurrence has 5/43 chance of being chosen | function randomOccurance(chain, prefix) {
var index = -1;
var tracker = randint(1, chain[prefix]['total']);
while (tracker >= 1) {
index += 1;
var currentOccurance = chain[prefix]['occurances'][index];
tracker -= chain[prefix][currentOccurance];
}
return chain[prefix]['occurances'][index];
} | [
"function generateNumberToMatch() {\n return Math.floor(Math.random() * 102) + 19;\n}",
"function scoreOneWord(s) {\n if (s.length < 3) {\n return 1;\n } else if (s.length < 5) {\n return 1;\n } else {\n return 1;\n }\n}",
"function featured(number) {\n if (number > 98765432... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getFilters returns current filters | function getFilters() {
return _filters;
} | [
"getFilters(key, appliedFilters) {\n let filters = [];\n //let appliedFilters = Object.assign({}, this.state.appliedFilters);\n return Object.keys(appliedFilters).map(k => { \n let next = appliedFilters[k];\n if (next && next.willFilter && next.willFilter.length > 0 ) {\n let will = next.w... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
render the credit form | function renderCreditForm()
{
var tableBody = $("#credit_content").find("tbody");
tableBody.empty();
// render pagination
renderCreditFormPagination();
for(var i = 0; i < 4; i++)
{
var index = i + showPage * CREDIT_NUM_PAGE;
var credit = creditList[index];
var tableRow... | [
"function creditCARow(row){ \n if (formatAmount(document.getElementById('amtCreditCA_'+row),'CA')){ \n CCT.index.creditCARow(row,gOldCACreditAmt[row],document.getElementById('emailCreditCA_'+row).value\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new HTML document. `title` document title | createHTMLDocument(title) {
throw new Error("This DOM method is not implemented.");
} | [
"function html_document(title, body, favicon, stylesheets, scripts) {\n\tif (stylesheets === undefined) stylesheets = [];\n\tif (scripts === undefined) scripts = [];\n\tif (favicon !== undefined) {\n\t\tfavicon_type = { 'ico': 'image/x-icon', 'gif': 'image/gif', 'png': 'image/png' }[favicon.substring(favicon.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MEX_FillDictAssignment ========= MEXQ_FillDictKeys ============= PR20220118 | function MEXQ_FillDictKeys(exam_dict) {
//console.log("===== MEXQ_FillDictKeys =====");
if(exam_dict && exam_dict.keys){
// - get array of partial exams
const k_partex_arr = exam_dict.keys.split("#");
// k_partex_arr = ['1|7;ab|8;c']
//console.log("k_partex_arr", k_pa... | [
"function MDUO_FillDict() {\n console.log(\"===== MDUO_FillDict =====\");\n\n b_clear_dict(mod_MDUO_dict);\n\n mod_MDUO_dict.duo_subject_dicts = {};\n\n if(!isEmpty(duo_subject_dicts)){\n for (const [mapid, data_dict] of Object.entries(duo_subject_dicts)) {\n mo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the setup dialog. | function showSetupDialog() {
openDialog('/html/setup.html', 500, 660);
} | [
"function showOpenSeed (opts) {\n setTitle(opts.title)\n const selectedPaths = dialog.showOpenDialogSync(windows.main.win, opts)\n resetTitle()\n if (!Array.isArray(selectedPaths)) return\n windows.main.dispatch('showCreateTorrent', selectedPaths)\n}",
"function openOptionsPage() {\n runtime.openOptionsPa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| | Initialize i18n | | function initializeI18n() {
var language = app.utils.i18n.getLanguage();
i18next
.use(i18nextXHRBackend)
.init({
lng: language.lang,
fallbackLng: 'en',
whitelist: ['en', 'hi', 'ar'],
nonExplicitWhitelist: true,
prelo... | [
"constructor() { \n \n LocalizationRead.initialize(this);\n }",
"function add_i18n()\n {\n var i18n = {};\n\n i18n[I18N.LANG.EN] = {};\n i18n[I18N.LANG.EN][MODULE_NAME + '_short_desc'] = 'Hide RP content';\n i18n[I18N.LANG.EN][MODULE_NAME + '_full_desc'] = 'Hide all... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParservalueArguments. | enterValueArguments(ctx) {
} | [
"visitVarargslist(ctx) {\r\n console.log(\"visitVarargslist\");\r\n // TODO: support *args, **kwargs\r\n let length = ctx.getChildCount();\r\n let returnlist = [];\r\n let comma = [];\r\n let current = -1;\r\n if (ctx.STAR() === null && ctx.POWER() === null) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Headers for sending to the origin server to revalidate stale response. Allows server to return 304 to allow reuse of the previous response. Hop by hop headers are always stripped. Revalidation headers may be added or removed, depending on request. | revalidationHeaders(incomingReq) {
this._assertRequestHasHeaders(incomingReq);
const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers);
// This implementation does not understand range requests
delete headers['if-range'];
if (!this._requestMatches(incomingReq, tru... | [
"copyHeaders(clientRes, serverRes) {\n Object.entries(clientRes.headers.raw()).forEach(([key, value]) => {\n if (key.toLowerCase() === \"location\") {\n //handle location redirects to hide microservice\n let newLocation = new URL(value[0]);\n newLocatio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change the subscription button's text and action. | function showSubscribeButton() {
subscriptionButton.onclick = subscribe;
subscriptionButton.textContent = 'Click to Subscribe';
subscriptionButton.removeAttribute('disabled');
subscriptionCard.style.display = "inline-block";
} | [
"function updateBtn() {\n if (btn.textContent === \"Turn On\") {\n btn.textContent = \"Turn Off\";\n msg.textContent = \"This is currently on\";\n } else {\n btn.textContent = \"Turn On\";\n msg.textContent = \"This is currently off\";\n }\n}",
"function changeAddToCartText() {\n\t$( document ).on(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FormData event is sent on submission, so we can modify the data before transmission. It has a .formData property, and that's all we need. | handleFormData({formData}) {
// add our name and value to the form's submission data if we're not disabled
if (!this.input.disabled) {
// https://developer.mozilla.org/en-US/docs/Web/API/FormData
formData.append(this.input.name, this.input.value);
}
} | [
"function getFormData() {\n return formRef.current;\n }",
"function formData() {\n return new FormData();\n}",
"connectedCallback() {\n this._form = this.findContainingForm();\n if (this._form) {\n this._form.addEventListener('formdata', this._handleFormData);\n }\n }",
"function nor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterate this descender once processing any constraints that are resolvable on the current value. Returns an array of new descenders that are guaranteed to be without constraints in the head | iterate(probe) {
var result = [this];
if (this.head && this.head.isConstraint()) {
var anyConstraints = true; // Keep rewriting constraints until there are none left
while (anyConstraints) {
result = (0, _flatten2.default)(result.map(descender => {
return descender.iterateConstra... | [
"visitOut_of_line_constraint(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitConstraint_clauses(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"deleteVertex(vertex) {\n\t\t\tlet freeOfConstraint;\n\t\t\tlet iterEdges = new FromVertexToOutgoingEdges();\n\t\t\titerEdges.fromVertex = vertex;\n\t\t\tit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
clearDataForm will set the value of each input element on the pageNewDataForm element to be "" | function clearDataForm() {
$("#datInputDateTime").val("");
$("#numTotalPeople").val("");
} | [
"function clear_form(){\n $(form_fields.all).val('');\n }",
"function clearForm() {\n form.reset();\n }",
"function clearFormFields() {\n newTaskNameInput.value = \"\";\n newTaskDescription.value = \"\";\n newTaskAssignedTo.value = \"\";\n newTaskDueDate.value = \"\";\n newTaskStatus.va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the review status changed to approved, go ahead and mark the create a new entry flag | @action
statusChangeAction(field, value) {
if (value == 'approved') {
this.editEntry.set('create_entry', 1);
}
} | [
"static addReviewToPending(review) {\r\n return DBHelper.putDataInDb(DBHelper.PENDING_REVIEWS, [review]);\r\n }",
"static approve(entryId){\n\t\tlet kparams = {};\n\t\tkparams.entryId = entryId;\n\t\treturn new kaltura.RequestBuilder('baseentry', 'approve', kparams);\n\t}",
"function toggleApproval(ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggered by the change of instrument type | onChangeInstrumentHandler (i,value) {
const instruments = this.state.instruments.slice();
const instrument = instruments[i];
if(instrument.type != value){
instrument.type = value;
instruments[i] = instrument;
this.setState({instruments:instruments});
}
console.log('******Instrument... | [
"function synthType(type) {\n selectedSound = type;\n}",
"onChangeSkinningType() {\n let data = {\n detail: {\n type: this.controls['Skinning Type'],\n },\n };\n window.dispatchEvent(new CustomEvent('on-change-skinning-type', data));\n }",
"function changeInstrument() {\n instrume... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears all selects after and including the given one. | clear_selects_after_and_including(select) {
let next;
select.empty().html('<option></option>');
if (next = this.next_select(select)) { return this.clear_selects_after_and_including(next); }
} | [
"function clearAllSelection(){\n ds.clearSelection();\n arrDisp.length=0;\n updateSelDisplay();\n updateCurrSelection('','','startIndex',0);\n updateCurrSelection('','','endIndex',0);\n}",
"resetOptions(){\r\n\t\t// reset all extras;\r\n\t\tconst $selects = $('.sm-box').find('select');\r\n\t\t$($selects).eac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a value from the `directives` array. | function loadDirective(index) {
ngDevMode && assertNotNull(directives, 'Directives array should be defined if reading a dir.');
ngDevMode && assertDataInRange(index, directives);
return directives[index];
} | [
"function getVariableTypeFromDirectiveContext(value, query, templateElement) {\n for (const { directive } of templateElement.directives) {\n const context = query.getTemplateContext(directive.type.reference);\n if (context) {\n const member = context.get(value);\n if (member &... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prerender the tiles to make drawing fast. | function prerender() {
if (tileEngine.layers) {
tileEngine.layers.map(function (layer) {
layer._d = false;
layerMap[layer.name] = layer;
if (layer.visible !== false) {
tileEngine._r(layer, offscreenContext);
}
});
}
} | [
"rescaleTiles() {}",
"function renderContinuous() {\n\n mctx.clearRect(0, 0, mcanvas.width, mcanvas.height );\n\n for (var el in map) {\n mctx.drawImage( map[el].buffer, \n map[el].ref.x - map[el].ref.width/2, \n map[el].ref.y - map[el... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds (and possibly interpolates) the value for the specified year. | function interpolateValues(values, year) {
var i = bisect.left(values, year, 0, values.length - 1),
a = values[i];
return a[1];
} | [
"function get_value_of_year_datum(f, yr, ck=current_key) {\n\tyr = parseInt(yr);\n\treturn mort_data['$'.concat(f)] && mort_data['$'.concat(f)]['$'.concat(ck)][yr];\n}",
"function getYearData(year){\n year = (year instanceof Date) ? year.getFullYear() : year;\n if (data[year] === undefined) throw Error(\"No... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end onready GET tasks stored in db to display on DOM | function getTasks() {
$.ajax({
type: 'GET',
url: '/tasks',
//on success...
success: function(response) {
//verify data from db
console.log('Retrieved tasks from db: ', response);
//call to display tasks on DOM
displayOnDom(response);
}//end success
});//end GET
}//end get... | [
"load_tasks() {\n this.create_header();\n this.clear_tasks();\n this.get_tasks();\n }",
"function loadTask()\n {\n \tsendAjax({\n \t\turl:'/result/all'\n },function(data){\n $('#ResultTask').empty();\n $.each(data,function(index,value){\n \tvar detail = '<t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provides api Redux state or return empty object for compatibility that allows to use this func as data without checking that props.api exists | getApi(){
if (!this.props.api){
return {};
}
return this.props.api;
} | [
"function get_url(){\n return this.state.api_url;\n}",
"fullState() {\n return Object.assign({}, this.state, this.internals);\n }",
"apiCall(props) {\n\n let url_call = SWAPI_ROOT_URL.replace(\"{stat_type}\", props.stat_type).replace(\"{number}\", props.number);\n\n // The actual fetch\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If this getter returns true, then default components are created for this InternalNode. It can be overriden in subclasses. | get useDefaultComponents() { return true } | [
"generateComponent(scriptName) {\n if (!this._store[scriptName]) {\n return null;\n }\n\n let component = Object.create(this._store[scriptName].prototype);\n component._name = scriptName;\n\n // now we need to assign all the instance properties defined:\n let properties = this._store[scriptNa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generates the commandline help text. | renderHelpText() {
return this._getArgumentParser().formatHelp();
} | [
"function printHelp() {\n var spathToDocumentation = process.argv[1].split(PATH.sep), shelp;\n\n spathToDocumentation.pop();\n spathToDocumentation.push(PATH.sep + 'documentation.txt');\n shelp = FS.readFileSync(spathToDocumentation.join(PATH.sep),\n {'encoding': 'utf8'});\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by ObjectiveCPreprocessorParserpreprocessorBinary. | exitPreprocessorBinary(ctx) {
} | [
"exitPreprocessorParenthesis(ctx) {\n\t}",
"exitPreprocessorDef(ctx) {\n\t}",
"exitPreprocessorConditional(ctx) {\n\t}",
"exitPreprocessorNot(ctx) {\n\t}",
"exitOrdinaryCompilation(ctx) {\n\t}",
"exitPreprocessorDefined(ctx) {\n\t}",
"exitPreprocessorImport(ctx) {\n\t}",
"exitPreprocessorDefine(ctx) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inserts a pool record into Dynamo. | function insertPoolRecord(dynamo, config, pool) {
return dynamo.put(insertRequest(config, poolItem(config, pool))).promise();
} | [
"function insertPoolListRecord(dynamo, config, pool) {\n return dynamo\n .put(insertRequest(config, poolListItem(config, pool)))\n .promise();\n}",
"async function addDataToPool(newData, newMetaData){\n dataPool.unshift({data:newData, meta:newMetaData})\n}",
"reserve(attraction, account_id, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new component instance from given description. | createComponent(description, parentNode) {
const ComponentClass = description.component;
if (ComponentClass.prototype instanceof opr.Toolkit.Root) {
return this.createRoot(
description, parentNode && parentNode.rootNode,
/*= requireCustomElement */ true);
}
const ... | [
"createFromDescription(description, parentNode) {\n if (!description) {\n return null;\n }\n switch (description.type) {\n case 'component':\n return this.createComponent(description, parentNode);\n case 'element':\n return new opr.Toolkit.VirtualElement(descrip... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive a close message from the seller. This happens for random reasons as well as when the funds are depleted. | function receive_close() {
set_ui_state(UI_STATES.FUNDS_DEPLETED);
set_channel_state(CHANNEL_STATES.RECEIVED_CLOSE);
cancel_payments();
} | [
"async close() {\n this.resolveClose(this.data);\n }",
"function handleClose () {\n setNotificationInfo({ openNotification: false })\n }",
"close () {\n if (this.closed) {\n // TODO: this should do something meaningful. May be throw an error or reject a Promise?\n return\n }\n if (!th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hide the account options for the currently logged in user (e.g. My account, Logout) | function hideAccountOptions() {
accountOptionsRef.current.classList.add("hidden");
} | [
"function showAccountOptions() {\n accountOptionsRef.current.classList.remove(\"hidden\");\n }",
"function HideAuth(){\n\t\n\tif ($j(\"#mykmx_login\"))\n\t\t$j(\"#mykmx_login\").toggleClass(\"hide\");\n\t\n\tif ($j(\"#myCarMax_login\"))\n\t\t$j(\"#myCarMax_login\").css(\"display\", \"block\");\n\t\n\tif... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bfs(): Traverse the array using BFS. Return an array of visited nodes. BFS: implement with a QUEUE | bfs() {
// initialize empty QUEUE
let queue = []
// initialize visited nodes
let visited = []
// initialize currentNode as root
let currentNode = this.root
// add root to the QUEUE
queue.push(currentNode)
// implement a while loop: while a queue exists...
while(queue.le... | [
"traverseBreadth(){\n let queue = new Queue();\n let arr = [];\n let current = this.root;\n\n queue.enqueue( current );\n\n while( queue.size > 0 ){\n\n current = queue.dequeue().val;\n arr.push( current.value );\n\n if( current.left !== null ) que... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure the senator data into a format that can be properly bounded to and represented by the graph | function configureSenatorData(data) {
var graphData = new Array(data.length);
var voteMin, voteMax, speechMin, speechMax;
var speechMagnitude;
var isRandom = 0;
var _fillC, _strokeC, _cssClass;
for (var i = 0; i < data.length; i++) {
//assign our colors
... | [
"function configureStateData(){\n var dataPtr = _stateData.objects.states.geometries;\n\n for(var j = 0; j < dataPtr.length; j++){\n dataPtr[j].properties.senators = new Array();\n dataPtr[j].properties.scoreAvg = 0;\n }\n for(var i = 0; i < _senatorData.length; i++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
RANDOM 2 OR 4/////////////////////////////////////////// //////////////////start 1st random box of the game | function random_start()
{
var random = Math.floor(Math.random()*(height*width));
var two_four = random_two_four();
$(".empty:eq("+random+")").removeClass('empty').addClass(two_four);
} | [
"function randomSquare1() {\n selected1 = squares[randomNum()]\n }",
"function randomSquare2() {\n selected2 = squares[randomNum()]\n }",
"function spawnBox(rate){\r\n\tif(difficulty%rate == 0){\r\n\t\tvar box = new Box(Math.floor(Math.random() * 1060) + 1030);\r\n\t\tBoxes.push(box);\r\n\t}\r\n}",
"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an input and the area of the image, return an array containing the counts of each pixel occurrence for each layer | function getLayerCounts(input, area) {
const layers = [];
for (const layer of getLayers(input, area)) {
const map = {};
for (let char of layer) {
map[char] = (map[char] || 0) + 1;
}
layers.push(map);
}
return layers;
} | [
"function getCountedObjects(){\n var counted = {};\n for (var i = 0; i < detections.length; i++){\n var lbl = detections[i].label;\n if (!counted[lbl]) counted[lbl] = 0;\n counted[lbl]++;\n }\n return counted;\n}",
"function countArcsInLayers(layers, arcs) {\n var counts = new Uint32Array(arcs.size(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a babel AST path to a tagged template literal, return an AST if it is a graphql literal being used in a valid way. If it is some other type of template literal then return nothing. | function getValidGraphQLTag(path: any): ?DocumentNode {
const tag = path.get('tag');
if (!tag.isIdentifier({name: 'graphql'})) {
return null;
}
const quasis = path.node.quasi.quasis;
if (quasis.length !== 1) {
throw new Error(
'BabelPluginRelay: Substitutions are not allowed in graphql fragme... | [
"function validLiteral(node) {\n if (node && node.type === 'Literal' && typeof node.value === 'string') {\n return true;\n }\n return false;\n}",
"function isLiteral(node) {\n return node && node.type === typescript_estree_1.AST_NODE_TYPES.TSTypeLiteral;\n }",
"_isLiteral(token... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This sets the score for each level of the game | setScore() {
this.#gameScore += this.#rules[this.#gameLevel - 1].score
document.dispatchEvent(this.#gameScoreEvent)
} | [
"function updateScore() {\n\t\t\t// Score rule: pass level n in t seconds get ((100 * n) + (180 - t)) points \n\tlevelScore = (levelTime + 100) + Math.floor(levelTime * (currentLevel-1));\n\t// Set original \"levelScore\" to extraLevelScore for testing purpose\n\tfinalScore += levelScore + extraLevelScore;\t\t\n\t/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cancels installation of this addon. Note this method is overridden to handle additional state in the subclass DownloadAddonInstall. | cancel() {
switch (this.state) {
case AddonManager.STATE_AVAILABLE:
case AddonManager.STATE_DOWNLOADED:
logger.debug("Cancelling download of " + this.sourceURI.spec);
this.state = AddonManager.STATE_CANCELLED;
XPIInstall.installs.delete(this);
this._callInstallListeners("onDownloadCa... | [
"startDownload() {\n this.downloadStartedAt = Cu.now();\n\n this.state = AddonManager.STATE_DOWNLOADING;\n if (!this._callInstallListeners(\"onDownloadStarted\")) {\n logger.debug(\"onDownloadStarted listeners cancelled installation of addon \" + this.sourceURI.spec);\n this.state = AddonManager.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the team with the new tag | async updateTeam () {
const tagId = this.request.params.id;
const tag = this.request.body;
const tags = this.team.get('tags') || {};
if (!tags[tagId]) {
throw this.errorHandler.error('notFound', { info: 'tag' });
}
const op = {
$set: {
modifiedAt: Date.now(),
[`tags.${tagId}`]: tag
}
};
... | [
"async function updateForProject(projectId, tags) {\n // We remove existent tags for that project\n removeForProject(projectId);\n\n if (!tags.length) return;\n\n // We add new ones\n const rows = tags.map((tag) => ({\n tag,\n project_id: projectId\n }));\n\n await knex('tags').insert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool ColorPicker4(const char label, float col[4], ImGuiColorEditFlags flags = 0, const float ref_col = NULL); | function ColorPicker4(label, col, flags = 0, ref_col = null) {
const _col = import_Color4(col);
const _ref_col = ref_col ? import_Color4(ref_col) : null;
const ret = bind.ColorPicker4(label, _col, flags, _ref_col);
export_Color4(_col, col);
if (_ref_col && ref_col) {
... | [
"function ColorEdit4(label, col, flags = 0) {\r\n const _col = import_Color4(col);\r\n const ret = bind.ColorEdit4(label, _col, flags);\r\n export_Color4(_col, col);\r\n return ret;\r\n }",
"function airsliderSlidesColorPicker() {\n $('.air-admin #air-slides .air... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
refresh dashboard after the visualization create in kibana | function refreshDashboard(iNewVisArr) {
let newUrl = KibanaApiService.generateUrl(getAppState(), globalState, iNewVisArr);
kbnUrl.change(newUrl);
$route.reload();
} | [
"function runDashboardFixes() {\n\n //console.log(\"Running fixes ... \");\n\n // Fix pie chart colors\n setPieSliceColor(\"New\", red);\n setPieSliceColor(\"In Progress\", yellow);\n setPieSliceColor(\"Done\", green);\n setPieSliceColor(\"Closed\", green);\n setPieSliceColor(\"In Test\", blue)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
setup_environment makes an environment that has one single frame, and adds a binding of all names listed as primitive_functions and primitive_values. The values of primitive functions are "primitive" objects, see line 281 how such functions are applied | function setup_environment() {
const primitive_function_names =
map(f => head(f), primitive_functions);
const primitive_function_values =
map(f => make_primitive_function(head(tail(f))),
primitive_functions);
const primitive_constant_names =
map(f => head(f), primitive_co... | [
"function setup_environment() {\n var initial_env = enclose_by(an_empty_frame,\n the_empty_environment);\n for_each(function(x) {\n define_variable(head(x),\n { tag: \"primitive\",\n implementation: tail(x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if a parentelemet contains a dom id deals with event bubbling so we can check if the child is in a specifc parent | function ParentContains(target, id) {
for (var p = target && target.parentElement; p; p = p.parentElement) {
if (p.id === id) {
return true;
}
}
return false;
} | [
"function ancestorHasId(el, id) {\n var outcome = (el.id === id);\n while (el.parentElement && !outcome) {\n el = el.parentElement;\n outcome = (el.id === id);\n }\n return outcome;\n}",
"function contains(target, child) {\n let head = child.parentNode;\n\n while(head != null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |