query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Returns this class reoresentaion as a string in JSON format. Important: The value of km/yaer is a computed field and NOT part of the class, it's not included in the string. | toString() {
return "{ \"brand\": \"" + this.brand + "\", \"model\": \"" + this.model + "\", \"color\": \"" + this.color + "\", \"year\": " + this.year + ", \"km\": " + this.km + " }";
} | [
"toString() {\n return JSON.stringify(this.memory, this.getCircularReplacer());\n }",
"toString() {\n return JSON.stringify(this.toJSON());\n }",
"toJSON() {\n return {\n latitude: this._lat,\n longitude: this._long\n };\n }",
"toJSON() {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fix vertical when not overflow call fullscreenFix() if .fullscreen content changes | function fullscreenFix() {
var h = $( 'body' ).height();
// set .fullscreen height
$( ".content-b" ).each( function ( i ) {
if ( $( this ).innerHeight() <= h ) {
$( this ).closest( ".fullscreen" ).addClass( "not-overflow" );
}
} );
} | [
"function fullscreenFix() {\n var h = $('body').height();\n // set .fullscreen height\n $(\".content-b\").each(function (i) {\n if ($(this).innerHeight() <= h) {\n $(this).closest(\".fullscreen\").addClass(\"not-overflow\");\n }\n });\n }",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate a yup schema. | function validateYupSchema(values,schema,sync,context){if(sync===void 0){sync=false;}if(context===void 0){context={};}var validateData=prepareDataForValidation(values);return schema[sync?'validateSync':'validate'](validateData,{abortEarly:false,context:context});} | [
"function yupMaker(schema, config) {\n const { name, validationType, validations = [] } = config;\n if (!yup[validationType]) {\n return schema;\n }\n let validator = yup[validationType]();\n validations.forEach((validation) => {\n const { params, type } = validation;\n if (!validator[type]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the named range corresponding to the data table (ie as part of deleting the data table) | function deleteTableRange(ss, tableName, range) {
var matchingRange = range || findTableRange(ss, tableName)
if (range) {
tableName = range.getName()
} else {
tableName = buildTableRangeName_(tableName)
}
if (null != matchingRange) {
matchingRange.getRange().clear... | [
"removeRange({columns,owner,start,stop,table}) { this.$publish('removeRange', {columns,owner,start,stop,table})}",
"function deleteNamedRanges () {\n this.named_ranges = template_sheet.getNamedRanges();\n\n this.removeNamedRanges()\n\n // Apply pending Spreadsheet changes\n SpreadsheetApp.flush();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Rotate the vector by an angle and direction | rotate({ angle, direction }) {
// Throw an error if the angle is not an Angle
validate({ angle }, 'Angle');
// Throw an error if the direction is not a Direction
validate({ direction }, 'Direction');
// Create a Quaternion from the angle and direction
const rotationQuaterion = Quaternion.from... | [
"rotate(angle)\n {\n //rotate the vector clockwise by the given degrees\n var x = this.x * Math.cos(angle * Math.PI / 180) - this.y * Math.sin(angle * Math.PI / 180);\n var y = this.x * Math.sin(angle * Math.PI / 180) + this.y * Math.cos(angle * Math.PI / 180);\n\n return new Vector(x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures that all fields in the given array exist within the model | static assertFieldsExist(fields = []) {
if (fields === RETURNS_ALL_FIELDS) {
return;
}
const modelFields = this.fields();
// Ensure that all fields are defined within our model
const missing = fields.reduce((missing, field) => {
if (modelFields.indexOf(field) === -1) {
... | [
"function hasFields(model, fields, exists)\n{\n if ( isArray( fields ) )\n {\n for (var i = 0; i < fields.length; i++)\n {\n if ( !exists( model[ fields[ i ] ] ) )\n {\n return false;\n }\n }\n\n return true;\n }\n else // isString( fields )\n {\n return exists( model[ fiel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
share across calls. Convert any css string to 4 element Uint8ClampedArray TypedArray. If you need a JavaScript Array, use `new Array(...TypedArray)` | stringToUint8s (string) {
this.sharedCtx1x1.clearRect(0, 0, 1, 1)
this.sharedCtx1x1.fillStyle = string
this.sharedCtx1x1.fillRect(0, 0, 1, 1)
return this.sharedCtx1x1.getImageData(0, 0, 1, 1).data
} | [
"setCss (string) {\n return this.setColor(...Color.stringToUint8s(string))\n }",
"function convertUint8ArrayToArray(data) {\n return [...data];\n}",
"function DOMtoArray(string) { \n\tvar strLen = string.length;\n\t// break off the array enclosures '[' & ']'\n\tvar strEdit = string.slice(1,length-1);\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the json for this map | get map() {
return this._json
} | [
"\n ()\n {\n return (\n JSON\n .stringify( this.map_o )\n )\n }",
"function getJSON() {\n\t\treturn _json;\n\t}",
"toJSON() {\n return {\n latitude: this._lat,\n longitude: this._long\n };\n }",
"getJson() {\n let data = {};\n data.name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if current url is in the neverCacheUrls list | function checkNeverCacheList(url) {
if ( this.match(url) ) {
return false;
}
return true;
} | [
"function checkNeverCacheList(url) {\n if (this.match(url)) {\n return false;\n }\n return true;\n}",
"function check_never_cache_urls(url) {\r\n\tif (this.match(url)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}",
"function checkExcludeURLStatus() {\n var excludeStatus = false,\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
removes the dead units (occurs at the end of the update function) | removeDead(){
for(var i = 0; i < this.units.length; i++){
if(this.units[i].isDead()){
this.units[i].unitAnimations("Die");
//used to play the death animation for 4 seconds
var deathEvent = this.game.time.addEvent({ delay: 3000, callback: this.destroyUnit,
callbackScope: thi... | [
"unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }",
"removeAllSpawnables(){\n\n let currentSpawnables = this.spawnables.children;\n let amntCurrentSpawnables = currentSpawnables.entries.length;\n\n // done ma... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Accessing these APIs directly under context.foundation is deprecated. | function _registerLegacyAPIs() {
context.foundation = {
makeLogger,
startWorkers,
getConnection,
getEventEmitter: getSystemEvents
};
} | [
"_mapDeprecatedFunctionality(){\n\t\t//all previously deprecated functionality removed in the 5.0 release\n\t}",
"get deprecated() {\n return false;\n }",
"sendExperiences () {\n console.log('deprecated')\n }",
"function UContext() {\n }",
"isVertexArrayObjectSupported() {\n console.warn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prompts need at least two arguments passed in to work: theme name and Component name. Without those we can't create a basic component. | prompting() {
// If we DO have both the theme name _and_ component name passed
// as arguments we can skip all the prompts.
if (this.options.themeName && this.options.name) {
return;
}
let defaultThemeName = '';
try {
// See if package.json exists.
fs.accessSync(this.destinat... | [
"function customTheme(cb) {\n prompt.start();\n\n // Prompt and get user input then display those data in console.\n prompt.get(theme_name_prompt, function (err, result) {\n if (err) {\n console.log(err);\n cb();\n return 1;\n \n } else {\n // Get user input f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
react object inside the method, that will prepare the render to receive the json resource, after it's mounted. Therefore, it needs to define an empty attribute that will receive it. After the resource is received, the state will be updated in the render. in this case, the attribute will be an empty array called "player... | componentDidMount(){ //will happen after render()
axios.get('http://192.168.15.12:9000/api/players').then(response => {
const players = response.data;
this.setState({players});
});
//axios will GET (http method such as post, put, etc)
//...this resource, a Json with an objects list.
... | [
"renderPlayer() {\n return <Player\n information={this.player.info}\n nationalTeam={this.player.nationalTeam}\n age={this.player.age}\n name={this.player.name}\n playerID={this.player.id}\n currentTeam={this.player.currentTeam}\n />\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values, descriptors, and functions, for situations in which at least one part of the expression is async. Adapted from Sucrase ( See | async function _asyncOptionalChain(ops) {
let lastAccessLHS = undefined;
let value = ops[0];
let i = 1;
while (i < ops.length) {
const op = ops[i] ;
const fn = ops[i + 1] ;
i += 2;
// by checking for loose equality to `null`, we catch both `null` and `undefined`
if ((op === 'optionalAccess' ... | [
"function _optionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAcces... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the SVG picker's size. | _setPickerSize() {
const that = this,
parentWidth = that.$.svgContainer.offsetWidth,
parentHeight = that.$.svgContainer.offsetHeight;
let size = Math.min(parentWidth, parentHeight) * 0.9;
if (that._pickerSize !== undefined && that._pickerSize !== size) {
that... | [
"function setSVGSize() {\n var display = this._select.style(\"display\");\n\n this._select.style(\"display\", \"none\");\n\n var _getSize = getSize(this._select.node().parentNode),\n _getSize2 = _slicedToArray(_getSize, 2),\n w = _getSize2[0],\n h = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a boolean indicating that at least one task in the selection is on a calendar that is writable. | get todo_items_writable() {
let selectedTasks = getSelectedTasks();
for (let task of selectedTasks) {
if (cal.acl.isCalendarWritable(task.calendar)) {
return true;
}
}
return false;
} | [
"isCalendarWritable(aCalendar) {\n return (\n !aCalendar.getProperty(\"disabled\") &&\n !aCalendar.readOnly &&\n (!Services.io.offline ||\n aCalendar.getProperty(\"cache.enabled\") ||\n aCalendar.getProperty(\"cache.always\") ||\n aCalendar.getProperty(\"requiresNetwork\") ===... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
number to hex helper function | function toHex(n){return (n<16?"0":"")+n.toString(16);} | [
"function IntToHex(n)\r\n{\r\n\tvar result = n.toString(16);\r\n\tif (result.length==1) result = \"0\"+result;\r\n\treturn result;\r\n}",
"function hex(x) {\n return $builtin_base_convert_helper(x, 16)\n}",
"function hex($num) {\n var str = \"\";\n for(var j = 7; j >= 0; j--)\n str += _chars.charAt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the client area based on widget. | updateClientAreaByWidget(widget) {
this.clientArea.x = widget.x;
this.clientArea.y = widget.y;
this.clientActiveArea.x = widget.x;
this.clientActiveArea.y = widget.y;
} | [
"updateClientAreaLocation(widget, area) {\n widget.x = area.x;\n widget.y = area.y;\n widget.width = area.width;\n }",
"function updateWidget()\n {\n //todo\n }",
"updateClientAreaForTable(tableWidget) {\n this.clientActiveArea.x = this.clientArea.x = tableWidget.x;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
retrieves appropriate pair from the guestPairs array | function getPair(){
for (var i=0; i<3; i++){
if (roomGuest === guestPairs[i][0]){
if (guestPairs[i][1] != "alone"){
roomGuestPair = guestPairs[i][1];
} else {
roomGuestPair = "only myself";
}
} else if (roomGuest === guestPairs[i][1]){
roomGuestPair = guestPairs[i][0];
} else if (roomGuest ==... | [
"async function getPair() {\n const result = await db.query(\n 'select pair from meta where test_id = 1', []\n );\n return result[0].pair;\n}",
"getPriceFetcherForPair(a: string, b: string) {\n if (!this.boundPriceMapByExchange) {\n throw new Error('No price map yet! Call exchangeService.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggles the link modal, which will be populated by whatever url and openInNewTab values are given, if any. If none are given, it is assumed that we are creating a new link. If some are given, it is assumed that we are editing an existing link. | handleToggleLinkModal() {
const { modalComponent } = this.state;
if (modalComponent) {
this.handleCloseModal();
} else {
const { editorState } = this.state;
const contentState = editorState.getCurrentContent();
const entityKey = getSelectionEntity(editorState);
const entity = ... | [
"function showEditLinkModal(){\n resetModal();\n currEle.popover('hide');\n $('#modal').modal('show');\n $(\"#modal-title\").html('Add Link Address');\n $(\"#modal-body\").html('<b>Text you want the on the hyperlink:</b>\\\n <input type=\"text\" class=\"form-control\" id=\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
create a classroom and add it to the stored "list" ("dictionary" / object literal) of classroom objects | function createClassroom(classroomid) {
classrooms[classroomid] = {
clients: {},
students: {},
teacher: undefined
};
} | [
"addRoom(){\n\t\tvar newRoom = new Room(this);\n\t\tthis.rooms.push(newRoom);\n\t}",
"function setup_default_room(){\n var list = ['Java is the best', 'C++/C is the best', 'Python is the best', 'PHP is the best', 'JavaScript is the best'];\n for (var i =0, size = list.length; i < size; i++){\n console.log(li... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get metadata for a fax file pass in name of the fax file pass in response object | getFaxMetadata(faxFileName, res){
try{
this._connectToMongo();
} catch(e) {
console.error(e);
return res.status(500).send('Internal Server Error');
}
mongoose.connection.once('open', async function() {
console.log('connection opened for downloading');
var gridfs = Grid(mong... | [
"static metadataFromFile(file) {\n return {\n filename: file.name,\n };\n }",
"function extract_fax_info(sfax_response_obj){\n //var sfax_response_obj = JSON.parse('{\"inboundFaxItem\":{\"FaxId\":\"2190401201000980691\",\"Pages\":\"4\",\"ToFaxNumber\":\"18557916085\",\"FromFaxNumber\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Partitions a given array into 2 arrays, based on a boolean value returned by the condition function. | function partitionArray(arr, conditionFn) {
const truthy = [];
const falsy = [];
for (const item of arr) {
(conditionFn(item) ? truthy : falsy).push(item);
}
return [truthy, falsy];
} | [
"function partitionArray(arr, conditionFn) {\n const truthy = [];\n const falsy = [];\n for (const item of arr) {\n (conditionFn(item) ? truthy : falsy).push(item);\n }\n return [truthy, falsy];\n }",
"function partitionArray(arr, conditionFn) {\n var truthy = [];... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Math.min() and Math.max(): Write a function midrange, that calculates the midrange of 3 numbers. The midrange is the mean of the smallest and largest number. Example: midrange(3, 9, 1) should return (9+1)/2 = 5. | function midrange (a, b,c) {
let min = Math.min(a, b,c);
let max = Math.max(a, b,c);
let mid = (max+min)/2
return mid;
} | [
"function midrange(num1, num2, num3) {\n var theMin = Math.min(num1, num2, num3);\n var theMax = Math.max(num1, num2, num3);\n return (theMin + theMax) / 2;\n}",
"function midrange(num1, num2, num3){\n let min = Math.min(num1, num2, num3);\n let max = Math.max(num1, num2, num3);\n return (min + ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
movesnitch() Moves the snitch based on random velocity changes | function movesnitch() {
//noise time values
tx = tx + .005;
ty = ty + .015;
nx = noise(tx);
ny = noise(ty);
//map noise to correspond to snitch XY velocity
snitchVX = map(nx,0,1,-snitchMaxSpeed,snitchMaxSpeed);
snitchVY = map(ny,0,1,-snitchMaxSpeed,snitchMaxSpeed);
// Update snitch posi... | [
"move() {\n // Set velocity via noise()\n if (random() < 0.05) {\n this.vx = map(random(), 0, 1, -this.speed, this.speed);\n this.vy = map(random(), 0, 1, -this.speed, this.speed);\n }\n super.move();\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Occasionally it may be useful to make an expression behave as if it was 'hoisted', whereby the result of the expression is available before its location in the source, but the expression's variable scope corresponds to the source position. This is used extensively to deal with executable class bodies in classes. Callin... | hoist() {
var compileNode, compileToFragments, target;
this.hoisted = true;
target = new HoistTarget(this);
compileNode = this.compileNode;
compileToFragments = this.compileToFragments;
this.compileNode = function(o) {
return target.update(compileNode, o);
};
this.... | [
"hoist() {\n var compileNode, compileToFragments, target;\n this.hoisted = true;\n target = new HoistTarget(this);\n compileNode = this.compileNode;\n compileToFragments = this.compileToFragments;\n this.compileNode = function(o) {\n return target.update(compileNod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Executes a MySQL query to replace a specified comment with new data. Returns a Promise that resolves to true if the comment specified by `id` existed and was successfully updated or to false otherwise. | async function replaceCommentById(id, comment) {
comment = extractValidFields(comment, CommentSchema);
const [ result ] = await mysqlPool.query(
'UPDATE comments SET ? WHERE commentId = ?',
[ comment, id ]
);
return result.affectedRows > 0;
} | [
"async function updateComment(comment){\n //Insert new autosaved entry\n if (debug){console.log(\"updateComment() -> Called\");}\n try {\n var sql = \"UPDATE comments SET comment_text = $1::text WHERE comment_pk = $2::int AND comment_entry_fk = $3::int RETURNING comment_pk, comment_entry_fk, comment_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================== Functions =================================== This function sends some stats to my server, only your username and version of the script that you are using will be sent You can disable this from the script config menu | function sendStats() {
var username = getUsername(),
version = GM_info.script.version;
if (username && version) {
GM_xmlhttpRequest({
method: 'POST',
url: 'http://acid.nu/hbfs.php',
data: 'user='+ username +'&version='+ version,
headers: {'Content-Type': 'application/x-www-form-urlenco... | [
"function sendStats() {\n if (hostname.indexOf(\"local\") != -1) {\n cleanup();\n return;\n }\n var app = options.app;\n var key = hostname + \".\"+path;\n\n\n // Status Code\n var statusCode = res.statusCode || 'unknown... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update query string, assigning a new value to each parameter given in kvpairs | function updateQueryStringParameter(kvpairs) {
console.log('updateQueryStringParameter: begin');
var uri = URI(window.location.href);
for (var key in kvpairs) {
var value = kvpairs[key];
uri.removeSearch(key);
uri.addSearch(key, value);
}
return uri.href();
} | [
"function updateQueryStringParameter(key, value) {\r\n var uri_parts = window.location.href.split('/')\r\n var uri_local = uri_parts[uri_parts.length - 1]\r\n var re = new RegExp(\"([?&])\" + key + \"=.*?(&|$)\", \"i\");\r\n var separator = uri_local.indexOf('?') !== -1 ? \"&\" : \"?\";\r\n if (uri_local.match... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Username Validation / Have the function usernameValidation(str) take the str parameter being passed and determine if the string is a valid username according to the following rules: 1. The username is between 4 and 25 characters. 2. It must start with a letter. 3. It can only contain letters, numbers, and the underscor... | function usernameValidation(str) {
const letters = /[A-Za-z]/g, regExp = /[A-Za-z0-9_]/g, regExp_ = /[^_]/g;
if (4 < str.length < 25 && letters.test(str[0]) && regExp.test(str) && regExp_.test(str[str.length - 1]))
return true;
else return false
} | [
"function fnIsValidUsername(username){\n // username must have a length of minimum 1 char and maximum 31 chars\n if (username.length < 1 || username.length > 31){\n return false;\n }\n\n // username must start with a lowercase letter or an underscore\n if (fnValidateString(username.charAt(0), ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display message when trace is running | function traceRunning() {
console.log("Trace initialized...");
messageControl.onTraceStart();
} | [
"function showTrace() {Config.LogLevel = LogLevels.TRACE;}",
"function traceSuccess() {\n messageControl.onTraceComplete();\n var msg = \"Trace Complete\";\n console.log(msg);\n }",
"function trace( message) \n{\n if(!debugWindow || !debugWindow.open || debugWindow.closed)\n {\n debugWind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
wraps object returned by createElement in constructor function to have same signature as Class Component (call render) | function wrapper() {
this.render = () => {
return element;
};
} | [
"mountComponent(container){\n\n // get the wrapped class\n const Component = this._currentElement.type;\n\n // call the wrapped class\n const componentInstance = new Component(this._currentElement.props)\n \n // get the props of wrapped element\n let element = componentInstance.re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event handler for the select onchange event. Updates the speed with the new speed selected by the user by making an ajax request to the database to update the user's speed in the table. | function updateSpeed(){
var selectedSpeed = g.wpmSelect.value;
//validates first if the selected speed is a number between 50 - 20000
if(selectedSpeed.match(/^\d+$/) && g.speedArr.indexOf(selectedSpeed) !== -1){
var req = createHTTPRequest();
req.open("POST", "speedreaderajax.php", true);
req.onreadys... | [
"function updateSpeed() {\n\tturnSpeed = $(\"#speedSlider\").val();\n}",
"function updateSpeedOption() {\n var currText = 'Velocidad';\n var currValue = gameSpeed;\n $('#optSpeed').attr('value', currText + ' (' + currValue + ')');\n}",
"function updateSpeed(){\n\tspeedMultiplier = (document.getElementB... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unchecks all Checkboxes specified in the argument param: items An array of input fields | function ListHelp_uncheckAll(items) {
for (var i=0; i < items.length; i++) {
if (items[i].type == 'checkbox' ) {
// uncheck checkbox
items[i].checked = false;
}
}
} | [
"function uncheck_item(item_list){\r\n if (item_list.length>0){\r\n for(var i=0;i<item_list.length;i++)\r\n item_list[i].checked = false;\r\n }\r\n else{\r\n console.log(\"Cannot uncheck list element!\")\r\n }\r\n}",
"function uncheckAll(field){\n if(field){\n if(field.length){\n for (i ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Agregar gastos al listado | agregarGastoListado(gastos) {
this.limpiarHTML();
//iterar sobre los gastos
gastos.forEach(gasto => {
const { cantidad, nombre, id } = gasto;
//Crear un LI
const nuevoGasto = document.createElement('li');
nuevoGasto.className = 'list-group-item d... | [
"agregar_gasto_lista(nombre_gasto, cantidad_gasto) {\n\t\tconst listado_gastos = document.querySelector(\"#gastos ul\");\n\t\tconst li = document.createElement(\"li\");\n\t\tli.className =\n\t\t\t\"list-grop-item d-flex justify-content-between align-items-center\";\n\t\t// Insertar gasto\n\t\tli.innerHTML = `\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A shim for requirejs define calls that calls `exposedModules` on the array of dependencies before delegating to the requirejs function. | function shimmedRequirejsDefine(name, deps, callback) {
var modulesToExpose = _.isArray(name) ? name :
_.isArray(deps) ? deps :
parseDeps(name);
exposeModules(modulesToExpose);
warnOnPrivateModuleRequests(modulesToExpose);
requirejsDefine.apply(null, argumen... | [
"function shimmedRequirejsDefine(name, deps, callback) {\n var modulesToExpose = _.isArray(name) ? name :\n _.isArray(deps) ? deps :\n parseDeps(name);\n exposeModules(modulesToExpose);\n warnOnPrivateModuleRequests(modulesToExpose);\n requirejsDefine.apply(null, ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add prices of all checked activities and display in DOM | function updateActivitiesPrice(activityItems) {
activitiesTotalPrice = 0;
for (let i=0; i<activityItems.length; i++) {
if (activityItems[i].children[0].checked) {
const activityCost = parseInt(activityItems[i].children[0].getAttribute('data-cost'));
activitiesTotalPrice += activi... | [
"function getActivities() {\n var activities = document.querySelectorAll('.activities input');\n\n // Add event listener to every activity option\n for (var i = 0; i < activities.length; i++) {\n activities[i].addEventListener('click', activitiesEvent);\n }\n\n function activitiesEvent() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParsernewRegexDefinition. | exitNewRegexDefinition(ctx) {
} | [
"exitParse(ctx) {\n\t}",
"exitCompilationUnit(ctx) {\n\t}",
"exitSyntaxBracketLa(ctx) {\n\t}",
"exitSyntaxBracketLr(ctx) {\n\t}",
"exitRegexpPredicate(ctx) {\n\t}",
"exitSyntaxBracketRr(ctx) {\n\t}",
"exitSyntaxBracketRa(ctx) {\n\t}",
"visitNewRegexDefinition(ctx) {\n\t return this.visitChildren(ctx)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove User Security Role | function removeUserSecurityRole(index) {
vm.UserSecurityRoles.splice(index, 1);
} | [
"function removeRole() {\n db.Role.getRoles(roles => {\n promptSelectRole(roles).then(function (roleid) {\n db.Role.removeRole(roleid, role => {\n mainMenu();\n });\n });\n })\n}",
"unregisterRole(role) { delete this.roles[role.key]; }",
"function removeR... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if castling is possible with rook at given position TODO needs to check if King is currently in check | function canCastle(castlingKingTile, castlingRookTile) {
var canCastle = true;
if (castlingRookTile !== null && castlingRookTile.piece.type == 'Rook' && !castlingRookTile.piece.hasMoved && !castlingKingTile.piece.hasMoved) {
var possibleEnemyActions = [];
if (castlingKingTile.piece.isInCheck) { //if (inCheck(ca... | [
"function p4_check_castling(board, s, colour, dir, side){\n var e;\n var E;\n var m, p;\n var pawn = colour + 2;\n var rook = colour + 4;\n var knight = colour + 6;\n var bishop = colour + 8;\n var queen = colour + P4_QUEEN;\n var king = colour + P4_KING;\n\n /* go through 3 positions,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SEARCH ADDRESS parses the user input for the address search and calls the SearchAddress module to build a search request | function handleSearchAddressRequest(atts) {
var address = atts.address;
var lastSearchResults = atts.lastSearchResults;
lastSearchResults = lastSearchResults ? lastSearchResults.split(' ') : null;
ui.searchAddressChangeToSearchingState(true);
if (lastSearchResults) {
map.clearMarkers(map.SEARCH, la... | [
"function doAddressSearch() {\n var address = $(\"search_input\").value;\n var radius = $(\"select_radius\").value;\n \n g_searchService.search({\n address: address,\n radius: radius,\n filters: getFilters(),\n maxResults: MAX_RESULTS,\n sortBy: 'distance',\n mapId: MAP_ID,\n }, showAddressSe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will contact the TestAPI to update an existing test case. | function updateTestCase(name, testCase) {
if(testCase.name != ""){
var testCase_url = ctrl.requestUrl + '/' + name;
ctrl.testCasesRequest = $http.put(testCase_url, testCase)
ctrl.testCasesRequest.success(function (data){
ctrl.success = ... | [
"function updateContests() {}",
"updateTest() {\n // run the editors save method\n this.$refs.textEditor.saveEditorData()\n // update the document\n db.collection(\"tests\")\n .doc(this.$route.params.test_id)\n .update({\n title: this.title,\n type: this.departm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=================================================================== from functions/maths/PolarCoordinates.java =================================================================== Needed early: Builtin Needed late: Complex Pair Real | function PolarCoordinates() {
} | [
"toPolarCoords() {\n return ({\n r: Math.sqrt(this.x ** 2 + this.y ** 2),\n a: Point.angle(this),\n });\n }",
"toPolar()\r\n {\r\n return createVector(this.center.x + this.radius * cos(this.angle), \r\n this.center.y + this.radius * sin(this.angle));\r\n }"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creating New Patient through the forms | function createPatient() {
const patient = {
name: document.getElementById('name').value,
sex: document.getElementById('sex').value,
gender: document.getElementById('gender').value,
age: document.getElementById('age').value,
date_of_birth: document.getElementById('date_of_bir... | [
"function createPatient(id_, password_, email_, phoneNum_,fName_, lName_, gender_, bday_, hcNum_) {\n const newPatient = new Patient (id_, password_, email_, phoneNum_,fName_, lName_, gender_, bday_, hcNum_);\n patientList.push(newPatient);\n}",
"function addNewPatient(newPatient){\n\tlet id = newPatient.id... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
called when loaded for the first time or when all ops are purged | async function initOps() {
const newop = await loadNewDefaultOp();
await resetOps(); // deletes everything including newop
newop.update(); // re-saves newop
} | [
"function initOps() {\n const newop = loadNewDefaultOp();\n resetOps(); // deletes everything including newop\n newop.update(); // re-saves newop\n}",
"function loaded() {\n\t\t$$invalidate(3, counter++, counter);\n\t}",
"afterLoadData() {\n this.refreshRecurringEventsCache('splice', this.storage.allValue... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents an entity instance in the stage. This class cannot be instantiated directly, instances can be obtained using other methods such as `Canvace.Stage.forEachInstance`, `Canvace.Stage.getInstance` or their `Canvace.Stage.Entity` equivalents. In every moment, an entity instance is characterized by the following st... | function Instance(instanceOrId, element) {
var id, instance;
if (typeof instanceOrId !== 'number') {
id = null;
instance = instanceOrId;
} else {
id = instanceOrId;
instance = data.instances[id];
}
var entity = data.entities[instance.id];
var remove = instances.add(this);
if (entity.enablePhy... | [
"function Instance(instanceOrId, element) {\n\t\tvar id, instance;\n\t\tif (typeof instanceOrId !== 'number') {\n\t\t\tid = null;\n\t\t\tinstance = instanceOrId;\n\t\t} else {\n\t\t\tid = instanceOrId;\n\t\t\tinstance = data.instances[id];\n\t\t}\n\t\tvar entity = data.entities[instance.id];\n\n\t\tvar remove = ins... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert 2D array to markdown table. The first row is headings. | function twoDArrayToMarkdownTable(twoDArr) {
let output = " \n";
twoDArr.forEach((arr, offset) => {
let i = 0;
output += "|";
while (i < arr.length) {
output += arr[i] + "|";
i += 1;
}
output += " \n";
if (offset === 0) {
outp... | [
"function createMarkdownTable(objArray) {\n const modifiedArray = objArray.map((e) => {\n if (e.value === '') {\n e.value = '\"\"';\n }\n return [`\\`${e.name}\\``, e.description, e.extra ? '' : `\\`${e.value}\\``];\n });\n // return CliPrettify.prettify((toTable(modifiedArray, ['name', 'descriptio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a storyboard with frames that contain the different steps of the algorithm | storyboard() {
// Create the first frame by hand
var storyboard = new STORYBOARD.Storyboard(this);
for (var i = 1; i < 5; i++) {
for (var k = 0; k <= i; k++) {
var frame = new STORYBOARD.Storyboard.Frame();
... | [
"function StoryBoard(animations){\n\t\tthis.animationset = animations;\n\t\tthis.clock = 0;\n\t}",
"function Storyboard(name,n,x0,xd,y0,y1,tol,imgPath,imgExtn,key,markScale) {\r\n\tif (arguments.length==0) return\r\n\tif (x0==undefined) x0=8\r\n\tif (xd==undefined) xd=96\r\n\tif (y0==undefined) y0=8\r\n\tif (y1==... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
remove message group from Message End Event & Message Throw Event | function removeMessageGroup(groups, element) {
const messageGroup = findGroup(groups, 'message');
if (isMessageEndEvent(element) || isMessageThrowEvent(element)) {
groups = groups.filter(g => g != messageGroup);
}
return groups;
} | [
"onMessagesRemoved() {}",
"onMessageRemovalFailed() {}",
"onGroupEnd () {\n this.activeGroup = null\n }",
"function onGroupLeave (e) {\n\n // If the client is currently having a call with the endpoint, we need to hang that up\n if (call && call.remoteEndpoint.id === e.connection.endp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Number > Number Heals the human player by healthRestore amount given: a health restore amount of 20 and a player with 80 health expected: 100 | heal(healthRestore) {
if (this.health + healthRestore > 100) {
this.health = 100;
}
else {
this.health += healthRestore;
}
return this.health;
} | [
"function restoreHealth() {\n playerHealth += hero.wis * 3;\n if (playerHealth > playerMax) {\n playerMax = playerHealth\n }\n}",
"function getHealth(playerLevel) {\n const healthBonusFromLevel = playerLevel * 15;\n return 85 + healthBonusFromLevel;\n}",
"function healthbar(max, health){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
identifyDocsNeeded looks at a caseSet.docRIDs and identifies all the doc records we need to retrieve for those cases | function identifyDocsNeeded(caseSet){
//caseSet is an array, for each case record object, in_filedIn is an array of strings with the recordID of an Edge leading to a document
var uniqueEdges = new Map(); //used to collect unique doc IDs in it's keys
var docEdges = new Array(); //the array of unique edges we will ret... | [
"function identifyPeopleNeeded(caseSet){\n\t//caseSet is an array, for each case record object, in_filedIn is an array of strings with the recordID of an Edge leading to a document\n\tvar uniqueEdges = new Map(); //used to collect unique doc IDs in it's keys\n\tvar personEdges = new Array(); //the array of unique e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Verse of the Day Picture | function getVerseOfTheDayPicture() {
let today = new Date();
let year = today.getFullYear();
var janFirst = new Date(year, 0, 1, 1, 1, 1, 1);
var days = daydiff(janFirst,today);
var dailyVersePictureToGet = Math.ceil((((days / 23) - Math.floor((days / 23)))) * 23);
console.log(dailyVersePictureToGet)... | [
"function DayNightBackground(){\n CurrentTime = new Date().toLocaleTimeString();\n console.log(\"System time: \" +CurrentTime);\n if (CurrentTime >= SRtimeFormat){\n image(ImgDay,0,0);\n }\n if (CurrentTime >= SStimeFormat || CurrentTime < SRtimeFormat){\n image(ImgNight,0,0);\n }\n}",
"function today... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the delegate function applied to a model property by Kontext | function getDelegate(model, key) {
var result = false,
property = key.split('.'),
desc;
// deal with scoped keys such as 'foo.bar', which needs to address the 'bar' property in the submodel
// residing in model.foo
property.forEach(function(name, index, all) {
if (key) {
key = name in mo... | [
"function getDelegate(model, key) {\n\t\t\tvar result = false,\n\t\t\t\tlist, length, property, desc;\n\n\t\t\tif (model && typeof model === 'object') {\n\t\t\t\tif (key in model) {\n\t\t\t\t\t// if a model key is an explicitly assigned delegate, we utilize it\n\t\t\t\t\tif (isDelegate(model[key])) {\n\t\t\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function pour la valeur du select Retourne la valeur du select selectId | function getSelectValue(selectId)
{
/**On récupère l'élement html <select>*/
var selectElmt = document.getElementById(selectId);
/**
selectElmt.options correspond au tableau des balises <option> du select
selectElmt.selectedIndex correspond à l'index du tableau options qui est actuellement sélectionné
*/
return ... | [
"function get_select_value(selectId)\n{\n\tvar index=selectId.selectedIndex;\n\tvar value=selectId.options[index].value;\n\treturn value;\n}",
"function getSelectedOptionValue(selectId)\r\n{\r\n var index = selectId.selectedIndex; //get the selected item index number \r\n var value = selectId.options[ind... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================================================== if global = 'X', then id_libelle come from common iknow text if text exists ans global not set, then put raw text if only id_libelle is define, then replace by local iobject text if chaine is not null that means &1 string in text will be replace by chai... | function set_text_help(id_libelle,texte,global,chaine,extended_help)
{
if(typeof(global) == 'undefined' || global == '')
{
if(typeof(texte) == 'undefined' || texte == '')
{
var libelle_temp = decodeURIComponent(libelle[id_libelle]);
}
else
{
var libelle_temp = t... | [
"function over(id_doc,id_help,texte,global,chaine)\r\n\t{\r\n\t\tikdoc(id_doc);// Add call of doc page\r\n\t\tset_text_help(id_help,texte,global,chaine,id_doc);\r\n\t}",
"function replaceTextAtlassian(shortcut, autotext)\n {\n debugLog(\"Domain: Atlassian\");\n\n // Get the focused / selected text node\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trynna get permanent access code | function getPermAccessCode () {
FB.api(
"/"+account_id+"/accounts/?access_token="+longer_token,
function (response) {
if (response && !response.error) {
console.log('API response - trynna get perm code', response);
perm_token = response.data[0].access_token;
getGroupFeed();
get... | [
"function getAuthCode()\r\n{\t\r\n\tvar authCode;\r\n\tauthCode = sendRequest(\"/ssadmin/dog/configinfo.html?data=AuthCode\"); \r\n\treturn \"\"+authCode+\"\";\r\n}",
"function get_new_access_code(){\n\n var url = ACCESS_URL + 'grant_type=client_credential';\n url += ('&appid=' + config.TEST_APPID);\n u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Community functions /////////////////// //////////////////////////////////////////////////////////// /////// Add community center points to primary nodes | function findCommunityCenters() {
//Run a community algorithm on the primary nodes
var community = jLouvain().nodes(nodes_primary.map(function (d) {
return d.id;
})).edges(edges_primary);
var community_result = community(); //Find the number of nodes per community
community_count = byCount(d3... | [
"function findCommunityCenters() {\r\n //Run a community algorithm on the primary nodes\r\n let community = jLouvain().nodes(nodes_primary.map(d => d.id)).edges(edges_primary)\r\n let community_result = community()\r\n\r\n //Find the number of nodes per community\r\n community_co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds assignment to class | function addAssignmentToClass(db, res, classID, assignmentID) {
var classesCollection = db.collection('classes');
classesCollection.update({'id':classID}, {$push:{'assignments':assignmentID}}, function(err, result) {
if (err) {
console.log(err);
}
});
} | [
"function Assignment() {\n this.name = \"\";\n this.submissionLink = \"\";\n this.contents = new Array();\n // Some assignments consist of text directly on the Assignments link\n this.memo = \"\";\n this.type = this.constructor.name;\n}",
"assign(A, a) {\n this.assignment[A] = a;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[res, partialScore] = canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, currWord) | canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, word){
let result = false;
let partialScore = 0;
// Test if we can put the word at x, y, Vertical.
// Test if the star and end position are over invalid state value terminate early.
let endY = y + word.le... | [
"canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, word){\n let result = false;\n let partialScore = 0;\n\n // Test if we can put the word at x, y, Horizontal.\n \n // Test if the star and end position are over invalid state value terminate early.\n let en... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init the current view as the top right view of the quad view | initTopRight(){
this._config = {
left: 0.5,
bottom: 0.5,
width: 0.5,
height: 0.5,
position: [ 0, -this._objectSize, 0 ],
up: [ 0, -1, 0 ],
// init with a given angle to correct issues
initAngle: {
axis: new THREE.Vector3( 1, 0, 0 ),
angle: -0.0001
... | [
"initTopRight(){\n this._config = {\n left: 0.5,\n bottom: 0.5,\n width: 0.5,\n height: 0.5,\n position: [ 0, -this._objectSize, 0 ],\n up: [ 0, -1, 0 ],\n // init with a given angle to correct issues\n initAngle: {\n axis: new THREE.Vector3( 1, 0, 0 ),\n ang... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fetch todos using GraphQL+ query | async fetchTodos() {
const query = `{
todos(func: has(is_todo))
{
uid
title
completed
}
}`
const res = await this.dgraph.newTxn().query(query)
return res.data.todos || []
} | [
"async fetchTodos({ commit }) {\n console.log(commit)\n const response = await axios.get('http://apicreation-260015.appspot.com/todos');\n console.log(response.data)\n commit('setTodos', response.data) //in order to call the mutation, we need to use commit. The first argument is setTodos in mut... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Progress bar based on pseudologarithmic progression | function startProgressBarLogProgression(part,max){
var partition=1;
if(part!=null){
partition=part;
}
var maxTot=1200;
if(max!=null){
maxTot=max;
}
createProgressBar(maxTot,1);
if(interval!=null){
clearInterval(interval);
}
interval=setInterva... | [
"onProgress(level, currentValue, maxValue, statusLine) {\n let prefix = \"• \".repeat(level);\n console.log(prefix + \"[\" + currentValue + \"/\" + maxValue + \"] \" + statusLine);\n }",
"function bar_progress(direction) {\n const number_of_steps = progressLine.data('number-of-steps');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add disableinteraction layer and adjust the size and position of the layer | function _disableInteraction () {
var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');
if (disableInteractionLayer === null) {
disableInteractionLayer = document.createElement('div');
disableInteractionLayer.className = 'introjs-disableInteraction';
this._t... | [
"function _disableInteraction(){var disableInteractionLayer=document.querySelector(\".introjs-disableInteraction\");if(disableInteractionLayer===null){disableInteractionLayer=_createElement(\"div\",{className:\"introjs-disableInteraction\"});this._targetElement.appendChild(disableInteractionLayer);}setHelperLayerPo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Activate interaction on the menu. Wire up keyboard listerns for clicks, keypresses, backdrop closing, etc. | function activateInteraction() {
element.addClass('md-clickable');
// close on backdrop click
if (opts.backdrop) opts.backdrop.on('click', onBackdropClick);
// Wire up keyboard listeners.
// - Close on escape,
// - focus next item on down arrow,
// - focus prev ... | [
"function activateInteraction(){element.addClass('md-clickable');// close on backdrop click\n\tif(opts.backdrop)opts.backdrop.on('click',onBackdropClick);// Wire up keyboard listeners.\n\t// - Close on escape,\n\t// - focus next item on down arrow,\n\t// - focus prev item on up\n\topts.menuContentEl.on('keydown',on... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Trigger cancellation of the upgrade process and go back to landing page | function cancelUpgrade() {
vm.running = true;
upgradeFactory.cancelUpgrade().then(
function(/* response */) {
vm.running = false;
$uibModalInstance.dismiss();
// reset steps state
upgradeStepsFactory.... | [
"async onAbortOtherMigration() {\n State.commit('swagMigration/ui/setIsLoading', true);\n State.commit('swagMigration/process/setIsMigrating', true);\n\n await this.migrationWorkerService.isMigrationRunningInOtherTab().then((isRunning) => {\n if (isRunning) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets and sets the innerRef property value. | get innerRef() {
return this.#innerRef
} | [
"get ref() { return this._ref; }",
"getElementRef() {\n return this.elementRef;\n }",
"getReference() {\n return this.nodeReference;\n }",
"get localReference() {\n return this.localRef;\n }",
"get rootRef() {\n return this._db.ref();\n }",
"assignNestedValue(ref, value) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add a line to the legend (color + label) | _renderLegendLine(color, label) {
let legendSvg;
switch (this.layerType) {
case 'fill':
legendSvg = svg`<svg width="30" height="15">
<rect width="30" height="15" style="fill:${color};fill-opacity:1;stroke-width:1;stroke:#444"></rect>
... | [
"lineRender(){\n d3.select('.circle-legend').select('svg').append('line').attr('x1',0).attr('x2',180).attr('y1',0).attr('y2',0)\n .attr('transform','translate(0,55)').classed('legendLine',true)\n }",
"function addLegend() {\n let x = 513;\n let y = 40;\n let legendcircle = midpoint\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit Custom Complexity Values | function editComplexity() {
setUpdateComplexityList(list);
findSummation(list);
setOpen(false);
} | [
"function editComplexity() {\n const apiId = api.id;\n const apiClient = new Api();\n const promisedComplexity = apiClient.updateGraphqlPoliciesComplexity(\n apiId, {\n list: editlist,\n },\n );\n updateAPI({ complexity });\n setComplexi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function longWordCount(string) that takes in a string and returns the number of words longer than 7 characters. | function longWordCount(string) {
var words = string.split(" ");
var count = 0;
for (var i = 0; i < words.length; i++) {
if (words[i].length > 7) {count += 1}
}
return count;
} | [
"function longWordCount(string)\n{\n\tvar noOfWords = 0;\n\n\tvar words = string.split(\" \");\n\n\tfor(var i = 0; i<= words.length - 1; i++)\n\t{\n\t\tvar word = words[i];\n\t\tif(word.length > 7)\n\t\t{\n\t\t\tnoOfWords += 1;\n\t\t}\n\t}\n\treturn noOfWords;\n}",
"function longWordCount(string) {\n var string... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change the displayed tree to tree two | function setTreeTwo(){
data = tree_two;
readTree();
d3.select("svg").remove();
drawUI();
} | [
"function treedisplay(ATREE){\n var height = 600;\n var width = 400;\n //var ATREE = document.getElementById('ATREE').innerHTML;\n d3.text(ATREE, function(error, newick){\n var tree = d3.layout.phylotree()\n .svg(d3.select(\"#tree_display\"))\n .options({\n 'z... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the set of IDs used by items in the queue. Arguments: callback Callback Arguments: error A string or null. reply The Redis reply object. | function queueGetIds(callback) {
return this.mredis.lrange("feed.ids:" + this.name, 0, -1, callback);
} | [
"function queueGet(timeout, callback) {\n if(!timeout) timeout = 0;\n this.bredis.brpop(\"feed.ids:\" + this.name, timeout, function(err, result) {\n if(!err) {\n var id = result[1];\n this.mredis.multi()\n .hget(\"feed.items:\" + this.name, id)\n .hdel(\"fee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Edit entity by wizard | edit(options) {
return this.wizardInvokeService.openWizard(Object.assign(options, {
title: this._buildTitle(options.service.entityName, 'wizard_edit_caption'),
isNew: false,
readonly: false
}));
} | [
"static EditEntity (data) {\n return Put('/taxable_entity', data)\n }",
"editWorkAndEducation(){\n\t\tresources.workAndEducationTab().click();\n\t}",
"async edit ({ params, request, response, view }) {\n }",
"function setToEdit(data) {\n // $log.debug('setToEdit');\n var mark = EntityService.prepro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the dialog for signing out a user | static showSignOutUserDialog(element) {
//Log
console.log("Showing \"Sign Out User\" dialog...");
//Get ID and name
var id = element.parentElement.parentElement.getAttribute("raw_id");
var name = element.parentElement.parentElement.getAttribute("raw_name");
//Create the alert
var container = document.crea... | [
"handleSignedOutUser() {\n var ui = new firebaseui.auth.AuthUI(firebase.auth());\n // document.getElementById('user-signed-in').style.display = 'none';\n // document.getElementById('user-signed-out').style.display = 'block';\n ui.start('#firebaseui-container', this.getUiConfig());\n }",
"function sho... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
API call and sets state to comic with inputted ID | fetchContent(id) {
fetch('https://xkcd.now.sh/?comic=' + id, {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
})
.then((response) => {
return response.text();
})
.then((data) => {
this.setState({comic: JSON... | [
"handleRunSelection(id) {\n axios.get(`http://localhost:2228/run/${id}`)\n .then(res => {\n this.setState({\n oneRunInfo: res.data[0],\n currentRunID: id,\n currentPlaceID: 0,\n })\n })\n .catch(err =>{\n console.log('ERROR', err)\n })\n }",
"fetch() {\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a boolean preference if it is not already set | function betterdouban_setBooleanPreferenceIfNotSet(preference, value) {
// If the preference is not set
if(!betterdouban_isPreferenceSet(preference)) {
betterdouban_getPreferencesService().setBoolPref(preference, value);
}
} | [
"function betterdouban_setBooleanPreference(preference, value) {\n // If the preference is set\n if(preference) {\n betterdouban_getPreferencesService().setBoolPref(preference, value);\n }\n}",
"function rosterprocessor_setBooleanPreferenceIfNotSet(preference, value)\n{\n // If the preference i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to display the available shows | function _displayAvailableShows() {
try {
state.shows.map((show, index) => {
console.log(`${index + 1}. ${show.name}`);
})
} catch (e) {
console.log('Failed to list shows');
}
} | [
"function displayShows(shows) {\n for (show of shows) {\n const name = show.name;\n const images = show.image;\n let thumbnail = images === null ? null : images.medium;\n createThumbnail(name, thumbnail);\n console.log(`${name} for ${thumbnail}`);\n }\n }",
"function displayShows()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for setting up the incidence slider, required by JQueryUI to attach handlers | function setIncidentsSlider() {
var handleA = $(".incidents-rate-slider.lower-handle");
var handleB = $(".incidents-rate-slider.upper-handle");
$('.incidents-slider').slider({
create: function (e, ui) {
handleA.text(0);
handleB.text(1000);
},
slide: function ... | [
"function setupUI() {\n\t\t\tconsole.log(\"Setting up the UI listeners\");\n\t\t\t// when the slider state changes it sends a message to spacebrew\n\t\t\t$(\".slider\").bind( \"change\", function(event, ui) {\n\t\t\t\tif (values[event.target.id] != event.target.value) {\n\t\t\t\t\tsb.send(event.target.id, \"range\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function resetLoading() used here to reset the loading of the progress bar, when the redux return response. | resetLoading() {
this.setState({
startLoading: false,
completeLoading: false,
});
} | [
"function clearLoading() {\n\t\tvar loading = $i(\"infiniLoading\");\n\t\tloading.className = \"text-center hidden\";\n\t}",
"function reset () {\n setProperty('progress', 0);\n loadNewLabelOntoPanorama();\n }",
"reset() {\n this.progress = 0;\n this.progressWidth = this.progress;\n th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
When the component mounts, create the d3 line chart and then update the popup | componentDidMount() {
this.createLineChart()
this.props.update()
} | [
"createLineChart() {\n const popupWidth = this.profileDiv.clientWidth\n const popupHeight = this.profileDiv.clientHeight\n // Set the dimensions of the canvas / graph\n const margin = { top: 10, right: 20, bottom: 40, left: 50 }\n if (this.props.popupType === \"modal\") {\n margin.left = 70\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write coordinates to file | function updateCoords(){
storage.write('coords.json', coords);
} | [
"function saveXY() {\n var posList = {};\n // select each node - get its shortNm and its position transform\n d3.selectAll(\".node\").each(function(d) {\n // un-project coords\n posList[d.shortNm] = proj.invert([d.x, d.y]); });\n var dummy = document.createElement(\"a\");\n var encodedUri = encodeURI(\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens the file browser | openFileBrowser(){
$(this.refs.image).click();
} | [
"openFileBrowser() {\n // Open the upload file browser\n\t\tthis.refs.inputFile.click();\n }",
"openFileBrowser() {\n this.$refs.files.click();\n }",
"function openFileChooser() {\n fileRef.current.click();\n }",
"exploreFile(fileHash) {\n if (fileHash) {\n const ipfsPath = \"https://i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions that roll a stat and determines the modifier and puts them into a box | function statOne() {
var finalStatOne = statNumber()
var finalMod = modifier(finalStatOne)
firstStat.textContent = finalStatOne;
modOne.textContent = finalMod;
rollButton1.style.display = "none";
counter++
counterCheck()
} | [
"function updateModifiers(){\r\n\r\n\t\t\tdocument.getElementById(\"strModifier\").textContent = addPlus(getModFromStat(parseInt(document.getElementById(\"strTotal\").textContent))); \r\n\t\t\tdocument.getElementById(\"dexModifier\").textContent = addPlus(getModFromStat(parseInt(document.getElementById(\"dexTotal\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this takes the first array of words and calculates the number of unique words by looping through the array and creating a new array of words that dont already exist in the new array. | function uniqueWordsFunc(wordArray2){
var uniqueArray = [];
for (var i = 0; i<wordArray2.length; i=i+1) {
if (uniqueArray.indexOf(wordArray2[i]) == -1) {
uniqueArray.push(wordArray2[i]);
}
}
var numUWords = uniqueArray.length;
uniqueAnswer(numUWords);
} | [
"function countUniqueWords(array) {\n var uniqueWordsCounter = 0;\n for (i=0; i<array.length; i++) {\n if (array[i] !== array[i+1]) {\n uniqueWordsCounter++;\n }\n };\n return uniqueWordsCounter;\n}",
"function uniqueWordsCount(text) {\n // split text into an array\n var words = text.split(/\\s+/... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
There should be some discussion over how far the lookDistance should be. We should determine how many elements the average user is going to be seeing on their screen along with how much time is reasonable to sort. | function walkSort(indexLatSorted, indexLngSorted, unsortedArray, lookDistance) {
var sortedArray = [];
var index, secIndex, choice, startElem;
var holderTypeIndex = [];
var choices_1 = []
var choices_2 = [];
// Too many index's this is impossible to read
index = ... | [
"function distance() {\n // Store the live distance of each number with the mouse position in an array\n for (let i = 0; i < NUMBER_PAGES; i++) {\n let d = Math.hypot(event.clientX - numCenter[i].x, event.clientY - numCenter[i].y);\n mouseHypo.push(d);\n }\n // Calculate the smallest value at every moveme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is to track the Start download of Akamaiurls. We need a seperate method as to track the Type | function trackDownloads(downloadType, fileType, fileName){
try{
if(fileType!=undefined && fileType!=null && fileType!=''){
riaTrackDownloadsLink(fileType+" : "+downloadType, fileName);
}else{
riaTrackDownloadsLink(downloadType, fileName);
}
}catch(e){
//do nothing.
}
} | [
"function onStartedDownload(id) {\n console.log(`Started downloading: ${id}`);\n}",
"updateDownloadStat(type) {\n browser.runtime.sendMessage({\n action: 'updateDownloadedStat',\n args: type,\n });\n }",
"startTracking() {\n HyperTrack.onTrackingStart();\n }",
"function F... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves the plural function used by ICU expressions to determine the plural case to use for a given locale. | function getLocalePluralCase(locale){var data=findLocaleData(locale);return data[18/* PluralCase */];} | [
"function getLocalePluralCase$1(locale) {\n var data = findLocaleData$1(locale);\n return data[18 /* PluralCase */];\n }",
"function getLocalePluralCase(locale) {\n var data = findLocaleData(locale);\n return data[18 /* PluralCase */];\n}",
"function getLocalePluralCase(locale) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Called in response to failure to initialize on Signiant.mst.initialize | function reInitializeFailure() {
console.log("Re-Initialize Signiant App Failed, retrying");
alert("Signiant App Connection Lost, Retrying...");
reInitializeApp();
} | [
"function _onFailedInit() {\n\t\t_settings.onFail();\n\t}",
"function onInitializeFail( ecode )\n {\n console.log( \"CLIENT ERROR: \" + ecode );\n }",
"function validateInitialization() {\n if (!isInitialized) {\n throw new Error ('MobileServiceSyncContext is being use... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function that accepts a name and returns the name as first name and last name. Remove the middle name, if there is one. This function should still work if there is no middle name. If the string has only one name, e.g. "Adele", it should return that name If there are multiple middle names this function should st... | function removeMiddleName(string) {
let arrayString = string.split(" ");
let first = arrayString[0];
let last = arrayString[arrayString.length-1];
let firstLast = first +" " + last;
if (arrayString.length === 1){
return first;
}
else{
return firstLast;
}
} | [
"function middleName(firstName, middleName, lastName) {\n\tif (middleName === null) {\n\t\treturn firstName + ' ' + lastName;\n\t} else {\n\t\treturn firstName + ' ' + middleName + ' ' + lastName;\n\t}\n}",
"function getMidddelName(fullname){\n let middleName = fullname.trim();\n middleName = middleName.spl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets if the provided structure is a NamedNodeStructure. | static isNamed(structure) {
switch (structure.kind) {
case StructureKind_1.StructureKind.Enum:
case StructureKind_1.StructureKind.Interface:
case StructureKind_1.StructureKind.JsxAttribute:
case StructureKind_1.StructureKind.Namespace:
case Struc... | [
"function isNamedNode(obj) {\n return isTerm(obj) && obj.termType === 'NamedNode';\n}",
"static hasName(structure) {\r\n return typeof structure.name === \"string\";\r\n }",
"static isJsxTagNamed(structure) {\r\n return structure.kind === StructureKind_1.StructureKind.JsxSelfClosingElement;\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
scrolls to the previous Pokemon in the list | prevPoke(){
//checks to see variable representing the pokemon's position is at the first pokemon in the array
if(this.current == 0){
//cycles to the last position in the array if it is currently in the first position
this.current = this.pokes.length-1;
}
else{
//otherwise go to the previous array post... | [
"function prevItem()\r\n{\r\n\tif(index > 0)\r\n\t{\r\n\t\tindex -= 1;\r\n\t\t$.scrollTo(itemJumps[index], 600, { offset: jumpOffset-32 });\r\n\t}\r\n\t\r\n\tconsole.log(\"GAH: jumping to PREVIOUS item\");\r\n}",
"prev () {\n this.gotoItem(this.currentItem - this.slidesToScroll)\n }",
"prev() {\n\t\tt... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draw the axes of the graph, as well as the unit markers and grid lines. Finally, label all of the unit markers. | drawAxes() {
this.context.fillStyle = DEFAULT_PLOT_PARAMETERS.color;
if(this.drawYAxis) {
assert(this.range.x.min <= 0 && this.range.y.max >= 0,
'Cannot draw the y axis as it is out of range.')
let labelWidth = this.context.measureText('y').width;
/... | [
"function drawAxisLabelMarkers() {\n context.lineWidth = \"2.0\";\n // draw y axis\n drawAxis(cMarginSpace, cMarginHeight, cMarginSpace, cMargin);\n // draw x axis\n drawAxis(cMarginSpace, cMarginHeight, cMarginSpace + cWidth, cMarginHeight);\n context.lineWidth = \"1.0\";\n drawMarkers();\n}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets or sets the series legend item badge templae. | get legendItemBadgeTemplate() {
return this.i.legendItemBadgeTemplate;
} | [
"get legendItemTemplate() {\r\n return this.i.legendItemTemplate;\r\n }",
"_getLegendItem(target) {\n const item = target.get('parent');\n if (item && (item.name === 'legendGroup')) {\n return item;\n }\n return null;\n }",
"getLegend ()\n {\n return (this._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
LOAD HUD DATA this will copy a huds config.json to ~/.linuxsystemhud/hdef/ reseting it to default | function resetHudDef(hudid){
let src = path.join(appdata.huds, hudid, "config.json")
let dest = path.join( appdata.hdef, hudid + ".json")
// if hud config is not in appdata.huds then check node_modules
if (!fs.existsSync(src)){
src = path.join(__dirname, 'node_modules', hudid, "config.json")
... | [
"function loadHudData() {\n console.log(\"LSH: Begin loading hud definitions \");\n let filelist, hpath\n // Load all the default (built-in) huds\n hpath = path.join(__dirname, 'node_modules')\n config.default_huds.forEach((hudid, i) => {\n if (!fs.existsSync( path.join(appdata.hdef, hudid+\".... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParsernewEntityType. | exitNewEntityType(ctx) {
} | [
"exitElementType(ctx) {\n\t}",
"exitType_definition(ctx) {\n\t}",
"exitNewEntityDefinition(ctx) {\n\t}",
"exitParse(ctx) {\n\t}",
"exitNested_table_type_def(ctx) {\n\t}",
"exitTypeName(ctx) {\n\t}",
"exitType_declaration(ctx) {\n\t}",
"exitRecord_type_def(ctx) {\n\t}",
"exitCompilationUnit(ctx) {\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns all cells surrounding the one at (row, col) | function getAllAdjacentCells(row, col) {
var cells = [];
for (var dir = 0; dir < 6; dir++) {
cells.push(getAdjacentCell(row, col, dir));
}
return cells;
} | [
"adjacentCells(row, col) {\n return [\n [row - 1, col - 1], // top-left\n [row - 1, col], // top\n [row - 1, col + 1], // top-right\n [row, col - 1], // left\n [row, col + 1], // right\n [row + 1, col - 1], // bottom-left\n [row + 1, col], // bottom\n [row + 1, col + 1], /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set policy group id value | function setPolicyGroupValue() {
for (var i = 0; i < RESOURCES_1.length; i++) {
if (RESOURCES_1[i].policyGroupId !== undefined && RESOURCES_1[i].policyGroupId !== '') {
$('#uritemplate_policyGroupId' + i).val(RESOURCES_1[i].policyGroupId);
}
}
} | [
"function assignGroupId(id){\r\n\t\tgroup.id = id;\r\n\t}",
"setGroupId(aGroupId) {\n this.group_id = aGroupId;\n }",
"setGroupId(aGroupId) {\n this.group_id = aGroupId;\n }",
"function setupPolicyGroups(postData, policyGroupId) {\n postData.uritemplate_policyGroupIds = '['+policyGroupId+']';... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update .dotenv file with db config values consumed by the app wide config located at server/config/database.js | _updateDotEnv() {
let template = null;
if (program.helpers.isRelationalDB(this.answers.database)) {
template = this.templatePath('dotenv/sql.stub');
} else if (this.answers.database === 'mongodb') {
template = this.templatePath('dotenv/mongo.stub');
}
let dest = this.desti... | [
"function updateConfig() {\n var savConf = {};\n savConf.env = appConfig.env;\n savConf.database = appConfig.database;\n savConf.http = appConfig.http;\n fs.writeFile(appConfigFile, JSON.stringify(savConf));\n}",
"static configureEnvironment(){\n dotenv.config({ path: './settings.env' }); \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch All Tax Groups | getTaxGroups(){
var that = this;
var reqQuery = {};
reqQuery['userdetails'] = getUserDetails();
const request = new Request(`${process.env.API_HOST}/ManageTaxes.svc/GetTaxGroups/json`, {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/json'
}),
body: JSON.stringify(reqQuery)
})... | [
"async getAllGroups() {\n log('get all groups ....');\n return this.api.get('/api/1.0/tags', {\n params: {\n company: this.companyId,\n token: this.token,\n limit: LIMIT,\n },\n }).then((response) => response.data.data).catch((error) => {\n log(error.response.data.messag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attaches the error to the voice connection | _attachErrorEvent() {
this._oConnection.onEvent("error", function(err) {
logger.error("VoiceConnection error: ", err);
this.play(); //Try to play the next song on error
}.bind(this));
this._oConnection.onEvent("failed", function(err) {
logger.error("VoiceConnection failed: ", err);
this.play(); //Try... | [
"audioOnError() {\n clearTimeout(this.loadTimeoutFn);\n this.triggerEvent('error');\n this.next({'type': 'ended'});\n }",
"onSpeechError(event) {\n this.dispatchEvent(event);\n }",
"function onPlayerError(errorCode) {}",
"function AudioError() {\n this.code = null,\n this.message = \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take a turn: 0) Wait for users to confirm the next game 1) Identify the user with the current turn 2) Draw the card 3) Find the rule for the card 4) Act on the rule 5) End the turn | function takeTurn () {} | [
"function nextTurn() {\r\n\t//switches turn\r\n\tturn = !turn;\r\n\r\n\t//it will reset the hand\r\n\thand.resetHand();\r\n\r\n\t//it will call the checkCheck function with the new turn and input that to the method kingInCheck\r\n\thand.kingInCheck(checkCheck(turn)); //checks if the king is in check or not\r\n\r\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |