query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Creates a new short answer question with a given title. | constructor(title) {
this._type = 'short_answer';
this._title = title;
this._uuid = generateUUID();
} | [
"function addQuestionShortAnswer() {\n let formValues = formToFieldList('saForm');\n // Will Return List with the following:\n // Index 0: Question Title\n\n let saTitle = formValues[0];\n\n let saQuestion = new ShortAnswerQuestion(saTitle);\n\n questionList.push(saQuestion);\n addRowShortAnswe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the current user from the users list based on storage.currentLoggedInUserEmail | function getCurrentUser() {
let storage = LocalStorageManager.getStorage();
if (storage.currentLoggedInUserEmail !== null) {
// the email was not null, so there is a logged in user
for (let i in storage.users) {
// loop through all users and find the one with the... | [
"function getLoginUser() {\n\t\tlet getUserDetails = localStorageService.getLoggedInUserInfo();\n\t\tlet userDetails = JSON.parse(getUserDetails);\n\t\tlet loginUserGroup = userDetails.userGroup;\n\t\tif (loginUserGroup !== 'Administrator' && loginUserGroup !== 'Manager') {\n\t\t\tvm.reporter = userDetails.userId;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Caricamento via Ajax della tabella dei documenti e visualizzazione. | function visualizzaTabellaDocumenti() {
var options = {
bServerSide: true,
sAjaxSource: "risultatiRicercaDocumentoEntrataAjax.do",
sServerMethod: "POST",
bPaginate: true,
bLengthChange: false,
iDisplayLength: 10,
bSort: false,
... | [
"function alimenterNews() {\n\t$('#numeroPage').val($.isNumeric($('#numeroPage').val())? $('#numeroPage').val():1);\n\tvar params = 'numeroPage='+$('#numeroPage').val();\n\t$.ajax({\n\t\turl: \"index.php?domaine=news&service=getliste\",\n\t\tdata: params,\n\t\tdataType: 'json',\n\t\tsuccess : function(resultat, sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IESVGRenderer 1.0 SVG Renderer For RichDraw | function IESVGRenderer() {
this.base = AbstractRenderer;
this.svgRoot = null;
} | [
"createSvgRectElement(x,y,w,h){const el=document.createElementNS(BrowserCodeSvgWriter.SVG_NS,'rect');el.setAttributeNS(svgNs,'x',x.toString());el.setAttributeNS(svgNs,'y',y.toString());el.setAttributeNS(svgNs,'height',w.toString());el.setAttributeNS(svgNs,'width',h.toString());el.setAttributeNS(svgNs,'fill','#00000... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the scene / city terrain | function generateCityTerrain() {
var streetHeight = 2 * curbHeight;
// Initialize the base mesh parameters and create the base mesh
var baseColor = colors.DARK_BROWN;
var baseGeometryParams = {
width: getCityWidth(),
height: groundHeight,
depth: getCityLength()
};
var basePosition = {
... | [
"function makeTerrain(){\n //Parameters affecting terrain generation\n var paddingSize=5;\n var scaleUp=4;\n var smoothingRadius=3;\n //Get terrain data\n var terrainData=generateTerrainData(worldData.emoScores,paddingSize,scaleUp,smoothingRadius);\n //Unpack terrain data\n var flattenedArr=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
extracts variable information from a string returns an array of the variable extracted, its index, and its key | function getVariables(){
// return str.exec(VAR_REGEX, str);
var data = [];
var arr = [];
var varString = "";
do {
m = VAR_REGEX.exec(templateString);
if( m ){
varString = m[0];
varString = varString.replace("{{", "");
varString = varString.replace("}}", "");
arr = { value: m[0], key: ... | [
"function parse(string){\n var pairs = breakAtSingleTildes(string);\n for (var i=0; i<pairs.length; i++){\n //first determine if this is an array or a singular value\n //the character following the first tilde makes the determination\n //\"=\" means single \"*\" means array\n var i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents a tuple of terms for Cassandra. | function TermTuple () {
this.terms = new Array(arguments.length);
for (var i = 0, l = arguments.length; i < l; i++) {
this.terms[i] = arguments[i];
}
} | [
"static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }",
"function tuple3Of(a, b, c) {\n var self = getInstance(this, tuple3Of);\n self.types = rest(arguments);\n return self;\n}",
"function termVars(t){\n// if(is_v(t) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Options for `createSerializableStateInvariantMiddleware()`. Creates a middleware that, after every state change, checks if the new state is serializable. If a nonserializable value is found within the state, an error is printed to the console. | function createSerializableStateInvariantMiddleware() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _options$isSerializab = options.isSerializable,
isSerializable = _options$isSerializab === void 0 ? isPlain : _options$isSerializab;
return function (storeAPI) {
... | [
"function createSerializableStateInvariantMiddleware(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$isSerializab = _options.isSerializable,\n isSerializable = _options$isSerializab === void 0 ? isPlain : _options$isSerializab,\n getEntries = _o... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Group datasets by default and named | function groupDatasets(fromClauses) {
var defaults = [], named = [], l = fromClauses.length, fromClause;
for (var i = 0; i < l && (fromClause = fromClauses[i]); i++)
(fromClause.named ? named : defaults).push(fromClause.iri);
return l ? { from: { default: defaults, named: named } } : null;
} | [
"function makeDefaultDataset() {\r\n fillDefaultDataset(dataOrigin);\r\n fillDefaultDataset(dataAsylum);\r\n}",
"function fillDefaultDataset(data) {\r\n data.forEach(function(d) {\r\n datasetDefault[d.Country] = { fillColor: colorDefault };\r\n });\r\n}",
"function loadGroups(that) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsersample_clause. | visitSample_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitSupplemental_plsql_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitFrom_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitBuild_clause(ctx) {\n\t return this.visitChildren(ctx);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create 3D View from scene | function create_3dView() {
var scene = new WebScene({
portalItem: {
id: "159d275b250b4db1978a728bd20fa2ec"
}
});
var view = new SceneView({
map: scene,
container: "globe"
})
} | [
"function create3dPage(w, h, position, rotation, url){\n var plane = createPlane(\n w, h,\n position,\n rotation);\n //glScene.add(plane);\n\n var cssObject = createCssObject(\n w, h,\n position,\n rotation,\n url);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check to see if entry exists, and add if it to our db if it does not note, current is the iterator | function addIfNotFound(current) {
// look for a match by the headline of the current article
Headline.findOne({
'headline': obj[current][0]
}, function(err, res) {
// log any errors
if (err) {
console.log(err);
}
// or, if there is no match (and thus n... | [
"addEntry(t, e, n) {\n const s = e.key,\n i = this.docs.get(s),\n r = i ? i.size : 0,\n o = this.ps(e);\n return this.docs = this.docs.insert(s, {\n document: e.clone(),\n size: o,\n readTime: n\n }), this.size += o - r, this.Ht.addToCollectionParentIndex(t, s.path... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an array of 0's of a given size. | function initialize_empty_array(size){
var zeros = [];
for (var i = 0; i < size; i++) zeros[i] = 0;
return zeros;
} | [
"function createArray(size) {\n\t// Validate parameter value\n\tif (size+\"\" == \"undefined\" || size == null) \n\t\treturn null;\t\n\tthis.length = size;\n\tfor (var i = 0; i < size; i++) {\n\t\tthis[i] = 0; \n\t}\n\treturn this;\n}",
"function zeros(n) {\r\n var arr= new Array(n);\r\n for(var i=0;i<n;i++... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createAccount() This function is responsible for creating an account for the user. We are getting the name, emailId, 1 password for first time and the second password for confirming that this is what the user wanted to enter. If both of these passwords aren't equal, then we show an error otherwise we add that account, ... | function createAccount()
{
let nameRef = document.getElementById("name");
let emailIdRef = document.getElementById("emailId1");
let password1Ref = document.getElementById("password1");
let password2Ref = document.getElementById("password2");
if(password1Ref.value == password2Ref... | [
"createAccount()\n {\n account = this.web3.eth.accounts.create();\n\n vaultData.account_list.push(account)\n\n this.selectAccount( account.address )\n\n this.saveVaultData( vaultData )\n\n }",
"function createAccount(account, masterPassword){\r\nvar accounts = getAccounts(masterP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to find the domain of the origin of the script either from this stack trace or from its ancestors. | get domain() {
var result = 'unknown';
if (this.sourceInfo_ && this.sourceInfo_.domain)
result = this.sourceInfo_.domain;
if (result === 'unknown' && this.parentFrame)
result = this.parentFrame.domain;
return result;
} | [
"function NLGetCurrentScriptFileHostName()\n{\n var scripts = document.getElementsByTagName('script');\n if (!scripts || scripts.length == 0)\n return null;\n\n var currentScriptFileUrl = scripts[scripts.length - 1].src;\n if (!currentScriptFileUrl)\n return null;\n\n var hostName = currentScr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds show modal to class list of sign in so that it appears | function toggleSigninModal() {
signin_modal.classList.toggle("show-modal");
} | [
"function toggleSignupModal() {\n signup_modal.classList.toggle(\"show-modal\");\n}",
"function openTrackList() {\n\t\t$('#modal-wrapper').show(5, 'linear', function(){\n\t\t\t$('.track-list').addClass('open-track-list');\n\t\t});\n\t}",
"function showLoggedInMenu(){\n\t\t$('#signup, #login').hide();\n\t\t$(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a string with all subscription's products names | function strOfProducts(list) {
var txt = '';
for (var i = 0; i < list.length; i++) {
if (i == 0) {
txt = ProductMgr.getProduct(list[i].ID).name;
} else {
txt += ', ' + ProductMgr.getProduct(list[i].ID).name;
}
}
return txt;
} | [
"function getProductOptionsHtml(products) {\n let result = '';\n\n products.forEach(product => {\n return result += `<li> <a href=\"#\" name=\"${product}\">${productsMap[product].name}</a> </li>`;\n });\n\n return result;\n}",
"retreiveProductName() {\n this.waitUtil.waitForElementToBeClickable(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init WASM module and loaded to global env | async InitWASM () {
window.CUBE_GLOBAL.WASMCAL = await import('./wasm/main.wasm')
window.CUBE_GLOBAL.WASM = true
} | [
"async function bootstrap() {\n\n // Load the WebAssembly Module\n // https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming\n const result = await WebAssembly.instantiateStreaming(\n fetch(\"lvglwasm.wasm\"),\n importObject\n );\n\n // Store refe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scroll to bottom of message list | function scrollToBottom() {
$('#messages-bottom')[0].scrollIntoView();
} | [
"function scrollToLastMessage () {\n $(\"#zone_chat\").animate({\n scrollTop: $('#zone_chat')[0].scrollHeight - $('#zone_chat')[0].clientHeight\n }, 500);\n }",
"function scrollToChatBottom() {\n var height = 0;\n height = height < $(\"#chat-window\")[0].scrollHeight ? $(\"#chat-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queue should insert the value into the queue | enqueue(value) {
this.queue.push(value);
} | [
"enqueue(val, priority) {\n let newNode = new Node(val, priority);\n this.values.push(newNode);\n this.bubbleUp();\n }",
"function tasks_queue() {\r\n let q_data = new Queue(1);\r\n q_data.push(4);\r\n q_data.push(8);\r\n q_data.push(9);\r\n q_data.push(19);\r\n\r\n q_data.parse_llist(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParserifThenElseStatementNoShortIf. | enterIfThenElseStatementNoShortIf(ctx) {
} | [
"enterIfThenElseStatement(ctx) {\n\t}",
"function parseIf() {\n var blockResult = null;\n var label = t.identifier(getUniqueName(\"if\"));\n var testInstrs = [];\n var consequent = [];\n var alternate = [];\n\n if (token.type === _tokenizer.tokens.identifier) {\n label = ident... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new StereoscopicGamepadCamera | function StereoscopicGamepadCamera(name,position,interaxialDistance,isStereoscopicSideBySide,scene){var _this=_super.call(this,name,position,scene)||this;_this.interaxialDistance=interaxialDistance;_this.isStereoscopicSideBySide=isStereoscopicSideBySide;_this.setCameraRigMode(isStereoscopicSideBySide?BABYLON.Camera.RIG... | [
"function UniversalCamera(name,position,scene){var _this=_super.call(this,name,position,scene)||this;_this.inputs.addGamepad();return _this;}",
"function VRDeviceOrientationGamepadCamera(name,position,scene,compensateDistortion,vrCameraMetrics){if(compensateDistortion===void 0){compensateDistortion=true;}if(vrCam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserinheritanceModifier. | enterInheritanceModifier(ctx) {
} | [
"exitInheritanceModifier(ctx) {\n\t}",
"enterParenthesizedType(ctx) {\n\t}",
"enterNormalClassDeclaration(ctx) {\n\t}",
"generate_abstract_syntax_tree(cst) {\n this.verbose[this.verbose.length - 1].push(new NightingaleCompiler.OutputConsoleMessage(SEMANTIC_ANALYSIS, INFO, `Generating Abstract Synta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set a property in the database. | function setProperty(propertyName, propertyValue)
{
loadSettingsDb();
db.transaction(function(tx) {
tx.executeSql("INSERT OR REPLACE INTO EasyListApp (property, value) VALUES (?,?)", [propertyName, propertyValue]);
});
} | [
"onPropertySet(room, property, value, identifier) {\n room[prop] = value;\n }",
"function update(id, property){\n return db('property').where('id', '=', id).update(property)\n}",
"addProperty(property, value) {\n this.properties.set(property, value);\n }",
"set(propObj, value) {\n p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Formulario par registrar nuevas unidades de transportes | function registraUt()
{
Ext.apply(Ext.form.VTypes,{
VRange: function(val, field){
if(val >= 1 && val <= 60)
return true;
else
return false;
},
VRangeText: 'Entre 1 y 60', //mensaje de error
VRangeMask: /[\d\.]/i
... | [
"function crearFormularioRegistrarse(btnIniciarSesion, btnRegistrarse){\r\n document.getElementById(\"formulario\").removeChild(btnIniciarSesion);\r\n document.getElementById(\"formulario\").removeChild(btnRegistrarse);\r\n\r\n crearBtnAtras();\r\n\r\n //formulario registro\r\n\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
StatusKeeper store the unique working status and relative info for client query | function StatusKeeper (fn) {
this.status = Status.init;
this.candidate = null;
this.bufferStatus = Status.init;
this.bufferCandidate = null;
this.lock = false;
this.action = fn;
} | [
"saveStatus() {\n if (XIBLE.stopping) {\n return;\n }\n\n const statuses = Flow.getStatuses();\n const startedInstances = this.instances\n .filter(\n (instance) => instance.state === XIBLE.FlowInstance.STATE_STARTED && !instance.directed\n );\n\n if (!startedIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the seek buffer if it is present, or The time buffer if in there | returnSeekIfPresent(time, direction)
{
//let time_result= this.forTime(time, "scrub");
//if (time_result)
//{
// return time_result;
//}
for (let idx = 0; idx < this._seekVideo.buffered.length; idx++)
{
// If the time is comfortably in the range don't bother getting
// additi... | [
"get seek() {\n return this.api.currentTime()\n }",
"get(name) {\n (0, _Debug.assert)(this.has(name), `ToneAudioBuffers has no buffer named: ${name}`);\n return this._buffers.get(name.toString());\n }",
"fillBuffer_() {\n if (this.sourceUpdater_.updating()) {\n return;\n }\n\n if (!this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create daily conversations chart | function dailyConversationsChart (result) {
// Get chart data
function getConversationsByChannel (data, channelFilter) {
const channels = {}
// Loops through the data to build the `channels` object
data.forEach(item => {
const channel = item.MessageChannel; const id = item.ConversationID
/... | [
"function dailyTimeChart (result) {\n // Get chart data\n function getMessagesByHour (data, channelFilter) {\n const channels = {}\n\n // Loops through the data to build the `channels` object\n data.forEach(item => {\n const channel = moment(item.MessageTime).format('YYYY-MM-DDTHH'); const id = item... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function used to redeem page. | function ProcessRedeem(sid){
var txfparam ="redeemdata=" +encodeURI(sid);
ajaxpost('./xcommon/fend/redeem.php',txfparam,redeem_callback);
} | [
"upd_premium () {\n return betess.post(`premium/`, {\n authorization: store.state.accesstoken,\n }).then(response => response.data)\n .catch((error) => {\n alert(error.message)\n })\n }",
"function onRedeemPressed(isVoucher) {\n numActions++;\n\n var curr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grow an item to the right by a positive delta. This will adjust the items neighbors if required. Before adjusting the item, the size hints of all items will be updated to their current size. This allows the sections to remain well sized on the subsequent layout since the size hint is the effective input to the `distrib... | function growItem(items, index, delta) {
for (var i = 0, n = items.length; i < n; ++i) {
var item = items[i];
item.sizeHint = item.size;
}
var growLimit = 0;
for (var i = 0; i <= index; ++i) {
var... | [
"function adjustItems($items, extendWidth, property, selector) {\n \n var leftAdd = Math.floor(extendWidth / 2),\n rightAdd = Math.ceil(extendWidth / 2);\n \n $items.each(function() {\n if (!selector)\n {\n $(this)\n .css(pro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets this web's parent web and data | async getParentWeb() {
const { Url, ParentWeb } = await this.select("Url", "ParentWeb/ServerRelativeUrl").expand("ParentWeb")();
if (ParentWeb === null || ParentWeb === void 0 ? void 0 : ParentWeb.ServerRelativeUrl) {
return Web([this, combine((new URL(Url)).origin, ParentWeb.ServerRelativeU... | [
"async getRootWeb() {\n const web = await this.rootWeb.select(\"Url\")();\n return Web([this, web.Url]);\n }",
"get rootWeb() {\n return Web(this, \"rootweb\");\n }",
"get parent() {\n return ContentType(this, \"parent\");\n }",
"function getParentPageState() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets TView from a template function or creates a new TView if it doesn't already exist. | function getOrCreateTView(templateFn, consts, vars, directives, pipes, viewQuery) {
// TODO(misko): reading `ngPrivateData` here is problematic for two reasons
// 1. It is a megamorphic call on each invocation.
// 2. For nested embedded views (ngFor inside ngFor) the template instance is per
// outer... | [
"static createTemplateFn(tpl, name) {\n return superviews(tpl, name, argstr, mode);\n }",
"getViewStrategy(value: any): ViewStrategy {\n if (!value) {\n return null;\n }\n\n if (typeof value === 'object' && 'getViewStrategy' in value) {\n let origin = Origin.get(value.constructor);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end of function OnKeyUp / Function: OnSyskeyUp | function OnSysKeyUp(lVirtKey, lKeyData){
switch(lVirtKey){
case VK_F4 : close_OnClick();
}/* end of switch statement */
} | [
"function handleKeyUp(event) {\n //console.log(\"Key Up!\");\n //console.log(\"keyCode: \"+event.keyCode + \", charCode: \"+event.charCode);\n var curr = [event.keyCode, event.charCode];\n //var code = \"[\" + event.keyCode + \",\" + event.charCode + \"]\";\n var i = 0;\n while (i < keysHeldDown.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update given query parameters in the url dynamically. queryParams is a map of query parameters where the keys are the parameter names and the values are the parameter values. | function updateUrl(queryParams){
if( !queryParams ){
return;
}
var existingQueryString = window.location.search;
var newParams = {};
if(existingQueryString) {
var existingParamPairs = existingQueryString.replace("?","").split("&");
// update existing paramaters
for( var existingParamIndex in exis... | [
"function updateParams() {\n var hashParams = new Array();\n var curLatLon = map.getCenter();\n hashParams.push('q=' + jQuery('#controls .searchQuery').val());\n hashParams.push('date=' + jQuery('#controls .searchDate').val());\n hashParams.push('lat=' + curLatLon.lat());\n hashParams.push('lon=' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to update our operating environment the object "env" | function updateEnv(key, value) {
env[key] = value;
var store = JSON.stringify(env);
localStorage.setItem("AtmosphereEnv", store);
} | [
"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"
]
]
}
} |
(String) > Array[String] Returns the hashtags used in the provided tweet. | function hashtags(tweet) {
var string = tweet.split(" ");
var hash = [];
for (var i = 0; i < string.length; i++) {
if (string[i].startsWith("#")) {
hash.push(string[i]);
}
}
return hash;
} | [
"getHashtags(text) {\n return twitter.extractHashtagsWithIndices(text ? text : this['tweet.text']);\n }",
"function mentions(tweet) {\n var string = tweet.split(\" \");\n var hash = [];\n for (var i = 0; i < string.length; i++) {\n if (string[i].startsWith(\"@\")) {\n hash.push(stri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Changes the index of a given element within the parent. The indexOrDelta parameter denotes whether a element is to be moved to an absolute index or relative to its current position depending on the 'relative' parameter. | changeIndexTo(element, indexOrDelta, relative) {
if (element.parent != this) return ;
var newIndex = indexOrDelta;
if (relative || false) {
newIndex = index + indexOrDelta;
}
if (newIndex < 0)
newIndex = 0;
if (newIndex >= this._children.length)
... | [
"function ChangeIndex(element, index) {\n\n //Element with additional list inside element. (descriptions)\n if (element.getElementsByTagName(\"ul\").length != 0) {\n ChangeIndexOfAttribute(element, \"id\", index);\n ChangeIndexOfAttribute(element.children[0], \"id\", index);\n var div = element.children[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a new building inputs name: the name of the building resource: A resource object that is associated with a specific planet e.g. earth.resources.food increment: the amount that building will increase the resource production by multiplier: the amount that the building will multiply the resource production by | function Building(name, resource, increment, multiplier){
this.name = name,
this.discovered = 0,
this.amount = 0,
this.resource = resource,
this.increment = increment,
this.multiplier = multiplier
} | [
"async createBuild({\n resources = []\n } = {}) {\n this.log.debug('Creating a new build...');\n return this.post('builds', {\n data: {\n type: 'builds',\n attributes: {\n branch: this.env.git.branch,\n 'target-branch': this.env.target.branch,\n 'target-commit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize position and radius of all targets. | function initTargets(numTargets, minRadius, maxRadius, minSep) {
// set the size of the circle -> used this for varied
var radRange = maxRadius - minRadius;
var minX = maxRadius + 10,
maxX = w - maxRadius - 10,
xRange = maxX - minX;
var minY = maxRadius + 10,
maxY = h - maxRadius - 10,
yRange ... | [
"function initializeRadius() {\n for (let i = 0; i < INITIAL_NUMBER_OF_BALLS; i++) {\n let ball = ballArray[i];\n ball.radius = ball.mass / (5 / 3) + 1; //size the radius proportionally to its mass (between 1 and 4)\n }\n}",
"constructor(_radius, _r, _g, _b) {\n //variables that allow setting random po... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the user input for the gate for the current simulation state. | function setUserInput (gate, state, value) {
state.inputs[gate.id] = value
} | [
"setUserInput (gate, observable) {\n if (userInputsSubscriptions.has(gate.id)) {\n userInputsSubscriptions.get(gate.id).unsubscribe()\n }\n userInputsSubscriptions.set(\n gate.id,\n observable.subscribe((...args) => {\n getUserInput(gate).next(...args)\n })\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
An ondisplay function for the next payment adjustment screen. | function display_layout1group1layer7 ()
{
CurrentPayment = 'next';
get_payment_arrangements('schedule', populate_next_payment_adjustment, document.forms['Application'].application_id.value, document.forms['Application'].company_id.value);
// get_schedule_preview(document.getElementById('application_id').value,
// doc... | [
"function display_layout1group1layer1 ()\n{\n\tCurrentPayment = 'arrange';\n\tget_payment_arrangements('arrangements', populate_payment_arrangements, document.forms['Application'].application_id.value, document.forms['Application'].company_id.value);\n}",
"showNextCard(target, dataStorage, nodes) {\n if (targe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper method that is used to respond a stream containing the file of choice | function respondStreamFile(res, filepath) {
fs.access(filepath, fs.constants.F_OK, function (error) {
if (!error) {
var fileStream_1 = fs.createReadStream(filepath);
fileStream_1.on('open', function () {
fileStream_1.pipe(res);
});
fileStream_1... | [
"function serveStaticFile(request, response, filename) {\n\n fs.stat(filename, function(error, stat) {\n\n if (error || !stat.isFile()) {\n console.error(error.stack);\n return;\n }\n \n // Prepare for streaming file to client\n var responseCode = 200;\n var responseHeaders = {\n '... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
end setCurrentObject spellCheck_cb This is the callback function that the spellCheck php function returns the spell checked data to. It sets the results div to contain the markedup misspelled data and changes the status message. It also sets the width and height of the results div to match the element that's being chec... | function spellCheck_cb(new_data)
{
with(currObj);
new_data = new_data.toString();
var isThereAMisspelling = new_data.charAt(0);
new_data = new_data.substring(1);
if(currObj.spellingResultsDiv)
{
currObj.spellingResultsDiv.parentNode.removeChild(spellingResultsDiv);
}
currObj.spellingResultsDi... | [
"function spellCheck() {\r\n\twith(currObj);\r\n\tvar query;\r\n\t\r\n\tif(currObj.spellingResultsDiv)\r\n\t{\r\n\t\tcurrObj.spellingResultsDiv.parentNode.removeChild(currObj.spellingResultsDiv);\r\n\t\tcurrObj.spellingResultsDiv = null;\r\n\t}\r\n\t\r\n\tif(currObj.config['useIcons'])\r\n\t{\r\n\t\tcurrObj.actionS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes a full parse tree and settings and builds a MathML representation of it. In particular, we put the elements from building the parse tree into a tag so we can also include that TeX source as an annotation. Note that we actually return a domTree element with a `` inside it so we can do appropriate styling. | function buildMathML(tree, texExpression, options) {
const expression = buildExpression$1(tree, options); // Wrap up the expression in an mrow so it is presented in the semantics
// tag correctly, unless it's a single <mrow> or <mtable>.
let wrapper;
if (expression.length === 1 && expression[0... | [
"toNode() {\n const node = document.createElementNS(\"http://www.w3.org/1998/Math/MathML\", this.type);\n\n for (const attr in this.attributes) {\n if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {\n node.setAttribute(attr, this.attributes[attr]);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the current backgournd CSS color class name for the drawing grid. Returns: CSS Class 'highlighted' color name | function getGridBackgroundColorClass() {
return 'highlighted-' + getGridBackgroundColor();
} | [
"function getCurrentColor() {\n\t\tlet expr = getStateExpr(ActiveItem.expression.index);\n\t\t\n\t\tif (expr.type === 'expression') {\n\t\t\treturn expr.color;\n\t\t\t\n\t\t} else if (expr.type === 'table') {\n\t\t\treturn expr.columns[ActiveItem.expression.colIndex].color;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"get border... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function that takes an integer i and returns an integer with the integer backwards followed by the original integer. | function reverseAndNot(i) {
return parseInt(i.toString().split("").reverse().join("") + i);
} | [
"reverseNth(n) {\n // YOUR CODE HERE\n }",
"function countUpAndDown(num){\n let n = ''\n for(var i = 1; i <= num; i++){\n n += i\n }\n for(var i = num-1 ; i > 0; i--){\n n += i\n }\n console.log(n);\n\n}",
"function getDigit(num, i) {\n return Math.floor(Math.abs(num) / Math... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds or remove the mouse wheel hijacking | function setMouseHijack(value){if(value){setMouseWheelScrolling(true);addTouchHandler();}else{setMouseWheelScrolling(false);removeTouchHandler();}} | [
"function mouseWheel(event) {\n rotx = rotx - event.delta/100;\n return false;\n}",
"function wheelEvent(event) {\n if (modalVisible) {\n if (event.ctrlKey) event.preventDefault();\n return;\n }\n\n event.preventDefault();\n\n if (Data.Action.Active) return;\n if (Math.abs(event.deltaY) < 0.1) return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Disable pointer events on svg and update the diagram height according to the svg height | function updateStyle () {
var svg = document.querySelectorAll('#' + id + ' svg > g')[0];
svg.setAttribute('style', 'pointer-events: none');
var diagramId = 'svg-' + id;
var diagram = document.getElementById(diagramId);
var height = svg.getBoundingClientRect().height + 50;
... | [
"_setAllDiagramElementsHandler() {\n const dragStarted = (event, d) => {\n d.dragY = event.y\n }\n const dragged = (event, d) => {\n this._moveNetworkLayer(d.path, event.y - d.dragY)\n d.dragY = event.y\n }\n const dragEnded = (event, d) => {\n delete d.dragY\n }\n\n // add ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map each data point to its rightful day of week | function mapDataToWeekday(data) {
const days = data,
week = [0,1,2,3,4,5,6];
// limit to size of graph
if (days.length > 7) {
days.splice(6);
}
// ensure it's sorted in order.
days.sort( (a,b) => a.day - b.day);
//sort each day into its proper weekday position.
days.forEach... | [
"function resampleDates(data) {\r\n const startDate = d3.min(data, d => d.key)\r\n const finishDate = d3.max(data, d => d.key)\r\n const dateRange = d3.timeDay.range(startDate, d3.timeDay.offset(finishDate,1), 1)\r\n return dateRange.map(day => {\r\n return data.find(d => d.key >= day && d.key < d3... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Getting batch by "Id" | async BatchByID(req, res, next, Id) {
await Batch.findById(Id).exec((error, batch) => {
req.batch = batch;
next();
});
} | [
"static get(id){\n\t\tlet kparams = {};\n\t\tkparams.id = id;\n\t\treturn new kaltura.RequestBuilder('bulkupload_bulk', 'get', kparams);\n\t}",
"function viewBatch() {\n\n drugService.getById($routeParams.id).then(drug => {\n\n $scope.batch={};\n $scope.batch.dcat=drug.dcat;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper for texing nullary functions | function nullaryTex(code)
{
return function(thing,texArgs){ return '\\textrm{'+code+'}'; };
} | [
"function SysFmtNullOrEmptyToString(){}",
"function SysFmtIsNull() {}",
"function toBlank( str ) {\r\n\tif( str == undefined || str == null ) {\r\n\t\treturn \"\";\r\n\t} else {\t\t\r\n\t\treturn str;\r\n\t}\r\n}",
"function testNoArgumentsSetText() {\n\t\t\tjsUnity.assertions.assertNotUndefined(U.setText('ou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh the rendering ordinals of the controls in the array. | function updateRenderingOrdinals(controlArray) {
if (!controlArray) {
return;
}
for (var i = 0; i < controlArray.length; i++) {
setRenderingOrdinal(controlArray[i], i);
}
} | [
"function updateSampleGrid(){\n binnedSamplePairs = getBinnedSamplePairs();\n previewControl.forceRedraw();\n }",
"function redrawWidgets() {\n let W = global.WIDGETS;\n global.WIDGETS = {};\n Object.keys(W)\n .sort() // see comment in boot.js\n .sort((a, b) => (0|W[b].sortorde... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Minimizes the code editor to available space. | function minimizeCodeEditor() {
parent.find('[data-command=maximize-editor]').show();
parent.find('[data-command=minimize-editor]').hide();
parent.find('[data-section=config]').show();
} | [
"function widenProgram() {\n let s = document.getElementsByClassName('wrap_xyqcvi')[0];\n s.style.setProperty(\"max-width\", \"none\", \"important\");\n\n clearInterval(widenprogram);\n}",
"function minimizar() {\n var win = remote.getCurrentWindow()\n win.minimize();\n}",
"insertBreak(editor) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Is the Token Code Valid? | static isTokenCodeValid(tokenCode) {
const validation = (0, validation_1.validate)({ tokenCode }, { tokenCode: validation_1.allRules.chain });
if (!validation.isValid) {
throw new ValidationError_1.ValidationError(validation.errors);
}
return true;
} | [
"validateInstruction(instruction) {\n if (!instruction.match(/^\\+\\d{4}$/)) return false\n const checkOpCode = instruction.substring(1, 3)\n if (!this.validOpCodes.includes(parseInt(checkOpCode))) return false\n return true;\n }",
"isTokenExpired(token){\n try {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts a list of vocab words to a dictionary. toDictionary : [Object] > Object | function toDictionary(list) {
var dict = {};
list.forEach((vocab) => {
const primaryMeanings = vocab.data.meanings.map(val => val.meaning);
const auxiliaryMeanings = vocab.data.auxiliary_meanings.filter(val => val.type == 'whitelist').map(val => val.meaning);
[...primaryMeanings... | [
"function frequencies(wordList) {\n var wordFreqs = {};\n wordList.forEach(function(word){\n\t\tif (word in wordFreqs) {\n\t\t\twordFreqs[word] += 1;\n\t\t} else {\n\t\t\twordFreqs[word] = 1;\n\t\t}\t\n\t});\n return wordFreqs;\n}",
"function countWords(inputWords) {\n return inputWords.reduce(function(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
settings: sprites: array of sprite names lifetime: lifetime of particles in seconds speed: speed of particles (meters/second) fadeout: seconds to fade out before end of lifetime transformation: position, direction and scale of particle system spread: Range of radians to spread out from direction spawnDelay: Range of ti... | constructor(settings) {
settings = settings || {};
settings.sprites = settings.sprites || [];
settings.lifetime = settings.lifetime || 1;
settings.speed = settings.speed || 1;
settings.fadeout = settings.fadeout || 1;
settings.transformation = settings.transformation || Transformation.create();
se... | [
"_emitParticles() {\n const particleInterval = setInterval(async () => {\n if (!this.spinning) clearInterval(particleInterval);\n\n const particle = new Sprite.from('star');\n particle.name = 'particle';\n particle.anchor.set(0.5);\n \n this._particles.addChild(particle);\n \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
27.Write a function called omit, which accepts an object and an array of keys and returns a new object with the keys from the array omitted. If an array element doesn't correspond to a valid key, the element is simply ignored. | function omit(obj, arr){
let newObj={};
for (let key in obj){
if (!arr.includes(key)) newObj[key] = obj[key];
}
return newObj;
} | [
"static #cloneObjectExceptKeys(src = {}, excludeKeys = []) {\n const cloned = {}\n for (const key in src) {\n if (!excludeKeys.includes(key)) {\n cloned[key] = src[key]\n }\n }\n\n return cloned\n }",
"function omitBy(obj, cb){\n let result = {};\n for (let key in obj){\n if (!c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called when buzzer is pressed. Send a buzz command to the server. | function buzz(){
connectFactory.buzzBuzzTrial(buzzerRound);
$rootScope.$emit(rootScopeEvents.buzzTriggered);
} | [
"function buzzTrggered(event){\n if (self.buzzerState == buzzerState.enabled) {\n self.buzzerState = buzzerState.buzzTriggered;\n self.buzzerText = \"BUZZED\";\n self.buzzerEnabled = false;\n ignoreNextBuzzerStatusChanged = true;\n }\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validates the localisation config values provided. Removes any invalid values and logs appropriate warnings. | function getValidatedLocalisationConfig(config) {
if ('languageTag' in config) {
var valid = new Validator()
.ofType('string').minLength(1)
.validate(config.languageTag, 'Localisation languageTag config setting');
if (!valid)
delete config.languageTag;
}
i... | [
"function _sanitize( raw, clean ){\n // error & warning messages\n const messages = { errors: [], warnings: [] };\n\n if (clean.hasOwnProperty('parsed_text') && iso3166.is2(_.toUpper(clean.parsed_text.country))) {\n clean.parsed_text.country = iso3166.to3(_.toUpper(clean.parsed_text.country));\n }\n\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
build title element of column | _buildColumnHeaderTitle(){
var def = this.definition;
var titleHolderElement = document.createElement("div");
titleHolderElement.classList.add("tabulator-col-title");
if(def.headerWordWrap){
titleHolderElement.classList.add("tabulator-col-title-wrap");
}
if(def.editableTitle){
var titleElement = ... | [
"function setColumnTitle(title){\r\n\treturn \t '<span class=\"endPointDiv endPointLeft\">•</span>'+ title +'<span class=\"endPointDiv endPointRight\">•</span>';\t\r\n}",
"function changeColTitle(obj, col) {\r\n NewGridObj.dimTitles[ColDimId][col] = obj.innerHTML;\r\n}",
"function createTitle(tit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getNearestStorageID finds the id of the nearest storage to c, spawn, extension, or storage that has space | function getNearestStorageID(c) {
/* If we have a storage (the structure) we can be less picky about
* where to go. */
if (undefined !== c.room.storage) {
/* Structures that can store energy */
var ss = c.room.find(FIND_MY_STRUCTURES, {filter: function(x) {
... | [
"function getClosestContainer(creep, minEnergyLimit) {\n var conn = [];\n for(var i = 0; i < containerIDs.length; ++i) {\n var con = Game.getObjectById(containerIDs[i]); \n if(_.sum(con.store) > minEnergyLimit) {\n conn[conn.length] = Game.getObjectById(containerIDs[i]);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the first element of the queue, if there is at least one item | deleteFirst(){
return this.values.length > 0 ? new PlayQueue(this.values.slice(1)) : this;
} | [
"dequeue() {\n // if the queue is empty, return immediately\n if (this.queue.length == 0) return undefined;\n\n // store the item at the front of the queue\n var item = this.queue[this.offset];\n\n // increment the offset and remove the free space if necessary\n if (++this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserdrop_function. | visitDrop_function(ctx) {
return this.visitChildren(ctx);
} | [
"visitDrop_procedure(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDrop_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDel_stmt(ctx) {\r\n console.log(\"visitSivisitDel_stmt\");\r\n return { type: \"DeleteStatement\", deleted: this.visit(ctx.exprlist()) };\r\n }",
"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes item specified in input and saves to cookie | function removeItem(removeMe)
{
var toRemove = document.getElementById(removeMe);
toRemove.parentNode.removeChild(toRemove);
setCookie();
} | [
"function removeCookies() {\n Cookies.remove(`selection`);\n}",
"removeItem(item) {\n Items.remove(item._id)\n }",
"function removeItem(event) {\n var id = event.target.id;\n var listName = id.split('_')[0];\n var listItem = id.split('_')[1];\n \n var index = items[listName].indexOf(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================= int j, DateTime aDate | function gage_getNextRainDate(j, aDate)
//
// Input: j = rain gage index
// aDate = calendar date/time
// Output: next date with rainfall occurring
// Purpose: finds the next date from specified date when rainfall occurs.
//
{
if ( Gage[j].isUsed == false ) return aDate;
aDate += OneSecond;
... | [
"function jabberDate(date) {\n\tif (!date.getUTCFullYear)\n\t\treturn;\n\n\tvar jDate = date.getUTCFullYear() + \"-\";\n\tjDate += (((date.getUTCMonth()+1) < 10)? \"0\" : \"\") + (date.getUTCMonth()+1) + \"-\";\n\tjDate += ((date.getUTCDate() < 10)? \"0\" : \"\") + date.getUTCDate() + \"T\";\n\n\tjDate += ((date.ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load Material and its shader | loadMaterial(mat){
//...............................
//If material is the same, exit.
if(this.material === mat) return;
this.material = mat;
//...............................
//Is the shader for the material different
if(this.shader !== mat.shader){
this.shader = mat.shader;
gl.ctx.useProg... | [
"function setMaterial(mat)\n{\n gl.uniform3fv(material.diffuseLoc, mat.diffuse);\n gl.uniform3fv(material.specularLoc, mat.specular);\n gl.uniform3fv(material.ambientLoc, mat.diffuse);\n gl.uniform1f(material.shininessLoc, mat.shininess);\n}",
"setup() {\n this.material = new THREE.ShaderMaterial({... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Filter congress members based on search query If a member has a middle name include it in filter. | function searchCongressMembers(searchQuery, members) {
let searchedCongressMembers = members.filter(member => {
let memberName;
if (member.middle_name) {
memberName = `${member.first_name} ${member.middle_name} ${member.last_name}`;
} else {
memberName = `${member.first_name} ${member.last_name}`;
}
re... | [
"searchUserByName(name) {\n const users = this.getUsers(); //Returns the collection of Users\n\n //Filter each user name based on the name we are interested in.\n const results = users.filter(\n user => user.firstName === name || user.lastName === name\n );\n\n return results.length === 0 ? fals... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
converts a timestamp to a natural date | function fromUnixToNatural(timestamp){
var naturalDate = new Date(timestamp*1000).toString();
naturalDate = naturalDate.split(" ");
naturalDate = months[naturalDate[1]] +" "+naturalDate[2]+ ", "+ naturalDate[3];
return naturalDate;
} | [
"function unixTimestampToDate(timestamp) {\n return new Date(timestamp * 1000);\n}",
"function formatdate(timestamp) {\n let thisdate = new Date(timestamp * 1000)\n return `${weekdays[thisdate.getDay()]} ${months[thisdate.getMonth()]} ${thisdate.getDate()}, ${thisdate.getFullYear()}`\n}",
"function toTim... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all the metadata of all the decorators of all the models referencing current target, i.e. (rel = target relation name) | function getAllRelationsForTarget(target) {
if (!target) {
throw TypeError;
}
//global.models.CourseModel.decorator.manytomany.students
var name = getResourceNameFromModel(target);
if (!name) {
return null;
}
var metaForRelations = utils_1.MetaUtils.getMetaDataForDecorators(c... | [
"function getAllRelationsForTargetInternal(target) {\n if (!target) {\n throw TypeError;\n }\n let targerKey = typeof target === 'function' ? target.prototype : target;\n if (_relationsCache[targerKey.constructor.name]) {\n return _relationsCache[targerKey.constructor.name];\n }\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Walking iterates the statements and expressions and processes them | walkStatements(statements) {
for (let index = 0, len = statements.length; index < len; index++) {
const statement = statements[index];
this.walkStatement(statement);
}
} | [
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function evaluate(stmt, env) {\n if (is_self_evaluating(stmt)) {\n return stmt;\n } else if (is_empty_list_expression(stmt)) {\n return evaluate_empty_list_expression(stmt);\n } else if (is_variable(stm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
subtracts two seconds from time | subtractTime() {
this.endTime -= 2000;
} | [
"static subtractTime(time : string, minus : string): string {\n let timeTotal = this.timeToMinutes(time);\n let minusTotal = this.timeToMinutes(minus);\n\n if (!timeTotal){\n return ''\n }\n\n if (!minusTotal) {\n return time\n }\n\n return this.minutesTotime(timeTotal - minusTotal);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Boss 2" rendering function. | function boss2_render() {
simpleEnemy_render.call(this);
//Issue 66: Rendering the walls.
if(this.previous === null){
context.fillRect(0,250,330,350);
context.fillRect(560,250,240,350);
}
} | [
"function boss3_heating_render() {\n if (this.frameCounter % 2 === 0) {\n context.fillStyle = \"yellow\";\n } else\n context.fillStyle = \"red\";\n simpleSquare_render.call(this);\n}",
"function boss3_arm_render() {\n if (boss3_middle_constants.prototype.hp > 0) {\n boss3_hatch_re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Layer multiple variable stores. | function layerVarStores(store, ...stores) {
for (const st of stores) {
store = new LayeredVarStore(store, st);
}
return store;
} | [
"function layerValueStores(store, ...stores) {\n for (var nextStore of stores) {\n store = new LayeredValueStore(store, nextStore);\n }\n return store;\n}",
"function layerHashStores(store, ...stores) {\n for (var nextStore of stores) {\n store = new LayeredHashStore(store, nextStore);\n }\n return st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get House Assigned Gift Cards | function GetHouseAssignedGiftCards(id) {
return $resource(_URLS.BASE_API + 'homegiftcard/by_house/' + id + _URLS.TOKEN_API + $localStorage.token).get().$promise;
} | [
"function GetAllGiftCards() {\n return $resource(_URLS.BASE_API + 'homegiftcard' + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }",
"function getCard() {\n\t\n\t// STUB: this code shows a minmal model for a Card object. You job is to build a better one!\n\tvar card = {\n\t\tisFaceUp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
In case of any error on localStorage, we clean our own namespace, this should handle quota errors when a lot of keys + data are used | function cleanup() {
try {
global.localStorage.removeItem(localStorageNamespace);
} catch (_) {
// nothing to do
}
} | [
"clearDataFromLocalStorage() {\n localStorage.db = [];\n }",
"function clearStorage() {\n Object.keys(localStorage).filter(function (key) {\n return key.startsWith(options.name);\n }).forEach(function (key) {\n return localStorage.removeItem(key);\n });\n}",
"function checkIfKeyEmpty() {\n con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transfer state from one layer to a newer version | _transferLayerState(oldLayer, newLayer) {
newLayer._transferState(oldLayer);
newLayer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_1__["LIFECYCLE"].MATCHED;
if (newLayer !== oldLayer) {
oldLayer.lifecycle = _lifecycle_constants__WEBPACK_IMPORTED_MODULE_1__["LIFECYCLE"].AWAITING_GC;
... | [
"_transferState(oldLayer) {\n Object(_debug__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(TRACE_MATCHED, this, this === oldLayer);\n const {\n state,\n internalState\n } = oldLayer;\n\n if (this === oldLayer) {\n return;\n } // Move internalState\n\n\n this.internalState = internalStat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
xf is an XF, see parse_XFExt for xfext | function update_xfext(xf, xfext) {
xfext.forEach(function(xfe) {
switch(xfe[0]) { /* 2.5.108 extPropData */
case 0x04: break; /* foreground color */
case 0x05: break; /* background color */
case 0x07: case 0x08: case 0x09: case 0x0a: break;
case 0x0d: break; /* text color */
case 0x0e: break; /* font ... | [
"parseXML(rawText) {\n // TODO: different code paths for XLIFF 1.2 vs. 2.0 (this is the only way to support both)\n // Document.init();\n // Working - just return the Document object from this function\n const deferred = $q.defer();\n const self = this;\n\n // <xliff xmlns=\"urn:oasis:nam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Append loader to document | appendLoader(loader) {
//append to body
loader.appendTo($(this.section));
} | [
"function appAddLoader()\n\t{\n\t\tif (jQuery('#TB_load').size() != 0) return;\n\t\t\n\t\tjQuery('body').append('<div id=\"TB_load\" style=\"display: block;\"><div class=\"loader\"></div></div>');\n\t}",
"function addLoader(fn){\n\tif(typeof fn === \"function\"){\n\t\tloader.push(fn);\n\t}\n}",
"function _fillC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function validation the file type "pdf" only for now | function validPdfForm() {
return true;
} | [
"function isLinkToPDF(input) {\n const url = input.toLowerCase().trim\n if (url.indexOf(\".pdf\") >= (url.length-4)){\n return true;\n } else {\n return false;\n }\n}",
"function fileTypeValidate(fileName,fileType){\r\n\r\n\t//get file name and extention name\r\n\t//var fileName=$(\"PB__FileInput\").v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Execute a binary from the specified package. Note that "binary" in this sense means "a Javascript file". Actual native binaries cannot be executed this way, because we use Node in order to transparently read from the archives. | async function executePackageAccessibleBinary(locator, binaryName, args, {
cwd,
project,
stdin,
stdout,
stderr,
nodeArgs = []
}) {
const packageAccessibleBinaries = await getPackageAccessibleBinaries(locator, {
project
});
const binary = packageAccessibleBinaries.get(binaryName);
if (!binary) th... | [
"async function executeWorkspaceAccessibleBinary(workspace, binaryName, args, {\n cwd,\n stdin,\n stdout,\n stderr\n}) {\n return await executePackageAccessibleBinary(workspace.anchoredLocator, binaryName, args, {\n project: workspace.project,\n cwd,\n stdin,\n stdout,\n stderr\n });\n}",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get or create a relationship | getOrCreate(event, relationship, modelName) {
return new RSVP.Promise(resolve => {
event
.get(relationship)
.then(relationshipRecord => {
resolve(relationshipRecord);
})
.catch(() => {
const record = this.store.createRecord(modelName);
record.set('... | [
"static get(name, id, opts) {\n return new RelationshipLink(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"function makeRelationshipProcessInstance(node,result){\n var root_node_id = node[0]._id;\n var other_node_id = result._id;\n db.insertRelationship(other_node_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Math 4 //////////////////////////////////////// / Write a function called create_dummy_array(). This function should take a number n. Return an array of random numbers between 0 and 9 with the length of n. | function create_dummy_array(n){
var arr = [];
for(var i = 0; i < n; i++){
arr.push(Math.floor(Math.random() * 10));
}
return arr;
} | [
"function giveMeRandom(n) {\n let array = [];\n for (let x = 0; x < n; x++) {\n array.push(Math.floor(Math.random() * 10));\n }\n return array;\n}",
"function zeros(n) {\r\n var arr= new Array(n);\r\n for(var i=0;i<n;i++) { arr[i]= 0; }\r\n return arr;\r\n }",
"distribution(n: number): RandomAr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function creates each gift's element in the page. Upon clicking on a gift's element, a modal will appear with the proper gift's details. | function createGiftElement(giftData, giftOwner){
var giftDescription = giftData.description;
var giftLink = giftData.link;
var giftTitle = giftData.title + " - for " + giftOwner;
var giftWhere = giftData.where;
var giftUid = giftData.uid;
var giftDate = giftData.creationDate;
//console.log(... | [
"function changeGiftElement(giftData, giftOwner){\n var description = giftData.description;\n var link = giftData.link;\n var title = giftData.title + \" - for \" + giftOwner;\n var where = giftData.where;\n var uid = giftData.uid;\n var date = giftData.creationDate;\n\n console.log(\"Updating ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds children to a (nonleft)parensTree node and pushes values for new children onto valuesAdded | addChildren(valuesAdded) {
this.children.push(new Node('()' + this.val, 'right'));
valuesAdded.push('()' + this.val);
this.children.push(new Node('(' + this.val + ')', 'right'));
valuesAdded.push('(' + this.val + ')');
this.children.push(new Node(this.val + '()', 'right'));
valuesAdded.push(this... | [
"addChild(value) {\n const newTreeNode = new Tree(value);\n this.children.push(newTreeNode);\n }",
"constructChildren() {\n\t\t\n\t\t// this.children.push();\n\t}",
"_setChildren(item, data) {\n // find all children\n const children = data.filter((d) => item.id === d.parent);\n item.children = c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch a Subscription object by query hash | function getSubscription(hash) {
return subscriptions[hash] || null;
} | [
"static async getById(id) {\n try {\n const [subscription] = await db(this.table).where('id', id);\n // Subscription not found: return null\n if (!subscription) {\n return null;\n }\n return new Subscription(subscription);\n } catch (e) {\n throw new Error(e);\n }\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes wavelength in nm and returns an rgba value | function wavelengthToColor(wavelength) {
var r,
g,
b,
alpha,
colorSpace,
wl = wavelength,
gamma = 1;
if (wl >= 380 && wl < 440) {
R = -1 * (wl - 440) / (440 - 380);
G = 0;
B = 1;
} else if (wl >= 440 && wl < 490) {
R = 0;
... | [
"function nm2rgb(h) {\n var wavelength = 380 + h * 400;\n var Gamma = 0.80,\n IntensityMax = 255,\n factor, red, green, blue;\n\n if((wavelength >= 380) && (wavelength < 440)) {\n red = -(wavelength - 440) / (440 - 380);\n green = 0.0;\n blue = 1.0;\n } else ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns whether a platform id represents a browser platform. | function isPlatformBrowser(platformId) {
return platformId === PLATFORM_BROWSER_ID;
} | [
"function isRBMPlatform (currentPlatform) {\n return currentPlatform == HIGH_DIMENSIONAL_DATA[\"rbm\"].platform ? true : false;\n}",
"function platform() {\n\tvar s = process.platform; // \"darwin\", \"freebsd\", \"linux\", \"sunos\" or \"win32\"\n\tif (s == \"darwin\") return \"mac\"; // Darwin con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WEAVE Weaves two queues into one queue with alternating content. The resulting queue should contain the contents from both queues. Eg. Weave([1,2,3],[Hi, Bye]) => [1,Hi,2,Bye,3] This uses the methods from the queue class created above. My solution | function weave(sourceOne, sourceTwo) {
let result = new Queue();
while (sourceOne.peek() || sourceTwo.peek()) {
if (sourceOne.peek()) {
result.add(sourceOne.remove());
}
if(sourceTwo.peek()) {
result.add(sourceTwo.remove());
}
}
return result;
} | [
"enQueue(item) {\n // move all items from stack1 to stack2, which reverses order\n this.alternateStacks(this.stack1, this.stack2)\n\n // new item will be at the bottom of stack1 so it will be the last out / last in line\n this.stack1.push(item);\n\n // move items back to stack1, from stack2\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listamos a los pacientes | list(_, res) {
return pacientes
.findAll({
})
.then(pacientes => res.status(200).send(pacientes))
.catch(error => res.status(400).send(error))
} | [
"buscarPacientes() {\n\t\tApiService.chamada(\"Paciente/Listar\").Listar()\n\t\t\t.then(resposta => resposta.json())\n\t\t\t.then(resultado => this.setState({ pacientes: resultado }))\n\t\t\t.catch(erro => erro);\n\t}",
"function imprimirPacientes(){\n for(i=0;i<this.pacientes.length;i++){\n ale... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to enrol user in a unit | function enrol_user_in_unit(unit_id, callback) {
$.ajax({ //save
type: 'post',
url: '/classes/enrol/' + unit_id,
success: function(response){
callback(response.success);
}
});
} | [
"function enrolParticipant(participantID, courseID)\r\n{\r\n //Find the participant and course in the database\r\n participant = getParticipantByID(participantID);\r\n course = getCourseByID(courseID);\r\n if(course == null || participant == null)\r\n return;\r\n \r\n //Enrol the participan... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
detect if there is a circularDependency in the dependency tree | detectCircularDependencies(root: Manifest, seenManifests: Set<Manifest>, pkg: Manifest): boolean {
const ref = pkg._reference;
invariant(ref, 'expected reference');
const deps = ref.dependencies;
for (const dep of deps) {
const pkgDep = this.resolver.getStrictResolvedPattern(dep);
if (seenM... | [
"validate() {\n let index = 0;\n\n // Map that assigns each dependency an index in visit-order.\n const indexMap = new Map();\n // Stack of dependencies that are potentially part of the current strongly\n // connected component. If any dependency has a back pointer it is kept\n // on the stack. Th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the child location ancestor given a specified location path | async getChildLocationAncestorFromPath(inpPath) {
// Get the ID to open
const { ID, path } = this.getExtractID(inpPath);
// Get the ancestor itself
const locationAncestor = await this.getChildLocationAncestor(ID);
// Return the data
return {
ID,
... | [
"async getChildLocationAncestor(ID) {\r\n // Determine the ID if not present\r\n const isNewID = ID != undefined;\r\n if (ID == undefined)\r\n ID = this.getData().ID;\r\n // Obtain this module's path, and child's path\r\n const path = this.getData().path || [];\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register click handler for request button | function onDocReady() {
$('#request').click(handleRequestClick);
} | [
"add_click(func) {\n this.add_event(\"click\", func);\n }",
"handleClick(event) {\n 'use strict';\n\n event.preventDefault();\n $.ajax({\n dataType: 'json',\n url: $(this).attr('href'),\n type: 'GET',\n success: $.otp.autorefresh.ajaxHandler\n });\n }",
"function addBu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generete TicTacToe field with rows and cols | function CreateHtml(cols) {
while (TicTacToe.firstChild) {
TicTacToe.removeChild(TicTacToe.firstChild);
}
function addCol(i,y){
var col = document.createElement('div');
var number = i*cols+y;
var divId = "box"+number;
var divClass = "co... | [
"function generateAnswerBoard() {\n\t\tfor (var i = 0 ; i < 9 ; i++) {\n\t\t\tfor (var k = 0 ; k < 9 ; k++) {\n\t\t\t\tvar col = i+1;\n\t\t\t\tvar row = k+1;\n\t\t\t\tvar string = \"a\"+(col)+(row);\n\t\t\t\tdocument.getElementById(string).value = goalBoard[i][k];\n\t\t\t\tdocument.getElementById(string).readOnly =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a boolean about whether the given duration has any time parts (hours/minutes/seconds/ms) | function durationHasTime(dur) {
return Boolean(dur.hours() || dur.minutes() || dur.seconds() || dur.milliseconds());
} | [
"check_time(time){\n\n if(typeof(time) == 'undefined' || time == null)\n return false;\n\n return moment(time, 'HH:mm:ss').isValid();\n }",
"isValidTimeSpan(expression) {\n return expression && /^(\\d+\\.)?(\\d+):(\\d+):(\\d+)$/gm.test(expression);\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update selected appointment status | async function updateAppointmentStatus(appointmentObj) {
const { id, status } = appointmentObj;
return await Appointment.findByIdAndUpdate(id, { status }).exec();
} | [
"@action\n statusChangeAction(field, value) {\n if (value == 'approved') {\n this.editEntry.set('create_entry', 1);\n }\n }",
"function updateStatus(reservation_id, status) {\n return db(tableName)\n .where({ reservation_id })\n .update({ status }, \"*\")\n .then((rows) => rows[0]);\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NewComment function is the functionality that allows users to add a new comment to a post. NewComment takes in post, user, commentList, and setCommentList. post is the post where NewComment is adding a new comment. user is the user of the NewComment, commentList is the list of comments under post, and setCommentList is... | function NewComment({ post, user, commentList, setCommentList }) {
const [commentText, setCommentText] = useState('');
//Keep tracks of comment changes in commentText.
function onCommentChange(event) {
setCommentText(event.target.value);
}
//Resets the comment input text box to blank.
function resetIn... | [
"function postComment () {\n let postContent = document.getElementById('comment').value;\n let postTitle = document.getElementById('title').value;\n // Body of the comment post to send to the server\n let post = {\n\t\ttitle : postTitle,\n\t\tcontent : postContent\n\t}\n // send the post\n makeRequest('posts'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns map layer config of a given legend item (config.legendItem) | function getMapLayerConfig(config) {
if (!config || config.legendItem._parent) return null;
var p = getPriorities(config.legendItem);
var mlc = getMapState(config).get_mapLayerConfigs() || [];
for (var i = 0, l = mlc.length; i < l; i++) {
if (mlc[i]._firstLegendItemPriority =... | [
"function renderLegend() {\n\t\t\titemX = initialItemX;\n\t\t\titemY = y;\n\t\t\toffsetWidth = 0;\n\t\t\tlastItemY = 0;\n\n\t\t\tif (!legendGroup) {\n\t\t\t\tlegendGroup = renderer.g('legend')\n\t\t\t\t\t.attr({ zIndex: 7 })\n\t\t\t\t\t.add();\n\t\t\t}\n\n\n\t\t\t// add each series or point\n\t\t\tallItems = [];\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the API icon for the api page | function renderApiIcon(header, title) {
if (ej.isAndroid()) {
header.append(ej.buildTag("div#apisettings", ej.buildTag("div.settingsapi")));
}
else if (ej.isWindows()) {
var winapi = ej.buildTag("div#apisettings", ej.buildTag("div.settingsapi"));
$("#windowssampleheader").find("#head... | [
"institutionIcon(id) {\n return 'static/institutions/' + id + '.png'\n }",
"drawIcon() {\n return `<i class=\"fab fa-sketch\"></i>`\n }",
"get icon_url() {\n return this.args.icon_url;\n }",
"function renderAPIResponse() {\n if (this.readyState == 4 && this.status == 200) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tree traversal methods Returns the vampire object with that name, or null if no vampire exists with that name | vampireWithName(name) {
if (this.name === name) {
return this;
}
for (let child of this.offspring) {
let vampire = child.vampireWithName(name);
if (vampire) {
return vampire;
}
}
return null;
} | [
"getNode(name) {\n return this.nodes.find((n) => n.name === name) || null;\n }",
"function getChildByName(node,name){return node.getChildMeshes(false,function(n){return n.name===name;})[0];}// Look through only immediate children. This will return null if no mesh exists with the given name.",
"getChil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |