query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Return a string containing a MySQL 5.6 `ALTER TABLE` statement | function alterTable(name, alterations) {
// Loop through `alterations` a bunch of times, collecting a different part
// of the `ALTER TABLE` statement each time.
// There will be at most one comment change, but allow multiple.
const commentChanges = alterations
.filter(alt => alt.kind === 'alter... | [
"renameTable(from, to) {\n this.pushQuery(\n `alter table ${this.formatter.wrap(from)} rename to ${this.formatter.wrap(\n to\n )}`\n );\n }",
"visitAlter_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function _addColumn(){\n self._visitingAlter = true;\n var table = sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Post multiples the modelview matrix with a scaling matrix and replaces the modelview matrix with the result | function gScale(sx,sy,sz) {
modelMatrix = mult(modelMatrix,scale(sx,sy,sz)) ;
} | [
"function gScale(sx,sy,sz) {\r\n modelViewMatrix = mult(modelViewMatrix,scale(sx,sy,sz)) ;\r\n}",
"static scale(_matrix, _x, _y, _z) {\n return Mat4.multiply(_matrix, this.scaling(_x, _y, _z));\n }",
"scale(scale) {\n const result = new Matrix();\n this.scaleToRef(scale, r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A module that lets you easily switch to certain themes. the SSL themes are publicly offered as members. | function themeSwitcher(){
// this makes the LightWeightThemeManager resource available.
// we need it to change the LightWeightThemes, also known as Personas.
var {Cu} = require('chrome');
var sslStatus = require('./sslHandler').SSLHandler.SSL_STATUS;
var PrefListener = require('./prefListener').Pre... | [
"function switchThemes(){\n var entirePage = document.getElementById( 'document-body' );\n if( entirePage.classList.contains( 'lightTheme' ) ){\n entirePage.classList.remove( 'lightTheme' );\n entirePage.classList.add( 'darkTheme' );\n document.cookie = \"theme=darkTheme;path=/\";\n }\n else if( entire... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clone an existing response profile. | static cloneAction(id, profile){
let kparams = {};
kparams.id = id;
kparams.profile = profile;
return new kaltura.RequestBuilder('responseprofile', 'clone', kparams);
} | [
"function copyDefaultProfile() {\n\n // Setup sample data for new user\n SampleData.setupFor(userId)\n .then(function getDefaultProfile() {\n return mongoUtils.getEntityById(DEFAULT_USER, USERPROFILE_COL_NAME, DEFAULT_USER, [DEFAULT_GROUP])\n })\n .then(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract translatable messages from an html AST | function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs) {
var visitor = new _Visitor(implicitTags, implicitAttrs);
return visitor.extract(nodes, interpolationConfig);
} | [
"static parseHTML( content, target, messages ){\n\n let search = function( node, map ){\n let children = node.children;\n for( let i = 0; i< children.length; i++ ){\n if( children[i].id ) map[children[i].id] = children[i];\n if( messages ){\n [\"title\", \"placeholder\"].forEach(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize variables such as lastUpdate (important for gravity !) | init(){
this.speedX=0;
this.speedY=-this.maxSpeed;
this.speedZ=0;
// these two components are used to know speed in the new coordinates after a rotation
this.speedXAfterRotate=0;
this.speedZAfterRotate=0;
let now = (new Date).getTime();
this.lastUpdate=n... | [
"initializeTimeProperties () {\r\n this.timeAtThisFrame = new Date().getTime();\r\n this.timeAtFirstFrame = new Date().getTime();\r\n this.timeAtLastFrame = this.timeAtFirstFrame;\r\n\r\n // time and deltaTime are local scene properties\r\n // we set the dynamically created t and dt in the update fra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render the given partial content | render(partialName, content) {
if (partialName != 'content' && !this.partials.has(partialName)) {
throw new Error(`Call to unknown partial: ${partialName}`);
}
if (this.events.trigger(`loading.${partialName}`, content, this) === false) return;
let selector = partialN... | [
"function _render( options ) {\n\n\t\tvar template_id = options.template_id,\n\t\t\t$target = options.$target,\n\t\t\tdata_url = options.data_url\n\t\t;\n\n\t\t$.ajax({\n\t\t\t'url': data_url,\n\t\t\t'dataType': 'json',\n\t\t\t'success': function( data ) {\n\n\t\t\t\tvar html = $( template_id ).html(),\n\t\t\t\t\tt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the current list of feed URL items. | function displayFeedsUrlList() {
const message = document.getElementById("feedsUrlMessage");
const headers = {"Authorization": getToken()};
apiRequest("GET", "get_feeds_url.php", null, headers, res => {
const jsonRes = JSON.parse(res.responseText);
for (const feed of jsonRes.feeds)
addFeedUrlToList(... | [
"function getFeedItems(feed) {\n\t\t$.ajax({\n\t\t url: urlBase + 'articles/' + encodeURIComponent(feed.feed),\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function (data) {\n\t\t\t\tko.utils.arrayForEach(data, function(item) {\n\t\t\t\t\tvm.displayedItems.push( new Item(feed, item) );\n\t\t\t\t\t\n\t\t\t\t\tvar b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Separate the controller to simplify testing Chart drilldown and recovery NOTE: Prototype approach gets messy in directives | function chartDirectiveCtrl($scope){
//Validates our click event and calls the parent drilldown function
$scope.drilldown = function(points, evt){
if($scope.hasDrilldown && points.length > 0)
{
$scope.click(points, evt);
}
};
//Check if we have anything stored (toggles return ... | [
"function createChart() {\n getSettings();\n $scope.chart = picasso.chart({\n element: $element.find('.adv-kpi-chart')[0],\n data: ds,\n settings: picassoSettings,\n beforeRender() { qlik.resize(); }\n });\n }",
"function sparklineChartCtrl() {\n\n /**\n * Inline chart\n *... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
to get existing device types | function getDeviceTypes() {
} | [
"function getDeviceType(axios$$1, token) {\n return restAuthGet(axios$$1, '/devicetypes/' + token);\n }",
"get supportedRootDeviceTypes() {\n return this.getListAttribute('supported_root_device_types');\n }",
"getAvailableDevices(controllerId) {\n\n var _thisSvc = this;\n\n var deviceList = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the AWS CloudFormation properties of an `AWS::AppMesh::VirtualNode.VirtualNodeHttpConnectionPool` resource | function cfnVirtualNodeVirtualNodeHttpConnectionPoolPropertyToCloudFormation(properties) {
if (!cdk.canInspect(properties)) {
return properties;
}
CfnVirtualNode_VirtualNodeHttpConnectionPoolPropertyValidator(properties).assertSuccess();
return {
MaxConnections: cdk.numberToCloudFormatio... | [
"function cfnVirtualGatewayVirtualGatewayHttpConnectionPoolPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnVirtualGateway_VirtualGatewayHttpConnectionPoolPropertyValidator(properties).assertSuccess();\n return {\n MaxConnections: cd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if alertA is worse than alertB Neither alertA nor alertB can be 'notice' | _statusIsWorseThan(alertA, alertB) {
const statusRank = {};
statusRank[SystemStatuses.ok] = 0;
statusRank[SystemStatuses.pending] = 1;
statusRank[SystemStatuses.attention] = 2;
// to be greater than is to be worse than
return statusRank[alertA] > statusRank[alertB];
} | [
"function checkForBlocking(p1Action, p2Action) {\n\t// Since the player with the most stamina will set the current actionCount we\n\t// need to see which ones has less or if they're equal. If one has less stamina then\n\t// we'll set up which block they chose. (i.e. punch-blocking, low-lick-blocking, high-kick-bloc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
by far, we have got a track's all measures, need to process,normalize | function normalizeMeasures(part) {
const measuresLengths = part.measures.map(a => a.beat.length);
console.log("12121212121212122", measuresLengths);
const lcmOfBeatLength = Util.lcm(...measuresLengths);
// 1.转换成对0 2.把track内所有小节beat统一长度
// 不能用foreach,foreach会直接bypass掉empty的(稀疏数组遍历)
// part.measures.forEach(... | [
"function Waveform2Score(wave_start, wave_end, measure_start, measure_end) {\n var wavesegment_options = {\n container: '#waveform',\n waveColor: '#dddddd',\n progressColor: '#3498db',\n loaderColor: 'purple',\n cursorColor: '#e67e22',\n cursorWidth: 1,\n selectio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates options for specific profiles | function updateProfileOptions(currentProfile) {
// show profile specific route options
var i, el;
for (var profile in list.showElements) {
if (currentProfile == profile) {
for (i = 0; i < list.showElements[profile].show.length; i++) {
el = $(list.s... | [
"function updateDriver() {\n profileFactory.updateProfile(vm.profile).then(\n function() {}\n );\n }",
"function addOption() {\n var province = profile.province;\n var country = profile.country;\n province.options[province.options.length] = SelectProvince;\n country.options[country... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws a trapezoid connecting a genomic range on one chromosome to a genomic range on another chromosome; a syntenic region. | drawSynteny(syntenicRegions) {
var t0 = new Date().getTime();
var r1, r2,
syntenies,
i, color, opacity,
regionID, regions, syntenicRegion,
ideo = this;
syntenies = d3.select(ideo.selector)
.insert('g', ':first-child')
.attr('class', 'synteny');
for (i = 0; i < syntenic... | [
"function makeCurlyBrace(x1,y1,x2,y2,w,q)\n\t\t{\n\t\t\t//Calculate unit vector\n\t\t\tvar dx = x1-x2;\n\t\t\tvar dy = y1-y2;\n\t\t\tvar len = Math.sqrt(dx*dx + dy*dy);\n\t\t\tdx = dx / len;\n\t\t\tdy = dy / len;\n\n\t\t\t//Calculate Control Points of path,\n\t\t\tvar qx1 = x1 + q*w*dy;\n\t\t\tvar qy1 = y1 - q*w*dx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh this Model instance's internal data by refetching from the database | async refresh() {
// Ensure model is registered before fetching model data
assert.instanceOf(this.constructor.__db, DbApi, 'Model must be registered.');
// Ensure this Model instance is stored in database
assert.isNotNull(this.__id, 'Model must be stored in database to refresh.');
// Replace this ... | [
"_update() {\n if (this.hydrateOnUpdate()) {\n return super._update().then((model) => {\n Object.assign(this, model);\n return this;\n });\n }\n\n return super._update();\n }",
"function redata(params, onUpdate) {\n // console.log('redata()', params);\n // If should... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inject a function that returns a number. | function inject (taskKey) {
var taskName = task[taskKey]
var num = parseFloat(taskName)
if (!isNaN(num)) {
funcs[taskName] = function () { return num }
}
} | [
"visitNumeric_function_wrapper(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function numberFact (num, fn) {\n return fn(num);\n}",
"visitNumeric_function(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function add5() {\n return function (x) {\n return add(x, 5);\n };\n}",
"function addsNum... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Precomputed BRDF, for using with PBR shaders | static PrecomputedBRDFLookupTexture(context) {
return Texture.FromBase64Image(context,bg.base._brdfLUTData);
} | [
"function coeff_biquad_lowpass12db(freq, gain) {\n var w = 2.0 * Math.PI * freq / samplerate;\n var s = Math.sin(w);\n var c = Math.cos(w);\n var q = gain;\n var alpha = s / (2.0 * q);\n var scale = 1.0 / (1.0 + alpha);\n\n var a1 = 2.0 * c * scale;\n var a2 = (alpha - 1.0) * scale;\n var... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Emit from a mesh renderer. | set MeshRenderer(value) {} | [
"get MeshRenderer() {}",
"set Mesh(value) {}",
"vertexToGeometry () {\n\n let prim = this.prim;\n\n let geo = this.geo; \n\n console.log( 'Mesh::vertexToGeometry()' );\n\n let vertexArr = this.vertexArr;\n\n let numVertices = vertexArr.length;\n\n let indexArr = this.in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Feed Page: Renders contents of the Feed page on the Feed Tab for SpeedScore web app Designed as a functional component. | function FeedPage() {
return (
<div id="feedModeTab" className="mode-page" role="tabpanel"
aria-label="Feed Tab" tabIndex="0">
<h1 className="mode-page-header">Activity Feed</h1>
<p className="mode-page-content">This page is under construction.</p>
<img class... | [
"function displayFeedsUrlList() {\n const message = document.getElementById(\"feedsUrlMessage\");\n const headers = {\"Authorization\": getToken()};\n apiRequest(\"GET\", \"get_feeds_url.php\", null, headers, res => {\n const jsonRes = JSON.parse(res.responseText);\n for (const feed of jsonRes.feeds)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a default dashboards in user collection | function createDefaultDashboards(createUser, finalCallback) {
async.waterfall([
function(wCallback) {
// in other way, find can be find({collection: 'default'}) or find({collection: {$in: ['default']}})
Dashboard.find({"default": true, "creatorRole":"BP"})
.populate("... | [
"function DashboardCollection(data, group) {\n var self = [];\n self.$add = DashboardCollection.prototype.$add;\n Object.defineProperty(self, '$add', {\n enumerable: false,\n writable: false\n });\n self.$findDashboard = DashboardCollection.prototype.$findDashboard;\n Obj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
deleteUser to delete a bucket given its id. | function deleteUser(req, res) {
User.remove({_id : req.params.id}, (err, result) => {
res.json({ message: "Bucket successfully deleted!", result });
});
} | [
"deleteUser( id ) {\n fluxUserManagementActions.deleteUser( id );\n }",
"function deleteUser(event) {\n let id = getUserId(event.target);\n fetch(url+\"/api/users/\"+id, {\n method: \"DELETE\",\n headers: {\n \"authorization\": jwt\n }\n }).\n then((response) => {\n if (response.ok) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is called when the instance is stopped. It removes the listeners for termination events. | _stopListeningForTermination() {
this._terminationEvents.forEach((eventName) => {
process.removeListener(eventName, this._terminate);
});
} | [
"_terminate() {\n if (this._instance) {\n this._instance.close();\n this._instance = null;\n this._stopListeningForTermination();\n this._options.onStop(this);\n }\n\n process.exit();\n }",
"stopListening() {\n this._eventsNames.forEach((eventName) => {\n process.removeListen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
pass this to the locationPicker component to change the selected day and call the API accordingly | selectLocation(selectedLocation){
this.callAPI(selectedLocation)
} | [
"function changeDay(){\n $(date_picker).val($(this).data('day'));\n}",
"function handleDay(e) {\n\t\tsetDay(e.target.value)\n\t}",
"function clickDay() {\n let oldSelected = document.querySelector(\".selectedDayTile\");\n if (oldSelected != null) {\n oldSelected.classList.remove(\"se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
continuously create new child streams, calling handler on active | function substreamOnActive(parentStream, opts, handler) {
const delay = opts.delay
const next = createSubstreamer(parentStream, opts)
setupListeners()
function setupListeners () {
let childStream = next()
onStreamActive(parentStream, () => handler(childStream))
onStreamIdle(parentStream, delay, () ... | [
"function onStreamActive(stream, handler) {\n stream.once('data', handler)\n}",
"function startStream (response) {\n\n\tchild.send('start'); \n\n\tresponse.writeHead(200, {\"Content-Type\": \"text/json\"});\n\tresponse.end('{\"status\":\"ok\"}');\n}",
"EnumerateStreams() {\n\n }",
"_next() {\n if (!thi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles user clicks on the period label. | currentPeriodClicked() {
this.calendar.currentView = this.calendar.currentView == 'month' ? 'multi-year' : 'month';
} | [
"function displayPeriod() {\n \n if (checkStandard()) {\n $('#time-period').text(getPeriod());\n } else {\n $('#time-period').empty();\n }\n }",
"function doManualClick()\n{\n // Clear interval\n if( interval != null )\n {\n clearInterval( interval ); \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a promise to retrieve index html | function getIndexHtml(searchString) {
var deferred = $q.defer();
$http.get(secSearchServiceBase + 'fetchIndex?url=' + searchString)
.success(function(data) {
deferred.resolve(data);
})
.error(function(msg, status) {
deferred.reject(msg);
})
return de... | [
"async web (relativePath, systemPath, stripSlashes) {\n const indexNames = []\n const file = new File(join(systemPath, 'index.html'))\n try {\n await file.stat()\n } catch (err) {}\n const hasIndex = file.mode && file.isFile()\n if (hasIndex) {\n indexNames.push('index.html')\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ref : reference to 'then' function cb, ec, cn : successCallback, failureCallback, notThennableCallback | function thennable(ref, cb, ec, cn) {
// Promises can be rejected with other promises, which should pass through
if (state == 2) {
return cn();
}
if ((_typeof(val) == "object" || typeof val == "function") && typeof ref == "function") {
try {
// cnt protects against abuse call... | [
"function thennable (ref, cb, ec, cn) {\n\t // Promises can be rejected with other promises, which should pass through\n\t if (state == 2) {\n\t return cn()\n\t }\n\t if ((typeof val == 'object' || typeof val == 'function') && typeof ref == 'function') {\n\t try {\n\n\t //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A utility function that makes interpolating variables into strings substantially cleaner | function format(string, vars) {
if (vars) {
for (var k in vars) {
string = string.replace(new RegExp('\\{' + k + '\\}', 'g'), vars[k]);
}
}
return string;
} | [
"function buildString() {\n var outString = arguments[0];\n for(var i = 1; i < arguments.length; i++) {\n outString = outString.replace(new RegExp(\"\\\\$\\\\[\" + i + \"\\\\]\", \"g\"), arguments[i]);\n }\n return outString;\n }",
"function threeStrings(x,y,z) {\n ret... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a random building height deviation value and return it. We use this to vary the building dimensions within the same block element. | function generateBuildingHeightDeviation() {
return getRandomIntBetween(0, maxBuildingHeightDeviation);
} | [
"randomHeight()\n{\n let r = this.randomRange(10,80);\n return r;\n}",
"function heightGenerator() {\n randomTop = Math.floor(Math.random()*600);\n randomBottom = Math.floor(Math.random()*600);\n\n if (randomBottom > 120 && randomTop > 120 && (randomTop + randomBottom) > 500 && (randomTop + randomB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to simulate the Ruby splat argument syntax. | function get_splat_args( func, args ) {
return Array.prototype.slice.call( args, func.length );
} | [
"function spreadForFunctionArgs(){\n multipleParams(1,2,3);\n\n let args = [1,2,3];\n multipleParams(...args);\n}",
"function spread(func, args){\n return func(...args);\n}",
"function logAsArray(...nums) {\n console.log(nums);\n}",
"visitTypedargslist(ctx) {\r\n console.log(\"visitTypedar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=====| fAnimateWidth Function |===== Animates element's width | function fAnimateWidth (elem, eWidth) {
tMx.to (elem, animTym, {css: {width: eWidth}, ease: easePower});
} | [
"set requestedWidth(value) {}",
"updateWidth() {\n if (this.setupComplete) {\n let width = this.headerData.getWidth();\n this.width = '' + width;\n this.widthVal = width;\n $(`#rbro_el_table${this.id}`).css('width', (this.widthVal + 1) + 'px');\n }\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a list of all assignments for the given school ID. | getAssignments(schoolID) {
return _get('/api/assignments', {school_id: schoolID});
} | [
"function getAssignmentsByCourseId(id) {\n return new Promise((resolve, reject) => {\n mysqlPool.query(\n 'SELECT * FROM assignments WHERE courseid = ?',\n [ id ],\n function (err, results) {\n if (err) {\n reject(err);\n } else {\n resolve(results);\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queue a validation for new custom styles to batch style recalculations | enqueueDocumentValidation() {
if (this['enqueued'] || !validateFn) {
return;
}
this['enqueued'] = true;
documentWait(validateFn);
} | [
"reStyle() {\n console.log('restyle')\n this._destroyStyles();\n this._initStyles();\n }",
"function addStyles() {\n\t styles.use();\n\t stylesInUse++;\n\t}",
"function updateErrorIndicators() {\n $scope.$apply(() => {\n //Error count is external t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new CheckInSubEntityTeamCoach instance | function CheckInSubEntityTeamCoach(parameters) {
var first_name = parameters.first_name, full_name = parameters.full_name, id = parameters.id, last_name = parameters.last_name, member_number = parameters.member_number, compliance_summary = parameters.compliance_summary, can_be_added_to_roster = parameters.can_b... | [
"function CheckInSubEntityTeamServicePersonnel(parameters) {\n var first_name = parameters.first_name, full_name = parameters.full_name, id = parameters.id, last_name = parameters.last_name, member_number = parameters.member_number, compliance_summary = parameters.compliance_summary, can_be_added_to_roster =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Proxy to a section instance | function sectionProxy(sectionName){
this.name = sectionName;
this.add = function(key, value){
biro.sections[this.name].add(key, value);
}
this.currentState = function(){
return biro.sections[this.name].currentState;
}
this.clear = function(){
biro.sections[this.name].clear();
}
this.length =... | [
"function sectionOn() { }",
"function deeplinkToSection( ){\r\n\r\n\r\n $('.container').each(function () {\r\n // Helper variables\r\n var sectionIndex = 0;\r\n var deepLinkIndex = 0;\r\n var deepLinkSection = getDeepLinkSection();\r\n\r\n\r\n\r\n // ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks for currently selected index and creates a label for a infolabel on hover. | function hoverOnState(handle){
var index = Index[indexSelected];
var code = index[year][handle.ST]
var lawDescrip = lawCodeLabel(code);
var labelText = "<h1><i>" + handle.State + "</i></h1><b><span style=float:right>" + year + "</span></b><p>" + lawDescrip + "</p>";
var infolabel = d3.select("#map-container")... | [
"function updateSelectedLabels() {\n\t\t\t\n\t\t\t var selectedLabels = vis.selectAll('text.selectedLabel').data(selectedNodeData);\n\t\t\t \n\t\t\t selectedLabels.enter().append('svg:text')\n\t\t\t \t.attr('class', 'selectedLabel')\n\t\t\t \t.attr('dx', function(d) {\n\t\t\t \tif (arcs.centroid(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
October 27, 2018 9:37 PM Instructions: / Write a function called "findMaxLengthOfThreeWords". Given 3 words, "findMaxLengthOfThreeWords" returns the length of the longest word. var output = findMaxLengthOfThreeWords('a', 'be', 'see'); console.log(output); // > 3 Notes: / The static function function Math.max() returns ... | function findMaxLengthOfThreeWords(word1, word2, word3) {
return Math.max(word1.length, word2.length, word3.length);
} | [
"function ThirdGreatest(strArr) { \n\n//Find the lengths of the strings\n var stringLengths = [];\n for (i=0; i < strArr.length; i++) {\t\t\t\t\t\t\t\t\t//Loop goes through each element in the string returning the lengths into a new array\n stringLengths[i] = strArr[i].length;\n }\n\n var unsortedLengths =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take an array of numbers and make them strings | function stringItUp(arr){
return arr.map(number => number.toString())
} | [
"function numToString(array) {\n let strings = array.map(function(num) {\n return num.toString();\n });\n return strings;\n}",
"toNumberString() {\n return this.toSortedArrayNumber().join(\",\");\n }",
"function arrayToString()\n{\n\tif ( ! arguments.length ) { return '/' + this.map( mapValue ).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom type guard for FileTypeDeclaration. Returns true if node is instance of FileTypeDeclaration. Returns false otherwise. Also returns false for super interfaces of FileTypeDeclaration. | function isFileTypeDeclaration(node) {
return node.kind() == "FileTypeDeclaration" && node.RAMLVersion() == "RAML10";
} | [
"function hasTypeAnnotation (path: NodePath): boolean {\n if (!path.node) {\n return false;\n }\n else if (path.node.typeAnnotation) {\n return true;\n }\n else if (path.isAssignmentPattern()) {\n return hasTypeAnnotation(path.get('left'));\n }\n else {\n return false;\n }\n}",
"is_image() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
stream_append appends first argument stream and second argument stream. In the result, null at the end of the first argument stream is replaced by the second argument stream stream_append throws an exception if the first argument is not a stream. Lazy? Yes: the result stream forces the actual append operation | function stream_append(xs, ys) {
return is_null(xs)
? ys
: pair(head(xs),
() => stream_append(stream_tail(xs), ys));
} | [
"function mergeStreams(streams) {\n streams = streams.filter(function(e) {return !!e});\n if (!streams || streams.length == 0) {\n return;\n }\n if (streams.length == 1) {\n return streams[0];\n }\n var result = merge(streams[0], streams[1]);\n for (var i = 2; i < streams.length; ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build router configuration array based on metadata used for the toolbar. IMPORTANT: router has to be configured before the first sync! | function configureRouter(root, metaData)
{
var i, item, routerConfig = {};
for (i = 0; i < metaData.length; i++)
{
item = metaData[i];
routerConfig[item.id] =
{
... | [
"merge(router) {\n for (var route of router.routes) {\n this.routes.push(route);\n }\n }",
"_register(config, routes, parentRoute) {\n routes = routes ? routes : this._routes;\n for (let i = 0; i < config.length; i++) {\n let { onEnter, onExit, path, outlet, children, defaultR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if x,y is 4 connected | function is4Connected (x, y) {
var c = getConnections(x, y);
for (var key in c) {
// console.log("$$border : "+key);
if (c[key] == null) {
console.log("border : "+key);
delete c[key];
};
};
if ((c._n == null || c._n.color != null) && (c._s == null || c._s.color != null) && (c._e ==... | [
"function is4SameColor (x, y, color) {\r\n\t\tvar c = getConnections(x, y);\r\n\r\n\t\tfor (var key in c) {\r\n\t\t\t// console.log(\"$$border : \"+key);\r\n\t\t\tif (c[key] == null) {\r\n\t\t\t\tconsole.log(\"border : \"+key);\r\n\t\t\t\tdelete c[key];\r\n\t\t\t};\r\n\t\t};\r\n\r\n\t\tif ((c._n == null || c._n.col... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns list of colors including the one at the coordinate and all the surrounding ones. | getSurroundingColors(coord) {
var colors = [];
for (var x = coord.x - 1; x <= coord.x + 1; x++) {
for (var y = coord.y - 1; y <= coord.y + 1; y++) {
var color = this.getColor(new Coord(x, y));
if (color !== null) {
colors.push(color);
}
}
}
return colors;
... | [
"function getColor(grid, x, y) {\n var idx = round((y * grid.width + x) * 4);\n var c = [grid.pixels[idx], grid.pixels[idx+1], grid.pixels[idx+2]];\n return c;\n}",
"function getColors(){\n var rgb = mixerBottle.attr('style').replace('background-color: rgb(', '').replace(')', '').split(',');\n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cast the spell, apply the condition, create and set flag | async function castSpell() {
try {
await game.dnd5e.rollItemMacro(spellName);
} catch (err) {
return null;
}
gm_macro.execute("apply", condition, target.id);
let globalDmg = {
targetId: target.data._id,
meleeAtk: bonuses.mwak.damage,
rangeAtk: bonuses.rwak.damage,
meleeSpell: bonuses.... | [
"function setWarlockSpell() {\n className = warlockName;\n if (actor.items.find(i => i.name === `${warlockSpell}`)) {\n spellName = warlockSpell;\n castSpell();\n } else {\n ui.notifications.error(\n \"Selected actor does not have the \" + warlockSpell + \" spell.\"\n );\n console.log(\"Selec... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check for session data and if not there, use SSO mechanism to log user in and retrieve the user info from the SSO identity provider | function ssoSession(req, res, next, config) {
var ssoToken = 'ssoSessionId'; // name of sso session ID parameter
// if we have a session, everything is fine
console.log('check if session is there ...'); // FIXME debugging output
// check if session is there
if (req.session && req.session.username) {
cons... | [
"function loginUser(){\n\tif(gActiveToken != null){\n\t\tvalidateToken();\n\t}\n}",
"function initLogin() {\n\t// first time page loaded login\n\t\n\t//do background login\n\t$.ajax({\n\t\turl : \"/GlobalInfoServlet\",\n\t\ttype : \"POST\",\n\t\tsuccess : function(jsonResult){\n\n if(!jsonResult.succes... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CUANDO PULSAS ICONO FLECHA /$icoArrow.on("click", scrollearHero); | function scrollearHero(){
$("#logo path").css("fill","white");
$hero.css("height", "30vh").css("marginTop","100px");
var altBegins = $(".batmanBegins").offset().top - $(".mainHeader .mainNav").height()-50;
$("html,body").animate({scrollTop:altBegins},1500);
$(".hero h1:nth-of-type(2)").css("top", "57%").css("... | [
"function megaMenuIcon() {\r\n\r\n var icons = document.querySelectorAll('.top-menu i');\r\n icons.forEach(element => {\r\n element.addEventListener('click', function (e) {\r\n if (e.target.classList.contains('fa-angle-down')) {\r\n e.target.classList.remove('fa-angle-down');\r\n e.target.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert `obj` to an integer (if `base` is given `obj` must be a string and `base` is the base for the conversion (default is 10)) | [symbols.call](obj=0, base=null)
{
let result;
if (base !== null)
{
if (typeof(obj) !== "string" || !_isint(base))
throw new TypeError("int() requires a string and an integer");
result = parseInt(obj, base);
if (result.toString() == "NaN")
throw new TypeError("invalid literal for int()");
ret... | [
"function binaryToBaseTen(binaryNumber) {\n //your code here\n}",
"function convertBase( str, baseOut, baseIn, sign ) { // 549\n var d, e, j, r, x, xc, y, // 550\n i = str.indexOf( '.' ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LC Status Details Page : Fill the LC Details based on Response | function fillTheLCStatusDetailsPage(LcDetails_ResponseObject) {
document.getElementById("Loc_Details_Trade_Id_Value").innerHTML = LcDetails_ResponseObject.Trade_Id;
document.getElementById("Loc_Details_Loc_Id_Value").innerHTML = LcDetails_ResponseObject.Lc_Id;
document.getElementById("Loc_Detai... | [
"function fillTheShipmentStatusDetailsPage(TradeDetails_ResponseObject) {\n\n document.getElementById(\"Shipment_Details_TA_Id_Value\").innerHTML = TradeDetails_ResponseObject.Trade_Id;\n document.getElementById(\"Shipment_Details_Buyer_Name_Value\").innerHTML = TradeDetails_ResponseObject.Buyer;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawDiamondOdd only applies for odd rows and cols | function drawDiamondOdd (rowIndex, colIndex, rows, length) {
if (rowIndex <= (rows - 1)/2){
return ((colIndex === (length-1)/2 - rowIndex)|| (colIndex === (length-1)/2 + rowIndex));
}
else {
return ((colIndex === (length-1)/2 - (rows - 1 - rowIndex))|| (colIndex === (length-1)/2 + (rows - 1 ... | [
"function drawDiamond(lineCount) {\n var middleP, fullStatsArr;\n var starsArr = Array(lineCount).fill(0).map((u, i) => { return i + 1; });\n if (lineCount % 2 == 0) {\n middleP = lineCount / 2;\n fullStatsArr = starsArr.slice(0, middleP).concat(starsArr.slice(0, middleP).reverse());\n } e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this is the equation evaluator input equation string like ma and inputs like ["m", "G"] this is pretty slow. don't do it in a tight loop this function is recursive. it cuts up the equation and analyzes each part separately. | function evaluateExpression(equation, inputs) {
//I'm pretty sure this removes all whitespace.
equation = equation.replace(/\s/g, "");
//if equation is an input (like 't'), return the value for that input.
if (equation in inputs) {
return inputs[equation];
}
//make each variable x like (... | [
"parseExpressionByOperator(expression, operator, index) {\n //startingIndex will be the index of where the expression slice will begin\n let startingIndex = index;\n //endingIndex will be the index of where expression slice ends.\n let endingIndex = index;\n const validOperators = ['-', '+', '/', '*'... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
createGamePage() : Game page creating function Creates the game page based on level returns a element with game header, left panel and right panel | function createGamePage(){
//The main container for the game
var levelDiv = createDiv();
levelDiv.classList.add('mainContainer');
//Adding the game header with home, back, learn and speaker icon
levelDiv.appendChild(createGameLevelHeader(level));
//Making sure the body is fit to fixed height
toggleFixed... | [
"function createGamePage() {\n var gamePage = document.createElement('main');\n gamePage.classList.add('game-board');\n gamePage.innerHTML = getGamePageStructure();\n body.appendChild(gamePage);\n showRecentGames(deck.player.name, '.win-game-list-one');\n}",
"function loadGamePage(lvl) {\n\n //Update the le... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get an existing MountTarget 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 MountTarget(name, state, Object.assign(Object.assign({}, opts), { id: id }));
} | [
"function MountTarget(props) {\n return __assign({ Type: 'AWS::EFS::MountTarget' }, props);\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) {\n return new Ser... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a pushToken function for a given type | function pushToken(type) {
return function (v) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var startColumn = opts.startColumn || column - String(v).length;
delete opts.startColumn;
var endColumn = opts.endColumn || startColumn + String(v).length - 1;
... | [
"function createFieldToken(field, id, type){\n \n // Get field value and token container\n \n let value = $(field).val();\n let container = $(field).siblings('.token-container');\n let tokenNo = $(container).find('.token').length + 1;\n \n // If token container doesn't exist, create it\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
options: object with any of the following keys followUpUrl: the url to redirect to after success currency: the three letter capitalized currency code to use amount: a preselected donation amount, if > 0 the first step will be skipped outstandingFields: the names of step 2 form fields that aren't satisfied by the values... | initialize (options = {}) {
this.initializeCurrency(options.currency, options.donationBands)
this.initializeSticky();
this.initializeBraintree();
this.handleFormErrors();
this.changeStep(1);
this.donationAmount = 0;
this.followUpUrl = options.followUpUrl;
this.initializeSkipping(options)... | [
"function createPaymentOptions() {\n\teditCashHistoryFundRowId = null;\n\tresetCashSection();\n\tshowTotalPaymentAndDue(); /* Disable the guest user more info and create account box */\n\tvar paymentOptionTypes = JSON.parse(localStorage.getItem(\"fundingSourceTypes\"));\n\tvar cashPaymentOptions = new Array();\n\tf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send the ajax query | function sendAjaxQuery(url, data) {
$.ajax({
url: url,
data: data,
dataType: 'json',
type: 'POST',
success: function (dataR) {
window.location.href = '/recruiterProfile';
},
error: function (jqXHR, status, err) {... | [
"function submitCustomQuery(text){\r\n\t\tvar endpoint=\"http://data.uni-muenster.de:8080/openrdf-sesame/repositories/bt\";\r\n\t\t//sent request over jsonp proxy (some endpoints are not cors enabled http://en.wikipedia.org/wiki/Same_origin_policy)\r\n\t\tvar queryUrl = \"http://jsonp.lodum.de/?endpoint=\" + endpoi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlight download button for user's platform | function highlightOSButton() {
var ua = navigator.userAgent;
var link;
if (ua.indexOf('Win') !== -1) {
link = windowsDownloadLink;
} else if (ua.indexOf('Mac') !== -1) {
link = macDownloadLink;
} else if (ua.indexOf('Linux') !== -1) {
link = linuxDownloadLink;
}
if (l... | [
"function setupDownloadButton (downloadButton) {\n var buttonData = getButtonData()\n downloadButton.href = buttonData.url\n downloadButton.getElementsByClassName('download-text')[0].textContent = buttonData.text\n for (var i = 0; i < buttonData.icon.length; i++) {\n downloadButton.getElementsByCla... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All Form Leads | async getLeadAll() {
this.props.navigation.navigate('AllLeads', {
title: 'All Leads',
type: 'multiple',
formData: false, selectFromFB: true
})
} | [
"function getListFormUrl(l, f) {\n\n\t\tvar thisForm, u;\n\n\t\t$().SPServices({\n\t\t\toperation: \"GetFormCollection\",\n\t\t\tasync: false,\n\t\t\tlistName: l,\n\t\t\tcompletefunc: function (xData, Status) {\n\t\t\t\tu = $(xData.responseXML).find(\"Form[Type='\" + f + \"']\").attr(\"Url\");;\n\t\t\t}\n\t\t});\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GLOBAL SCOPE // AJAX REQUEST TO TURN THE MARKERS ON AND OFF FOR EACG SET checks to see of the film title is in the turned on array if it is off, adds a marker to say that this film is turned on, calls ajax to get the data. success function calls the setpoints function in the map and sends the map point, the icon, the a... | function ajax_request_to_turn_markers_on_and_off(film,trigger) {
if (filmsTurnedOn.indexOf(film) == -1) { // Asks if the film is not in the on/off array
trigger.style.color = "rgb(231,174,24)"; // Takes the trigger link and changes the color to gold
filmsTurnedOn.push(film); // pushes the film to the... | [
"function waldoCarmen(){\n var request = xmlReq();\n request.open(\"GET\",\n \"http://messagehub.herokuapp.com/a3.json\",\n true);\n request.send();\n request.onreadystatechange = function(){\n if(request.readyState === 4 && request.status === 200){\n var locs = JSON.parse(request.responseText);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a transaction instruction that creates a new account at an address generated with `from`, a seed, and programId | static createAccountWithSeed(params) {
const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;
const data = encodeData(type, {
base: toBuffer(params.basePubkey.toBuffer()),
seed: params.seed,
lamports: params.lamports,
space: params.space,
programId: toBuffer(params.programId.toBuf... | [
"function generateNewAddress(){\n \n server.accounts()\n .accountId(source.publicKey())\n .call()\n .then(({ sequence }) => {\n const account = new StellarSdk.Account(source.publicKey(), sequence)\n const transaction = new StellarSdk.TransactionBuilder(account, {\n fee: S... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assert that the given number of resources of the given type exist in the template. | resourceCountIs(type, count) {
const counted = (0, resources_1.countResources)(this.template, type);
if (counted !== count) {
throw new Error(`Expected ${count} resources of type ${type} but found ${counted}`);
}
} | [
"hasResource(type, props) {\n const matchError = (0, resources_1.hasResource)(this.template, type, props);\n if (matchError) {\n throw new Error(matchError);\n }\n }",
"resourcePropertiesCountIs(type, props, count) {\n const counted = (0, resources_1.countResourcesPropert... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register a component resource. | registerComponent(component) {
this.requireValidComponent(component);
if (component.term.termType !== 'NamedNode') {
this.logger.warn(`Registered a component that is identified by a ${component.term.termType} (${component.value}) instead of an IRI identifier.`);
}
this.compon... | [
"registerModuleResource(moduleResource) {\n if (moduleResource.property.components) {\n for (const component of moduleResource.properties.components) {\n component.property.module = moduleResource;\n this.registerComponent(component);\n }\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the cart items availibility is loaded, returns whether all the items are availible | cartHasUnAvailibleItems() {
const itemAvailibility = Object.keys(this.state.itemsAvailible).map(
itemId => this.state.itemsAvailible[itemId],
);
return !itemAvailibility.every(itemAvailible => itemAvailible === true);
} | [
"isItemAvailableOnFavoriteStore (skuId, quantity) {\n this.store.dispatch(getSetSuggestedStoresActn(EMPTY_ARRAY)); // clear previous search results\n let storeState = this.store.getState();\n let preferredStore = storesStoreView.getDefaultStore(storeState);\n let {coordinates} = preferredStore.basic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initNums() takes no inputs and makes ajax request to retrieve 4 numbers to display screen | function initNums() {
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
//set fourNum equal to string list of integers retrieved by init.php
fourNum = this.responseText;
main();
}
console... | [
"function updateNums() {\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n //set fourNum equal to string list of integers retrieved by init.php\n\n fourNum = this.responseText;\n console.log(f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to mark an email as read | function mark_read(email_id) {
fetch('/emails/'+email_id, {
method: 'PUT',
body: JSON.stringify({
read: true,
})
})
console.log("Email marked as Read")
} | [
"function markAsRead(emailID) {\n let newRead = readEmails;\n if (!newRead.includes(emailID)) {\n newRead.push(emailID);\n }\n setReadEmails(newRead);\n }",
"_onChangeMarkAllAsRead() {\n if (\n !this.isMarkAllAsReadRequested ||\n !this.thread ||\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh product total price | function refreshProductTotal() {
var total = 0,
isPound = false;
$('#productsPanel .product-total').each(function() {
var productTotal = $(this).text();
if ( productTotal.charAt(0) === '&' ) {
productTotal = productTotal.replace('£','');
isPound = true;
} else {
productTotal = produ... | [
"function getTotalPrice() {\n var totalPrice = 0;\n _.each(createSaleCtrl.saleProducts, function(product) {\n totalPrice += product.price*createSaleCtrl.bought[product.barCode];\n });\n createSaleCtrl.totalPrice = totalPrice;\n }",
"@api\n addTo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides the "Hide maps with no year listed" checkbox if not sorting by year Parameters:selectedSort alllowercase string representation of the selected sort value controlsNode the node that contains the sorting/hide controls | function hideYearControl(selectedSort, controlsNode) {
var hideNoYearLabel = controlsNode.children[3];
if (selectedSort == "year") {
hideNoYearLabel.style.display = "inline-block";
} else {
hideNoYearLabel.style.display = "none";
}
} | [
"function hideNoYear() {\n\tvar controlsNode = this.parentNode.parentNode;\n\tvar maps = $(controlsNode).parent().parent().find('.map');\n\tvar mapsNode = $(controlsNode.parentNode.parentNode).find('.maps')[0];\n\tvar mapsToOutput = [];\n\tif (this.checked) { // Hide maps\n\t\tfor (var i = 0; i < maps.length; i++) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieve the attempt data | async function getAttempt() {
if(props.match.params.attemptNo=="highest"){
await microcredapi
.get(`/module/attempt/${props.match.params.studentId}/${props.match.params.courseId}/${props.match.params.moduleId}`)
.then(response => {
... | [
"function getLastOfflineAttemptData() {\n // Check if last offline attempt is incomplete.\n return $mmaModScorm.isAttemptIncomplete(scormId, lastOffline, true, false, siteId).then(function(incomplete) {\n lastOfflineIncomplete = incomplete;\n return $mmaModScormOf... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Solving for a hamiltonia cycle is NPcomplete, so this is a very specific solution that works purely for this size and starting position. | function hamiltonianCycle() {
var current_x = x[0] / IMG_SIZE;
var current_y = y[0] / IMG_SIZE;
var head_x = x[0] / IMG_SIZE;
var head_y = y[0] / IMG_SIZE;
//Head to top
while (current_y > 0) {
current_y--;
path.push(current_x + "," + current_y);
}
//Zig zag to the bottom (ending at bottom right c... | [
"function hamiltonianPath() {\n if (!isConnected()) {\n alert('This graph is not connected!');\n return;\n }\n stopAnimation();\n clearCyStyle();\n cy.elements().unselect();\n\n const nodes = cy.nodes();\n const len = nodes.length;\n /**\n * @param {cytoscape.NodeSingular[]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
a macro function stop all sound instances by iterating through lookup table | function stopAllSounds() {
var that = this;
for (var s in soundsLookup) {
if (soundsLookup.hasOwnProperty(s)) {
that.stop(s);
}
}
} | [
"function unmuteAllSounds() {\n var that = this;\n for (var s in soundsLookup) {\n if (soundsLookup.hasOwnProperty(s)) {\n that.unmute(s);\n }\n }\n }",
"function stop_other_audio_tracks()\n {\n for (var i = 1; i <= 3; i++)\n if (i != audio_player && audio_stream [i])\n audio_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SoundCloud XPCOM service component | function sbSoundCloud() {
// Imports
// XXX - Deprecate by migrating base-64 fn
Cu.import("resource://soundcloud/OAuth.jsm");
this.wrappedJSObject = this;
this.log = DebugUtils.generateLogFunction("sbSoundCloud");
this.listeners = new Listeners();
var login = Logins.get();
this.username = login.user... | [
"function privateInitSoundcloud(){\n\t\t/*\n\t\t\tCalls the SoundCloud initialize function\n\t\t\tfrom their API and sends it the client_id\n\t\t\tthat the user passed in.\n\t\t*/\n\t\tSC.initialize({\n\t\t\tclient_id: config.soundcloud_client\n\t\t});\n\n\t\t/*\n\t\t\tGets the streamable URLs to run through Amplit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
import PlayerNumber from './Component/PlayerNumber' | function App() {
return (
<div>
<Player number1= '3'/>
</div>
);
} | [
"ImportComponent(string, string) {\n\n }",
"getPlayerComponent(uid) {\n const agoraPlayer = this.selectComponent(`#rtc-player-${uid}`);\n return agoraPlayer;\n }",
"ImportUnconfiguredComponents(string, Variant, Variant) {\n\n }",
"function Player(){\n Paddle.call(this);\n \n this.x = 20;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
(generic implementation of callback_separate and callback_together overlap fns) | function _overlap_shapes_generic(a, b, callback, callback_separate) {
var result = overlapped_shapes(a, b);
if(result) {
//a, b is always required
callback(a, b);
if(callback_separate) {
//b,a only for callback_separate mode
callback(b, a);
}
}
return result;
} | [
"function overlap_shapes_callback_separate(a, b, callback) {\n\treturn _overlap_shapes_generic(a, b, callback, true);\n}",
"static conduct(a, b, callback, on) {\r\n callback(a, b)\r\n\r\n }",
"function callback(callback){\n callback()\n}",
"function collide_shapes_callback_together(a, b, callback) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A lazy accessor, complete with thrown error memoization and a decent amount of optimization, since it's used in a lot of code. Note that this uses reference indirection and direct mutation to keep only just the computation nonconstant, so engines can avoid closure allocation. Also, `create` is intentionally kept out of... | function Lazy(create) {
this.value = create
this.get = this.init
} | [
"function _computedLazy(fn) {\n return ko.computed({\n read: fn,\n deferEvaluation: true\n }).extend({\n notifyComparer: _simpleComparer\n })\n }",
"createProxy() {\n\t\treturn new Proxy(this, {\n\t\t\tget(target, prop, receiver) {\n\t\t\t\tlet x = +prop;\n\t\t\t\treturn new Proxy(target,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the wire game | function startWireGame() {
decrement(time);
var colors = ['red', 'yellow', 'green', 'blue', 'black'];
var $wireSelect = $('.wireS');
changeMouse($wireSelect);
// Random colors for top row
colors = shuffleArray(colors);
for (var i = 0; i < $wireSelect.length; i++) {
$wireSelect.eq(i).css('background-c... | [
"startGame() {\r\n this.generateInitialBoard();\r\n this.printBoard();\r\n this.getMoveInput();\r\n }",
"start() {\n \n //Start the game loop\n this.gameLoop();\n }",
"function run(){\n\n console.log(\"Attempting Setup\");\n stage = new PIXI.Stage(0x66FF99);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Recalculate the MOQ/IOQ flag for the product State saving | function recalculate_moqioq_flag(product_id)
{
var selected_supplier =order_list[product_id].selected_supplier;
//if no supplier is selected return
if (selected_supplier == -1) return;
//get supplier moq, ioq
var moq = order_list[product_id].pricing_list[selected_supplier].moq;
var ioq = order_list[product_id].p... | [
"function recalculate_moqioq_flag(product_id)\n{\n\tvar selected_supplier =order_list[product_id].selected_supplier;\n\t//if no supplier is selected return \n\tif (selected_supplier == -1) return;\n\t//get supplier moq, ioq\n\tvar moq = order_list[product_id].pricing_list[supplier_id].moq;\n\tvar ioq = order_list[p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
orders segments by rotation to make turning consistent | orderSegments() {
this.segments.sort(this.compareSegment);
} | [
"rotate() {\r\n //each piece has a different center of rotation uhoh, see image for reference\r\n //https://vignette.wikia.nocookie.net/tetrisconcept/images/3/3d/SRS-pieces.png/revision/latest?cb=20060626173148\r\n for (let c in this.coords) {\r\n this.coords[c][0] += this.rotationIn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the average between the current set of stats and the provided stats | average(stats) {
return this.add(stats).scale(0.5);
} | [
"function calculateAverage(){\n var sum = 0;\n for(var i = 0; i < self.video.ratings.length; i++){\n sum += parseInt(self.video.ratings[i], 10);\n }\n\n self.avg = sum/self.video.ratings.length;\n }",
"function updateAverage... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions / Get number of tweets posted by logged in user | function getNumberOfTweets(userId) {
tweetService.getTweetsByAuthor(userId).then(function(data) {
if (data !== null) {
return data.length;
} else {
// TODO: Handle error
return null;
}
});
} | [
"function showLastTweets() {\n\tvar params = {screen_name: 'trgmedina'};\n\n\tclient.get('statuses/user_timeline', { count: 20 }, function(error, tweets, response) {\n\t if (error) {\n\t console.log('Error occurred: ' + error);\n return;\n\t }\n\t else {\n\t \tfor (var i = 0; i < tweets.length; i++) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserpartition_extention_clause. | visitPartition_extention_clause(ctx) {
return this.visitChildren(ctx);
} | [
"visitPartition_extension_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitQuery_partition_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitIndex_partitioning_clause(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitPartition_by_clause(ctx) {\n\t return this.visitChildren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
drawPlayer() Draw the player as an ellipse with alpha based on health | function drawPlayer() {
fill(playerFill,playerHealth);
ellipse(playerX,playerY,playerRadius*2);
} | [
"function drawPlayer() {\n push();\n tint(255,playerHealth);\n image(playerHunter,playerX,playerY,playerRadius*5, playerRadius*5);\n pop();\n}",
"function createPlayer() {\n fill(230);\n circle(playerX, playerY, 40);\n}",
"function setupPlayer() {\n playerX = 4*width/5;\n playerY = height/2;\n playerHe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get notes of user inside ckeditor in iprofile when user visit another user profile. | function getNotesForProfile(event)
{
var uid = event.id ;
if (CKEDITOR.instances['note_'+uid])
{
CKEDITOR.instances['note_'+uid].destroy();
}
CKEDITOR.replace( 'note_'+uid, {
uiColor: '#6C518F',
toolbar:[
[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
... | [
"function loadJokes() {\n const user = localStorage.getItem(\"userInfo\")\n const userInfo = JSON.parse(user)\n const userID = userInfo[0]._id\n // console.log(\"also hi\")\n API.getUsersById(userID)\n .then(res => {\n // console.log(res.data)\n setJokes(res.data[0].savedJokes)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Click listener; on click, change to clicked cube (room) | clickListener(e) {
if (this.selectedMapCube !== null && this.selectedMapCube != this.selectedCube) {
this.enhancedCubes = [];
this.scaffoldingCubesCords = null;
this.selectedCube = this.selectedMapCube;
let directions = this.ref.methods.getDirections(this.selected... | [
"function yellowClick() {\n\tyellowLight();\n\tuserPlay.push(3);\n\tuserMovement();\t\n}",
"function goToRoom(newRoom)\n{\n\t// As soon as it's entered, the new room's description is printed.\n\tlookAtRoom(newRoom);\n\t// The current room is set to the newly entered room.\n\tcurrentRoom = newRoom;\n}",
"click (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Repush all events from the spreadsheet to the Calendar. Trigger: menu item. | function pushAll() {
console.log('Menu link clicked: Push all')
if (validateAction() == true) {
pushAllEventsToCalendar();
} else {
console.log('Sheet is not in the allowed list, skipping.')
}
} | [
"function pushAllEventsToCalendar() {\n console.log('Pushing all events to calendar');\n var dataRange = sheet.getDataRange();\n // Process the range.\n processRange(dataRange);\n console.log('Finished pushing all events');\n}",
"function deleteAndPushAll() {\n console.log('Menu link clicked: Delete and pus... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
| Function loadAuthorizer | Purpose: | | function loadAuthorizer(credentialsFile, cb) {
if (credentialsFile) {
fs.readFile(credentialsFile, function (err, data) {
if (err) {
logger.error('Mosca credentials file not found')
cb(err)
return
}
var authorizer = new Auth... | [
"function Authorizer(props) {\n return __assign({ Type: 'AWS::ApiGateway::Authorizer' }, props);\n }",
"async function load (req, res, next, id) {\n try {\n req.course = await User.get({ '_id': id })\n return next()\n } catch (e) {\n next(e)\n }\n}",
"function loadFromUserType() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getSubtreeWeight // Function: // Recursively traverses down the tree to get the total weight // of a node's subtree // Return value: // integer // | function getSubtreeWeight(subregion)
{
if (subregion == null)
{
return 0;
}
else
{
if (TREE_DEBUG_MSGS && DEBUG_MSGS) console.log("weight: " + subregion.weight);
return subregion.weight
+ _getSubtreeWeight(subregion.first )
+ _getSubtreeWeight(subregion.se... | [
"function SBParticipant_getWeight()\n{\n return extPart.getWeight(this.name, this.node);\n}",
"calculateTreeWidth() {\n let leftSubtreeWidth = nodeSize + 2 * nodePadding;\n let rightSubtreeWidth = leftSubtreeWidth;\n if (this.left != null) {\n leftSubtreeWidth = this.left.calculat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
changes drawType of selctor is changed | function drawSelectionChanged() {
drawType = drawSelector.value();
setImage();
} | [
"function menuDrawClick() {\n Data.Edit.Mode = EditModes.Draw;\n updateMenu();\n}",
"function ToggleDraw(){\n self.canvas.isDrawingMode = !self.canvas.isDrawingMode;\n }",
"selectData(val) {\n if (this._interpolation === \"attr_style_range\") {\n this._selectedData = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function updates each friend element that appears on the page. Once a friend's element is clicked, their respective user names/share codes will appear, as well as a couple helpful buttons/interactive text fields. | function changeFriendElement(friendKey){
var friendData;
for (var i = 0; i < userArr.length; i++){
if(friendKey == userArr[i].uid){
friendData = userArr[i];
break;
}
}
if(friendData != null) {
var userUid = friendData.uid;
var friendName = friendData.name;
... | [
"function update_user_elements() {\n $('.echo-item-authorName, .echo-item-avatar').each( function() {\n if(!$(this).hasClass('initialized')) {\n var container = $(this).parents('.echo-item-container');\n \n var userName = container.find('.echo-item-authorName').te... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is called when the the server instance is created. It starts listening for termination events that require the server to be stopped. | _startListeningForTermination() {
this._terminationEvents.forEach((eventName) => {
process.on(eventName, this._terminate);
});
} | [
"_stopListeningForTermination() {\n this._terminationEvents.forEach((eventName) => {\n process.removeListener(eventName, this._terminate);\n });\n }",
"startSocketServer() {\n // Create new socket.io server, listening on a specific path\n this.io = new Server(this.webServer, {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by KotlinParserdeclaration. | exitDeclaration(ctx) {
} | [
"exitNormalClassDeclaration(ctx) {\n\t}",
"exitSingleTypeImportDeclaration(ctx) {\n\t}",
"exitAnnotationTypeMemberDeclaration(ctx) {\n\t}",
"exitMultiVariableDeclaration(ctx) {\n\t}",
"exitMethodDeclarator(ctx) {\n\t}",
"exitTypeImportOnDemandDeclaration(ctx) {\n\t}",
"exitNormalInterfaceDeclaration(ctx... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change priorityInput view on input change | onPriorityInputChange(e){
if( e.target.value == '' || isANumber(e.target.value)) {
const newValue = {
...this.props.value,
selectedNode: {
...this.props.value.selectedNode,
priority: e.target.value
}
... | [
"function change(priority){\n if (priority == \"high\"){\n document.getElementById(\"priority\").selectedIndex = 0;\n }\n else if (priority =='medium'){\n document.getElementById(\"priority\").selectedIndex = 1; \n }\n else {\n document.getElementById(\"priority\").selectedIndex = 2; \n }\n}",
"set... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the duplicated elements that come before the real budgie elements | updateListStart() {
let numberAtTop;
if (this.hasOddEnding()) {
numberAtTop = this.numberLeftWithOddEnding();
} else {
numberAtTop = this.isHorizontal() ? this.options.numberHigh : this.options.numberWide;
}
let realElements = Array.from(document.querySelectorAll(`.budgie-item-${this.bu... | [
"updateExistingItems(){\n this.items.forEach((item, index) => {\n Array.from(document.getElementsByClassName(`budgie-${this.budgieId}-${index}`)).forEach((element) => {\n // If the element has changed then update, otherwise do nothing\n\n let newElement = BudgieDom.createBudgieElement(this, it... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Variables used for iterating page numbers FUNCTIONS Set the extension on the sectionnav class name needed when first loading the web site and resizing | function setSectionExtension() {
let currentWindow = null;
currentWindow = checkWindowSize();
document.querySelector('.section-nav').classList.add(currentWindow);
} | [
"function activateNavDots(name,sectionIndex){if(options.navigation&&$(SECTION_NAV_SEL)[0]!=null){removeClass($(ACTIVE_SEL,$(SECTION_NAV_SEL)[0]),ACTIVE);if(name){addClass($('a[href=\"#'+name+'\"]',$(SECTION_NAV_SEL)[0]),ACTIVE);}else{addClass($('a',$('li',$(SECTION_NAV_SEL)[0])[sectionIndex]),ACTIVE);}}}",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete call from existing calls and make next call as current | function deleteCall(callId) {
var callToDelete = self.get(callId);
if(callToDelete) {
for (var i = self.calls.length - 1; i >= 0; i--) {
if (self.calls[i].id == callId) {
self.calls.splice(i, 1);
}
}
... | [
"function qNext() {\n var o = deferreds.shift(); //remove first element\n\n if( o ){\n o.deferred\n .fail(function( xml, textStatus ){\n qNext();\n });\n o.deferred\n .done(function( xml, textStatus ){\n recombined.push({\n xml: ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle visibility of two div elements | function toggleDivs(elementToHide, elementToShow)
{
elementToHide.style.display = "none";
elementToShow.style.display = "block";
} | [
"function _toggleVisibility() {\n\n\t\tvisible = !visible;\n\n\t\tif (true === visible) {\n\t\t\tpanel.show();\n\t\t\t$(\"#phpviewlog-preview-icon\").addClass(\"active\");\n\t\t\tWorkspaceManager.recomputeLayout();\n\t\t} else {\n\t\t\tpanel.hide();\n\t\t\t$(\"#phpviewlog-preview-icon\").removeClass(\"active\");\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Computes a graphical a diff between the expected and actual images by rendering each to a canvas, getting the image data, and comparing the RGBA components of each pixel. The output is put into the diff canvas, with identical pixels appearing at 12.5% opacity and different pixels being highlighted in red. | function updateImageDiff() {
if (currentExpectedImageTest != currentActualImageTest)
return;
var expectedImage = $('expected-image');
var actualImage = $('actual-image');
function getImageData(image) {
var imageCanvas = document.createElement('canvas');
imageCanvas.width = imag... | [
"function compareImages(image1base64, image2base64) {\n resemble(image1base64)\n .compareTo(image2base64)\n .ignoreColors()\n .onComplete(function(data) {\n var output = data.getImageDataUrl();\n splitImage(callback, output)\n });\n}",
"function updateDiffImage()\n{\n var image = new... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initialize player's paddle with mousemove event | function setupPlayerPaddle() {
// bind updatePaddleLocation to mouse click events
console.log('setting up player paddle');
$('.pong-container').mousemove(function(event) {
updatePaddleLocation('.player', event);
});
} | [
"move() {\n // Derive mouse vertical direction.\n let touchYPosition = touches.length > 0 ? touches[touches.length - 1].y : this.position.y;\n let touchYDirection = touchYPosition - this.position.y;\n\n if (Math.abs(touchYDirection) <= this.height / 6) {\n this.setVelocity(createVector(0, 0));\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initializes a new instance of `XMLDocumentCB` `options.keepNullNodes` whether nodes with null values will be kept or ignored: true or false `options.keepNullAttributes` whether attributes with null values will be kept or ignored: true or false `options.ignoreDecorators` whether decorator strings will be ignored when co... | constructor(options, onData, onEnd) {
var writerOptions;
this.name = "?xml";
this.type = NodeType.Document;
options || (options = {});
writerOptions = {};
if (!options.writer) {
options.writer = new XMLStringWriter();
} else if (isPlainObject(options.writer)) {
... | [
"function xmlStringFromDocDom(oDocDom, encodeSingleSpaceTextNodes) {\n\tvar xmlString = new String();\n\n\t// if the node is an element node\n\tif (oDocDom.nodeType == 1 && oDocDom.nodeName.slice(0,1) != \"/\") {\n\t\t// define the beginning of the root element and that element's name\n\t\txmlString = \"<\" + oDocD... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clear the inner part of modules included in the compiler.externals, replace with SystemJS.import('three').then(res => exports = res) | function clearExternals(externals = [], compiler) {
} | [
"async removeExtraneousNodeModules() {\n // this is only relevant for the root workspace\n if (!this.isWorkspaceRoot) {\n return;\n }\n\n const workspacesInfo = await (0, _scripts.yarnWorkspacesInfo)(this.path);\n const unusedWorkspaces = new Set(Object.keys(workspacesInfo)); // check for any cr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removeSubscriber: takes an object Id and a query hash, and dissociates the hash from the object. | function removeSubscriber(id, hash) {
if (store[id]) {
delete store[id].queries[hash];
} else if (localSubscribers[id]) {
delete localSubscribers[id][hash];
if (Object.keys(localSubscribers[id]).length < 1) {
delete localSubscribers[id];
}
}
} | [
"unsubscribe(id, headers = {}) {\n delete this.subscriptions[id];\n headers.id = id;\n return this._transmit(\"UNSUBSCRIBE\", headers);\n }",
"function removeRecentSearchTerm( term ){\n recent.remove( term, function(){\n populateRecentSeachTerms();\n });\n}",
"function unregister(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |