query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
console.log("converted data : "); console.log(myChoice);
function convertToChoice(d){ var root = makeChoice(d[0]); return root; }
[ "function choose() {\n if (questions[questionCounter].type === 'input') {\n selections[questionCounter] = +document.getElementById(\"text\").value;\n } else {\n selections[questionCounter] = +$(\"input[name='answer']:checked\").val();\n }\n console.log(selections[questionCounter]);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Call the API with automatic pagination. You can also list assets in a project/ folder. To do so, modify the parent value and filter condition.
async function listFilteredAssets() { const [response] = await client.listAssets({ parent: orgName, filter: 'security_center_properties.resource_type="google.cloud.resourcemanager.Project"', }); let count = 0; Array.from(response).forEach(result => console.log( `${++cou...
[ "function FnGetAssetsList(){\n\t\tvar VarUrl = GblAppContextPath+'/ajax' + VarListAssetsUrl;\n\t\tvar VarMainParam = {\n\t\t\t\"domain\": {\n\t\t\t\t\"domainName\": VarCurrentTenantInfo.tenantDomain\n\t\t\t},\t\"entityTemplate\": {\n\t\t\t\t\"entityTemplateName\": \"Asset\"\n\t\t\t}\n\t\t};\n\t\t//FnMakeAsyncAjaxRe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the region currently selected in the dropdown menu.
function get_selected_region() { const dropdown = document.getElementById("region") return dropdown.options[dropdown.selectedIndex].value }
[ "getRegion(){\n // get all input fields in the dropdown\n const allRegions = document.getElementById('regionInput');\n //extract value of the selected region\n const selectedRegion = allRegions.options[allRegions.selectedIndex].value;\n return selectedRegion;\n }", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Attempts to translate a TypeScript diagnostic produced during template typechecking to their location of origin, based on the comments that are emitted in the TCB code. If the diagnostic could not be translated, `null` is returned to indicate that the diagnostic should not be reported at all. This prevents diagnostics ...
function translateDiagnostic(diagnostic, resolver) { if (diagnostic.file === undefined || diagnostic.start === undefined) { return null; } // Locate the node that the diagnostic is reported on and determine its location in the source. var node = typescript_1.getTokenAtPositio...
[ "function translateDiagnostic(diagnostic, resolver) {\n if (diagnostic.file === undefined || diagnostic.start === undefined) {\n return null;\n }\n // Locate the node that the diagnostic is reported on and determine its location in the source.\n const node = getTokenAtPosition...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function relates values of an option set to the values of another option set. To define a dependency the first argument should be the independent fields schema name. The second argument should be the dependent fields schema name. Other arguments are the relations ships. For example suppose you want to for the valu...
function DependentFieldsOnLoad() { var optionsetControl = Xrm.Page.ui.controls.get(arguments[1]); var options = optionsetControl.getAttribute().getOptions(); var independent = Xrm.Page.getAttribute(arguments[0]).getValue(); if(independent==null) { optionsetControl.clearOptions(); } else { ...
[ "function DependentFieldsOnChange() {\r\n var optionsetControl = Xrm.Page.ui.controls.get(arguments[1]);\r\n var options = optionsetControl.getAttribute().getOptions();\r\n var independent = Xrm.Page.getAttribute(arguments[0]).getValue();\r\n\tif(independent==null) {\r\n\t\toptionsetControl.clearOptions();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts `value` to E.164 phone number format
function e164(value, country_code, metadata) { // If the phone number is being input in a country-specific format // If the value has a leading + sign // The value stays as it is // Else // The value is converted to international plaintext // Else, the phone number is being input in an international f...
[ "function convertToE164phoneNumber(phoneNumber) {\n let res = phoneNumber.match(/[0-9]{0,14}/g);\n if (res === null) {\n return '';\n }\n res = res.join('');\n if (res[0].includes('1')) {\n res = '+' + res;\n }\n else {\n res = '+1' + res;\n }\n res = res.substring(0,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Thumbnail image source, inspecting both src and longdesc attribute.
function _getThumbnailData(image) { var src = image.attr('src'), longdesc = image.attr('longdesc'), thumb = image.attr('data-thumb'); return { src: thumb ? thumb : ( src && src != 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==' ? src : ( /\.(gif|jpe?g|png)$/...
[ "function imageFromThumb (thumbnail) {\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n}", "get thumbnailUrl() {\n return this._data.thumbnail_url;\n }", "function imageFromThumb(thumbnail){\n\t'use strict';\n\treturn thumbnail.getAttribute('data-image-url');\n\t/* from console:\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
All the collision detection for the this.tetrominos.
boxDetection() { // For loop, loops through all spaces on the game board for (let i = this.gameMap.length - 1; i >= 0; i--) { // For loop, loops through all this.tetrominos for collision detection on a piece of the game board for (let z = this.tetrominos.length - 1; z >= 0; z...
[ "isCollision(tetromino) {\n for (let x = 0; x < tetromino.type.size; x++) {\n for (let y = 0; y < tetromino.type.size; y++) { \n if (tetromino.x + x < 0 || tetromino.x + x >= Constants.WIDTH || y >= Constants.HEIGHT || tetromino.y >= 0 && this._data[tetromino.x + x][tetromino.y + y] !== 0) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Enhance the Koa dev server and serve api metadata directly from memory
beforeDevServer (app) { app.use((req, res, next) => { if (!req.accepts('json')) { res.status(406) return } const metadataRoutePattern = /\/([\w.]+)\/([\w.]+).json$/ const match = req.path.match(metadataRoutePattern) if (!match) { return next()...
[ "serve(req, res) {\n const filename = req.url.replace(this._path, \"\");\n const isMap = dotMapRegex.test(filename);\n const type = isMap ? \"map\" : \"source\";\n // Per the standard, ETags must be quoted:\n // https://tools.ietf.org/html/rfc7232#section-2.3\n const expect...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
now in DB: uID, room, action:I/M/B/S/L/T, pID, systime, content I: Initial, M: Message, B: Block, S: Share, L: Like, T: Translate
function dbLogInsert(user, room, action, pID, sysTime, content) { if (dbSetting) { db.query("INSERT INTO syslog VALUES ($1, $2, $3, $4, $5, $6)", [user, room, action, pID, sysTime, content], function(err, result) { if(err) return console.error('error running query', err); // console.log(result); } ...
[ "function intuitRoom(msg, room) {\n var sideMetas = room.get(\"gmnotes\").match(/\\*\\S\\*([^\\*]+)/g);\n \n var body = \n '<div style=\"padding-left:10px;margin-bottom:3px;\">'\n +commandLinks('Room',[['remove','roomRemove']])\n +commandLinks('Left Side...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checking for quad with deck triss
function checkDeckQuad(){ for (var i = 4; i < cards.length; i++) {//Matching with first card player 1 if (cardValue[0] == cardValue[i]) { if (cardValue[i] == cardValue[i+1]) { if (cardValue[i+1] == cardValue[i+2]) { deckQuad01 = true; console.log(deckQuad01 + " deck quad player 1 card 1"...
[ "function checkPocketQuad(){\r\n\tvar quadCard01;\r\n\tvar quadCard02;\r\n\tvar deckQuadCard01;\r\n\tvar deckQuadCard02;\r\n\tif (pocketPair01 == true) {\r\n\t\tquadCard01 = cardValue[0];\r\n\t\tfor (var i = 4; i < cards.length; i++) {\r\n\t\t\tif(cardValue[i] == cardValue[i+1]){\r\n\t\t\t\tdeckQuadCard01 = cardVal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper class that combines one ViewSection's data for building dom.
function ViewSectionData(section) { this.section = section; // A koArray reflecting the columns (RowModels) that are not present in the current view. this.hiddenFields = this.autoDispose(koArray.syncedKoArray(section.hiddenColumns)); }
[ "function partial_section_builder (sectionKey, sectionObj){\r\n\r\n\tthis.sectionHTMLTag = new Object(); // use this to avoid other conflicts\r\n\t// var HTML_Section = \"HTML\" + sectionKey;\r\n\t// Locate the appropriate HTML tag to insert the CV data to\r\n\tfor (var nextVar in sectionObj) {\r\n\t\t// console.lo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function modifies the supplied directed graph to make it acyclic by reversing edges that participate in cycles. This algorithm currently uses a basic DFS traversal. This algorithm does not preserve attributes.
function makeAcyclic(g) { var onStack = {}; var visited = {}; function dfs(u) { if (u in visited) { return; } visited[u] = true; onStack[u] = true; dig_util_forEach(g.successors(u), function(v) { if (v in onStack) { if (!g.hasEdge(v, u)) { ...
[ "function acyclic(g) {\n var onStack = {},\n visited = {},\n reverseCount = 0;\n \n function dfs(u) {\n if (u in visited) return;\n visited[u] = onStack[u] = true;\n g.outEdges(u).forEach(function(e) {\n var t = g.target(e),\n value;\n\n if (u === t) {\n console.error...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handle search field change event load search input according to selected field type
function searchFieldChange(event) { // TODO add an error message when you try to submit the form before this returns, as we are disabling the form elements so it may cause unexpected side effects var field = Event.findElement(event); var inputValue = ""; var advancedSearchModule = field.up('.advancedSearc...
[ "function selectSearch(event, field) {\n}", "function changeSearchInput() {\n\tvar reportType = reportFormArray[3].value;\n\treportFormArray[2].disabled = false;\n\treportFormArray[2].value = \"\";\n\n\tswitch (reportType) {\n\tcase \"none\":\n\t\treportFormArray[2].placeholder = \"Search value\";\n\t\tbreak;\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
inits the universalFieldNodeBinder. Set the mapped attributes and labels.
_initBinder() { this.binder = new UniversalFieldNodeBinder(this); // set the attribute mappings this.binder.attributeMappings = { label: 'label', hint: 'hint', min_term_length: 'min-term-length', no_result_hint: 'no-result-hint', errortext: 'errortext', 'error-msg': 'err...
[ "_initBinder() {\n this.binder = new UniversalFieldNodeBinder(this);\n\n // set the attribute mappings\n this.binder.attributeMappings = {\n label: 'label',\n hint: 'hint',\n placeholder: 'placehoder',\n min_term_length: 'min-term-length',\n no_result_hint: 'no-result-hint',\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trigger the download of a set
function downloadSet(setId, userName) { // this object will contain all data needed to sign calls var oAuthData = { // these are the API keys of FlickrGetSet for flickr consumerKey: "fb83db48de20585d51c21052562dc3ae", consumerSecret: "4cafb2345ff39878", // specific info setId: setId, user...
[ "function DownloadMultipleOccurrences() {\n console.log( \" ==== DownloadMultipleOccurrences ====\");\n const url_str = urls.url_student_multiple_occurrences;\n const upload_dict = {studsubj_multiple_occurrences: {get: true}};\n // TODO enable this\n UploadChanges(upload_dict, url...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check for font awesome
checkForFontAwesome() { // check for FA link if ($(`link[href="${this.fa}"]`).length == 0) { var AppendNewStyle = document.createElement('link'); AppendNewStyle.setAttribute('href', this.fa); AppendNewStyle.setAttribute('rel', 'stylesheet'); Ap...
[ "function isLoadedFontAwesome() {\n /**\n * Gets the value of a css property from the browser computed style.\n * @param {Element} element The element with the style to check.\n * @param {string} property the name of the desired css property.\n * @returns {object} The found value of the property ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether a command is a getter and doesn't permit chaining.
function isNotChained(command, otherArgs) { if (command == 'option' && (otherArgs.length == 0 || (otherArgs.length == 1 && typeof otherArgs[0] == 'string'))) { return true; } return $.inArray(command, getters) > -1; }
[ "function isGetter(obj, prop) {\r\n // Object.getOwnPropertyDescriptor cannot find getter/setter of object instance.\r\n // So we must seek in the instance's prototype.\r\n const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), prop);\r\n return Boolean(descriptor) && (typeof des...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
artistName: nombre de artista(string) retorna: los tracks interpredatos por el artista con nombre artistName
getTracksMatchingArtist(artistName) { const artist= this.getArtistByName(artistName); return artist.getTracks(); }
[ "getTracksMatchingArtist(artistName) {\n this._validarExistenciaArtista(artistName, \"name\",\"getTracksMatchingArtist\");\n\n const artist = this._artistas.find(\n (artista) => artistName === artista.name\n );\n\n return artist.albums.flatMap((album) => album.tracks);\n }", "getTracksMatchingAr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
display results of Nutritionix Natural Nutrients API Call
function displayNutrientResults (responseJson) { console.log(responseJson); // if there are previous results, remove them $('#results-list').empty(); // iterate through the foods array for (let i = 0; i < responseJson.foods.length; i++){ $('#results-list').append( //full name, descript...
[ "function getNutrition(productId) {\n\tvar queryURL = \"https://api.nal.usda.gov/ndb/nutrients/?max=1&nutrients=208&nutrients=269&nutrients=204&nutrients=205&nutrients=203&ndbno=\" + productId + \"&api_key=\" + foodApiKey;\n\tconsole.log(queryURL);\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: \"GET\"\n\t}).then(fun...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hide all the chat messages
function hideAllMessage() { [].forEach.call(messages, function(message) { if (!message.classList.contains('msgInvisible')) { message.classList.add('msgInvisible'); } }) }
[ "function hideInterface(){ $(\"#chat\").css(\"display\", \"none\");}", "function HideChatBox()\n{\t\n\tif(false == g_bChatBoxHidden)\n\t{\n\t\t//\n\t\t// Chatbox is visible. Hide it\n\t\t//\n\t\t\t//HideChatBoxId.value = L_SHOWCHAT;\n\t\tsendChatButton.style.visibility=\"hidden\";\n\t\tchatText.style.visibility=\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculates the Normal matrix
calculateNormal() { mat4.copy(this.normalMatrix, this.modelViewMatrix); mat4.invert(this.normalMatrix, this.normalMatrix); mat4.transpose(this.normalMatrix, this.normalMatrix); }
[ "get normalMatrix() { return this._normalMatrix; }", "calculateNormalVector() {\n let v1 = PointOperations.subtract(this.points[2], this.points[0]);\n let v2 = PointOperations.subtract(this.points[1], this.points[0]);\n this.normalVector = VectorOperations.vectorialProduct(v1,v2).getNormalize...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public function `function`. Returns true if `data` is a function, false otherwise.
function isFunction (data) { return typeof data === 'function'; }
[ "function isFunction(data) {\n return typeof data === \"function\";\n }", "function isFunction(data) {\n return typeof data === 'function';\n }", "is_function(value) {\n return typeof(value) === 'function';\n }", "function isFunction(arg) {\n return typeof arg === \"function\";\n}", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fills an array with JSON objects representing the content of the files and merges all the objects in the array
async function handleFiles() { try { let fileList = this.files; let fileArray = []; let result = {}; for await (const file of fileList) { const fileContents = await readUploadedFileAsText(file) jsonContent = JSON.parse(fileContents); fileArray.push(jsonContent); ...
[ "async function readMerge( files){\n\tvar \n\t arrayitized= (typeof( files)=== \"string\"? [ files]: files)|| [],\n\t jsons= arrayitized.map( async c=> JSON.parse( await fs.readFile(c, \"utf8\"))),\n\t all= await Promise.all( jsons),\n\t merged= all.length=== 0? {}: Object.assign.apply(Object, all)\n\treturn me...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets page restrictions (direct and inherited), plus group/user details from the server. Also gets a flag if the user has permission to change restrictions or not.
function getPermissionsFromServer (callback, editingPage) { // If editingPage, Space and Parent Page may have changed due to the Location editor on the edit screen. var spaceKey = (editingPage && $("#newSpaceKey").val()) || AJS.params.spaceKey; var parentPageTitle = (editingPage && $("#parentPag...
[ "function getPermissionsFromServer (callback, editingPage) {\n // If editingPage, Space and Parent Page may have changed due to the Location editor on the edit screen.\n var spaceKey = (editingPage && $(\"#newSpaceKey\").val()) || AJS.params.spaceKeyDecoded;\n var parentPageTitle = (editingPage...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
helper function returns a representation of input data a la knockout's observables. The function keeps track of reads and writes to it, and provides some helper functions to merge data. It is used as follows: var ds = DiffableStateFactory(null, "root", inputData); ds('property'); // read a property ds('property', 'valu...
function DiffableStateFactory(data, _prop, _root) { var prop, root; if (arguments.length === 1) { prop = 'root'; root = DiffableStateFactory({}, null, null); } else { prop = _prop; root = _root; } var log = { 'diff': undefined, 'patch': undefined }; ...
[ "function DiffableStateFactory(data, _prop, _root) {\n var prop, root;\n if (arguments.length === 1) {\n prop = 'root';\n root = DiffableStateFactory({}, null, null);\n }\n else {\n prop = _prop;\n root = _root;\n }\n\n var diff = (data instanceof Array ? [] : {});\n var pat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
for conciseness in defining templates =========================================================================================================================== initDiagram
function initDiagram() { myDiagram = _G(go.Diagram, "myDiagramDiv", // create a Diagram for the DIV HTML element { // position the graph in the middle of the diagram initialContentAlignment: go.Spot.Center, // allow double-click in background to create a new node // "clickCr...
[ "function BpmnDiagrams(){//Code conversion for Bpmn Shapes\n//Start Region\n/** @private */this.annotationObjects={};//constructs the BpmnDiagrams module\n}", "function PdfDocumentTemplate() {\n //\n }", "function initDiagram() {\n //set deault values to render diagram\n setDe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Switch to a node editor tool
function updateNodeEditorTool(btn) { // Don't do anything if the tool is already selected if($(btn).data("node-tool") === current_node_tool) { return false; } // Remove the active button $("#nodeEditorMenu .btn").removeClass("active"); // Make the clicked button active $(btn).a...
[ "switchEditorMode(mode) {\n this.target.mode = mode;\n this.init();\n }", "function nodeEditor(data) {\n\n\n\t\tvar editor = qs('#editor');\n\t\tselected = data;\n\t\tif (data === null) {\n\t\t\tblankEditor();\n\t\t\treturn;\n\t\t}\n\n\t\tvar source = $('#statedescr-template').html();\n\t\tvar template = H...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the targetContainer (not the source container) for a tile based on the element that was involved in the event and the name of the tile. If there was no element involved in the event, just pass null and this function will figure it out itself (still needs a tileName though).
function getTargetContainerForElement(element, tileName) { // this one probably needs some explanation... ;) // in order to determine the container in which the tile will be shown // we first determine the source container (where the click or action // that triggered the showing of the ...
[ "function getClickedTile(e){\n var clickedElem = e.target;\n if(!(clickedElem.className === \"tile\" || clickedElem.className === \"empty\")){\n return null;\n }\n if (clickedElem.className === \"empty\"){\n return null;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the index of the last element in the array where predicate is true, and 1 otherwise.
function findLastIndex(array, predicate) { var l = array.length; while (l--) { if (predicate(array[l], l, array)) { return l; } } return -1; }
[ "function findLastIndex(array, predicate) {\n let k = array.length;\n\n while (k--) {\n if (predicate(array[k], k, array)) {\n return k;\n }\n }\n\n return -1;\n}", "function arrayFindLastIndex(array, predicate, thisArg) {\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate.call(thi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
HELPER FUNCTIONS / boardHasEmptySpaces Checks if the board has empty spaces left Returns: [Boolean] True if there are still empty spaces in the board
function boardHasEmptySpaces() { let $emptySpaces = emptyBoardSpaceElements(); return $emptySpaces.length > 0; }
[ "function hasEMPTYSpaces(board){\n return countPieces(board)[EMPTY] > 0;\n}", "hasEmptySpace() { \n return !!this.board.filter(row => row.filter(cell => cell === EMPTY_CELL).length).length\n }", "function checkForFull() {\n\n // For each column\n for (var columns = 0; columns < 7; columns++) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Page functions Call server for for "games current"
function get_games_current() { var dataObj = { "content" : [ { "session_id" : get_cookie() } ] }; call_server('games_current', dataObj); }
[ "function displayGames(req, res) {\n\n var id = req.session.current_id;\n\n models.getGamesFromDb(id, function(error, result) {\n if (error || result == null) {\n res.status(500).json({success: false, data: error});\n }\n else {\n res.status(200).json(result);\n }\n });\n}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transforms features returned from the API into one with some augmented attributes.
function transformFeatures(features) { return features.map(function (featuresList) { return _.map(featuresList, function (feature) { return transformFeature(feature); }); }); }
[ "processFeatures(features) {\n /**\n * Cast Array into Features Tensor\n *\n * Initially, features is passed in as a JS array and just has a single\n * feature (horsepower) and looks something like this with an [n, 1] shape.\n *\n * [\n * [88],\n * [152],\n * [245],\n *...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Move car East through intersection
function car1MoveIntersectionEast() { let car1Left = getComputedStyle(car1).left.replace('px', ''); let car1Top = getComputedStyle(car1).top.replace('px', ''); car1.style.left = `${parseInt(car1.style.left.replace("px", "")) + 10}px`; if(car1Left >= 780) { stopCars(); rotateCar(0) setTimeout(startCar1South, ...
[ "function moveCar1East() {\n\t// carRunning();\n\tlet car1Left = getComputedStyle(car1).left.replace('px', '');\n\tlet car1Top = getComputedStyle(car1).top.replace('px', '');\n\n\n\tif(car1Left >= 640) {\n\t\tcarSkid();\n\t\tstopCars();\n\tsetTimeout(startCar1IntersectionEast, intersectionWait);\n\t}\n\t\n\n\tconso...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize tooltips for all transformed token spans. This covers any span with class name that starts with 'pl'.
function initTooltips() { $('span[class^="pl-"]').each(function () { $(this).mouseenter(function () { showTooltip($(this)); }); $(this).mouseleave(function () { hideTooltip($(this)); }); }); }
[ "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function InitTooltips()\n{\n var show_tooltips = GetCookie('tooltips');\n if ((null != show_tooltips) && (0 == show_tooltips))\n {\n return;\n }\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate dynamic link to delete with parameter (now for add and delete Users etc...)
function LinkAdaptatorToDelete(id) { var a = document.getElementById(id); if (confirm('Do you want to delete the following user : '+ a.id )) { a = "DeleteUser?idDelete="+a.id; window.location.replace(a); } }
[ "urlForDeleting() {\n return `/settings/${Spark.pluralTeamString}/${this.team.id}/members/${this.deletingTeamMember.id}`;\n }", "function deleteItem(name, id){\n\tlocation.href = 'http://localhost:8080/' + name + '/' + id + '/remove';\n}", "function deleteButton(id) {\n var html = '<form ac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An Iterable for the edge IDs in this graph.
* iterEdgeIds() { yield* this.edges.keys(); }
[ "function getEdges() {\n var allEdges = edges.get();\n var edgeList = [];\n for(var i = 0; i < allEdges.length; i++) {\n edgeList.push(allEdges[i].id);\n }\n return edgeList;\n}", "getEdges() {\n const edgeArr = [];\n this.getVertices().forEach(v => {\n const incidentEdges = this....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
waLoginTabHandler() Manages page name and mbox calls for Login tab of login page
function waLoginTabHandler(){ wa.pageState="login"; if (curl.indexOf("messageid") >-1) {wa.isMsgId="true";} //capture msg id try { mboxDefine('offermatica-div','mint_loginform_metrics'); mboxUpdate('mint_loginform_metrics'); wa.createMbox=true;//if true, call mboxDefine on first click of 'signup' tab } catch...
[ "function open_aboutlogins_in_tab() {\r\n\t\ttry {\r\n\t\t LoginHelper.openPasswordManager(window, { filterString: gBrowser.currentURI.host, entryPoint: 'mainmenu' });\r\n\t\t} catch (e) {\r\n\t\t LoginHelper.openPasswordManager(window, { entryPoint: 'mainmenu' });\r\n\t\t}\r\n\t }", "get loginTab() {return br...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when a query parameter for this route changes, regardless of whether the route is currently part of the active route hierarchy. This will update the query parameter's value in the cache so if this route becomes active, the cache value has been updated.
_qpChanged(prop, value, qp) { if (!qp) { return; } // Update model-dep cache let cache = this._bucketCache; let cacheKey = calculateCacheKey(qp.route.fullRouteName, qp.parts, qp.values); cache.stash(cacheKey, prop, value); }
[ "_qpChanged(prop, value, qp) {\n if (!qp) {\n return;\n } // Update model-dep cache\n\n\n let cache = this._bucketCache;\n let cacheKey = (0, _utils.calculateCacheKey)(qp.route.fullRouteName, qp.parts, qp.values);\n cache.stash(cacheKey, prop, value);\n }", "_qpChanged(prop, val...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Once returns a function that is called only one time, next calls returns the result without executing the fn again.
function once(fn){ var firstExecution = true; var result; return function(){ if(firstExecution){ result = fn(); firstExecution = false; return result; } else { return result; } } }
[ "function callOnce(fn) {\n let last;\n return () => {\n if (last) {\n return last.value;\n }\n last = {\n value: fn(),\n };\n return last.value;\n };\n}", "function once(fn) { var called = false; return function () { if (!called) { called = true; f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Make canvas.toDataURL a method of the context, too
function toDataURL() { return this._.canvas.toDataURL.apply(this._.canvas, arguments); }
[ "toDataURL() {\n return this.canvas.toDataURL()\n }", "GetDataURL() {\n return this.canvas.toDataURL();\n }", "function canvasDataUrl(id,mime){\n var canvas = document.getElementById(id);\n if(canvas){\n return canvas.toDataURL(mime);\n }\n else{\n return '';\n }\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries: getTags function to get list of tags for a particular category
async function getTags() { category = agent.parameters.category.toLowerCase(); let request = { method: 'GET', redirect: 'follow' } if (token === "" || typeof token === 'undefined') { addAgentMessage("Sorry I cannot perform that. Please login first!") return; } ...
[ "function getTagsForCategory(categoryId) {\n var url = common.restConfig.tags_base;\n\n return common.$http\n .get(url, { params: { categoryId: categoryId } })\n .then(getTagsComplete)\n .catch(getTagsError);\n\n function getTagsComplete(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set message to matcher callback invocation or autogenerated message
function setMessage() { if (typeof matcher.message == 'function') self.message = matcher.message(expected, actual, negate) else self.message = generateMessage() }
[ "message(..._) {\n this.messenger.message.apply(this.messenger, arguments);\n }", "function emit_mock_msg() {\n setTimeout(function () {\n var user = spa.model.people.get_user();\n if (callback_map.updatechat) {\n callback_map.updatechat([{\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Perform the provided action on every selection (single or multiple). If the action returns an object, check if it indicates done, in which case return its result.
function _everySelection(editor, fn) { var i, selections = editor.getSelections(); for (i = 0; i < selections.length; i++) { var state = fn(selections[i]); if (state && state.done) { return state.result; } } }
[ "bulk( action ) {\n if( action == 'delete_selected' ) {\n this.bulkDeleteSelected();\n }\n }", "function mutipleSelectedDefaultHandler( node ){\n\t\t\t\t\tif(!node.isSelected){\n\t\t\t\t\t\tselectedEvent(node);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tunselectedEvent(node);\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Object representing a script break point. The script is referenced by its script name or script id and the break point is represented as line and column.
function ScriptBreakPoint(type, script_id_or_name, opt_line, opt_column, opt_groupId) { this.type_ = type; if (type == Debug.ScriptBreakPointType.ScriptId) { this.script_id_ = script_id_or_name; } else if (type == Debug.ScriptBreakPointType.ScriptName) { this.script_name_ = scrip...
[ "function BreakPoint(source_position, opt_script_break_point) {\n this.source_position_ = source_position;\n if (opt_script_break_point) {\n this.script_break_point_ = opt_script_break_point;\n } else {\n this.number_ = next_break_point_number++;\n }\n this.hit_count_ = 0;\n this.active_ = true;\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the magnitude of the specified x,y values
function magnitude(x, y){ return Math.sqrt(x*x + y*y); }
[ "magnitude() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "magnitude()\n {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "function magnitude(v1){\n return Math.sqrt(Math.pow(v1.x, 2) + Math.pow(v1.y, 2));\n}", "getMagnitude() {\n // use pythagora...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get an idea that hasnt been announced by hackbot yet
function getUnNotifiedIdea() { return new Promise((res, rej) => { getIdeas().then((ideas) => { //will return when it finds an un-anounced idea shuffle(ideas).forEach((idea) => { if (!idea.suggested) res(idea); }); //if after all of them it hasn...
[ "function getIdea(id) {\n return ideas[id];\n}", "function whatIDontLike(bugsIDontLike) {\nconsole.log( \"I dont like \"+ bugsIDontLike);\n}", "function getRefused(){\n\tpageNow = 1\n\tstate = 5;\n\ttag = 0\n\tgetMyDesign(1)\n}", "function genNotAbot(msg,type){\n if (type == CommentType.talkingToMe)//person...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EXERCISE 3 (BONUS) define a function that takes in (i) an email domain (e.g. 'yahoo.com' or 'gmail.com') and (ii) any number of email strings It should return an array of emails that match the domain hint: you need to use the ...rest operator in the function's parameters
function filterEmailsByDomain() { }
[ "function emailParts(email) {\n return email.toLowerCase().split(\"@\");\n}", "function commonEmails(theDomain) {\n emailEnder = \"@\" + theDomain;\n\n emailOutput.push(firstName + emailEnder); // First Name\n checkNN(nickName + emailEnder); // Nick Name\n emailOutput.push(lastName + emailEnder); // {ln}\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_ESAbstract.SpeciesConstructor / global Get, Type, IsConstructor 7.3.20 SpeciesConstructor(O, defaultConstructor)
function SpeciesConstructor(O, defaultConstructor) { // eslint-disable-line no-unused-vars // 7.3.20.1 Assert: Type(O) is Object. // 7.3.20.2 Let C be ? Get(O, "constructor"). var C = Get(O, "constructor"); // 7.3.20.3 If C is undefined, return defaultConstructor. if (C === undefined) { return defaultConst...
[ "function SpeciesConstructor (O, defaultConstructor) { // eslint-disable-line no-unused-vars\n\t// 7.3.20.1 Assert: Type(O) is Object.\n\t// 7.3.20.2 Let C be ? Get(O, \"constructor\").\n\tvar C = Get(O, \"constructor\");\n\t// 7.3.20.3 If C is undefined, return defaultConstructor.\n\tif (C === undefined) {\n\t\tre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The base class for all VR frame data.
function VRFrameData() { this.leftProjectionMatrix = new Float32Array(16); this.leftViewMatrix = new Float32Array(16); this.rightProjectionMatrix = new Float32Array(16); this.rightViewMatrix = new Float32Array(16); this.pose = null; }
[ "function VRFrameData() {\n this.leftProjectionMatrix = new Float32Array(16);\n this.leftViewMatrix = new Float32Array(16);\n this.rightProjectionMatrix = new Float32Array(16);\n this.rightViewMatrix = new Float32Array(16);\n this.pose = null;\n }", "function VRFrameData() {\n this.leftProjection...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a DOM element from the given SVG string.
_svgElementFromString(str) { const div = this._document.createElement('DIV'); div.innerHTML = str; const svg = div.querySelector('svg'); // TODO: add an ngDevMode check if (!svg) { throw Error('<svg> tag not found'); } return svg; }
[ "_svgElementFromString(str) {\n const div = this._document.createElement('DIV');\n div.innerHTML = str;\n const svg = div.querySelector('svg');\n if (!svg) {\n throw Error('<svg> tag not found');\n }\n return svg;\n }", "function svg(tagString, ...args) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verifies patrol confirmation request
async function verifyPatrolConfirmationRequest (req, res, next) { if(req.body['user_lon'] != undefined && req.body['user_lat'] != undefined && req.body['patrol_id'] != undefined && req.body['confirmation'] != undefined){ let user = await verifyAndGetUser(req.token); if(user) { var patrol...
[ "reConfirm() {\n // When we're confirmed start the retransmitting whatever\n // the 2xx final response that may have confirmed us.\n if (this.reinviteUserAgentServer) {\n this.startReInvite2xxRetransmissionTimer();\n }\n }", "function confirmWithReply(req, res){\n //get ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function creates then loops through each announcer from the database
async function processAnnouncers() { let announcers = await createAnnouncerObjects(); announcers.forEach(announcer => { announceAllDiscordChannels(announcer); }); }
[ "async function createAnnouncerObjects() {\n\n let twitchChannels = await getTwitchChannels();\n let announcers = twitchChannels.map(async twitchChannel => {\n return await createAnnouncerObject(twitchChannel);\n });\n\n return Promise.all(announcers);\n\n}", "function alist() {\n url = server + '?actio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Emits the lobby information to a specific client
function informSingleClient(id) { for(var i in SOCKET_LIST) { if(SOCKET_LIST[i].username === id) { var pack = { Room1: getRoomInformation("Room1") } SOCKET_LIST[i].socket.emit('lobbyInfo', pack); break; } } }
[ "function informLobby() {\n for(var i in SOCKET_LIST) {\n if(SOCKET_LIST[i].username !== undefined && (SOCKET_LIST[i].roomname !== undefined && SOCKET_LIST[i].roomname !== \"\")) {\n var pack = {\n Room1: getRoomInformation(\"Room1\")\n }\n SOCKET_LIST[i].socket.emit('lobbyInfo', pack);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Open hide fact adr
function openHideInfoCli(op) { var cliSansCpt = document.getElementById("cliSansCpt"); var clicpt = document.getElementById("clicpt"); if(op=='0') { cliSansCpt.style.display="none"; clicpt.style.display=""; }else if(op=='1') { cliSansCpt.style.display=""; clicpt.style.display="none"; } }
[ "function showdef() {\n document.querySelector(\".definition\").style.display = \"block\";\n document.querySelector(\".define\").style.display = \"none\";\n}", "function showhidedlfn() {\n var x = document.getElementById(\"showhidedl\");\n if (x.style.display === \"none\") {\n x.style.display = \"b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given an outstanding request dictionary, key, request type, value, and current step, draw the completed request as updated/stale/old.
function draw_request(r, k, t, v, s) { var color = 'black'; var rsp = 'ACK'; // if get request, decide update state if (r[req] == 'get') { if (!(v == store[k][cur][val])) { // not the most recent if (v == store[k][prv][val]) { // but the second most // TODO: check p_x/y here as well? No timestamp i...
[ "function end_req(k, c, t, v, s) {\n\tif (k in store) {\n\t\tif (c in store[k][req]) {\n\t\t\t//draw request in appropriate color\n\t\t\tdraw_request(store[k][req][c], k, t, v, s);\n\n\t\t\t//remove outstanding request from store\n\t\t\tdelete store[k][req][c];\n\t\t}\n\t\telse {\n\t\t\tconsole.log('end_request cal...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For Updating cart item
function update_cart_item(cart_id){ showHint('bill-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'bill_item'); }
[ "function update_cart_item(cart_id){\r\n showHint('quote-item.jsp?cart_id='+cart_id+'&update_cartitem=yes',cart_id,'quote_item');\r\n}", "async updateCart_Of_User(){\n }", "function updateCart(){\n\t\tstorage(['items', 'subtotal'], function(err, col){\n\t\t\t//console.log(\"Cart Collection - \" + JSON.string...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function that computes the values of vertices, indices, normals and colors
function computeValuesForGraph() { h = 1.0 / k; var indv, indt, i, j, h, z; var x, y, i; /****Initialize arrays with zero ******/ for (i = 0; i < nv; i++) { vertices.push(0); normals.push(0); colors.push(1); } for (i = 0; i < nt; i++) { indices.push(0); ...
[ "get vertexColors() {\n return this.m_geometry.vertexColors;\n }", "function cube () {\n const vertices = new Float32Array([\n 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, // front\n 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, // right\n 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, // up\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove_zero time levels from plan. It is normal because user can assign lvl same depth
function zero_lvl_arr(tmp_arr){ for (i = 0; i < tmp_arr.length; i++){ if(tmp_arr[i].time <= 0.001){ tmp_arr.splice(i,1); } } //if levels have same depth and gass name - glue it to one level for (i = 0; i < tmp_arr.length-1; i++){ if(tmp_arr[i].startDepth == tmp_arr[i+1].startDe...
[ "function resetLevel() {\n current_level = 1;\n }", "function resetLevel() {\n level.resetLevel();\n }", "_setMinLevelToZero() {\n let minLevel = 1e9;\n // get the minimum level\n for (let nodeId in this.body.nodes) {\n if (this.body.nodes.hasOwnProperty(nodeId)) {\n min...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
_lockDeviceScreen() Lock device screen, os.lock is an alias of this
function _lockDeviceScreen() { closeModuleDrawer(); lockScreen.removeClass("lockscreenopened hidden"); // Show the lockscreen passwordInputBox.focus(); // Focus on password box updateLockScreenTime(); // Start updating time again }
[ "function lockScreen() {}", "async lockDevice () {\n await this.command('system', 'lock')\n }", "function lockScreen() {\n let btn = id('lockScreenBtn');\n let screen = domQuery(document, '.lock-screen');\n screen.style.display = 'block';\n}", "function setScreenLocked(value){\r\n\tscreenLocked = value...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decode the received v1 data
decodeAlectoV1(data, type) { let id = utils.bin2dec(data.slice(0, 8).reverse().join('')); let result = { id: id, data: {} } // Decode the data based on the type if (type === 'TH') { let temperature = data.slice(12, 24).reverse().join(''); if (temperature[0] === '1') { ...
[ "decode(){\n try{\n var headerInfo = this._decodeHeader();\n this._decodeData( headerInfo.offset, headerInfo.header );\n }catch(e){\n console.warn( e );\n }\n\n\n }", "decodeV1(sequence) {\n\t\t\n\t\t// Reject a non-version 1 encoded sequence\n\t\tif (sequence[0] !== 0x10 && sequence[0] !...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ajax call for Student Login Verification
function checkStuLogin(){ var stuLogEmail = $("#stuLogemail").val(); var stuLogPass = $("#stuLogpass").val(); $.ajax({ url:'Student/addstudent.php', method: "POST", data:{ checkLogemail: "checklogmail", stuLogEmail:stuLogEmail, s...
[ "function checkStuLogin() {\n var stuLogEmail = $(\"#stuLogEmail\").val();\n var stuLogPass = $(\"#stuLogPass\").val();\n $.ajax({\n url: \"Student/addstudent.php\",\n type: \"post\",\n data: {\n checkLogemail: \"checklogmail\",\n stuLogEmail: stuLogEmail,\n stuLogPass: stuLogPass\n },...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A download progress event.
function HttpDownloadProgressEvent() {}
[ "function HttpDownloadProgressEvent() { }", "function DownloadProgressListener() {}", "function updateProgress (event) {\n console.log(event);\n if (event.lengthComputable) {\n var percentComplete = event.loaded / event.total * 100;\n console.log(\"The transfer is \" + percentComplete + \"% comp...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Uses findAll to return JSTree format from the File Table
findAllJSTree(query) { query = $.extend(query, { attributes: ['id', 'path', 'parent', 'name', 'type'] }); const analyzedPromise = this.db.Conclusion.findAll({where: {review_status: 'Analyzed'}, attributes: ['fileId']}) .then((concs) => concs.map((conc) => conc.fileId)); const NAPromise = th...
[ "function toJSTreeFormat(jsonData){\n // Sort data by file path to ensure files are seen before directories\n jsonData.sort(function (a, b) {\n return a.path.localeCompare( b.path );\n }).reverse();\n // Keeps track of IDs\n var uniqueIDs = {};\n\n // Loop throug...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`printQuote` function returns the random quote object as an HTML string. The `getRandomBgColor` function within it returns a random color in RGB format and changes the background color of the page each time the `printQuote` function is called. Note: the `getRandomBgColor` function code is adapted from
function printQuote() { const randomQuote = getRandomQuote(); let randomQuoteHTML = `<p class="quotes">${randomQuote.quote}</p>`; randomQuoteHTML += `<p class="source">${randomQuote.source}`; if (randomQuote.citation !== undefined) { randomQuoteHTML += `<span class="citation">${randomQuote.c...
[ "function printQuote(){\n\tvar quotes = getRandomQuote();\n\tmessage ='<p class=\"quote\">' + quotes.quote + '</p>' + '<p class=\"source\">' + quotes.name;\n\tprint(message);\n\trandomColorGenerator();\n\tdocument.getElementById('bgcolor').style.backgroundColor = randomColorGenerator();\n}", "function printQuote(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
DOING: 1.get user id 2.find all booking that made by the user 3.get the user 4. iterate through all the booking and put rider id and no of passenger booked in array 5. based on ride id array fetch all the ride detail that user booked 6.overwritng no of passenger in ride by no of passenger user is booked 7.render the us...
async function getUser(req, res) { if (req.params.id) { let user_id = req.params.id; //getting all booking done by user let booking = await Booking.find({ user_id: user_id }); let user_profile = await User.findOne({ _id: user_id }); //to store all [rides id and passenger count]...
[ "async function getMyBookedRides(req, res) {\n let user_id = req.user._id;\n //getting all booking done by user\n let booking = await Booking.find({\n user_id: user_id\n });\n //to store all [rides id and passenger count] \n let rides_id = []\n let rides = []\n booking.forEach((booking, i) => {\n //pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fetch valid target hosts in the same cluster as source host, excluding the source host.
async function fetchTargetHosts (sourceHostId) { if (config.useFakeData) { return await fetchFakeData() } const apiHosts = await engineGet('api/hosts') const allHosts = Array.isArray(apiHosts.host) ? apiHosts.host : [] const sourceHost = allHosts.find(host => host.id === sourceHostId) return !sourceHo...
[ "async function fetchTargetHosts (vms, checkVmAffinity) {\n if (!vms) {\n return []\n }\n let currentHostIds = vms\n .filter(vm => vm.host && vm.host.id)\n .map(vm => vm.host.id)\n\n // remove duplicate values\n currentHostIds = [...new Set(currentHostIds)]\n\n const json = (config.useFakeData && fet...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Crawl PaymentInformation containing the Transactions
visitPaymentInformation(paymentInformation) { this.currentPayment = this.currentTransfer.addElement('PmtInf'); var node = this.currentPayment.addElement('PmtInfId'); node.addTextNode(paymentInformation.getId()); node = this.currentPayment.addElement('PmtMtd'); node.addTextNode(pa...
[ "async getAllTransactions() {\n const response = await this.fetchPage('myGlobalTransfers.htm');\n const transactions = scrape.allTransactions(response.data);\n return transactions;\n }", "function getPaymentInfo(){\n if(getPaymentInstrument && getPaymentInstrument.data && getPaymentIn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the best state action value
bestStateActionValue(state, possibleActions, callback) { this._bestStateActionValue(state, possibleActions.slice(0), [], callback); }
[ "getBestAction(state) {\n var actions = this.model.predict(state).arraySync()[0];\n var action = actions.indexOf(Math.max(...actions));\n return action;\n }", "maxAction(state) {\n let bestValue = -Infinity;\n this.initializeState(state);\n\n // find best action in state and the corresponding v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the positions of the nodes given the current epoch number.
function epoch(currentEpoch) { // Randomize the order of the cities and loop through them var rndCityIndices = shuffleArray(Array.apply(null, { length: numCities }).map(Number.call, Number)); for (var i = 0; i < numCities; i++) { var city = cities[rndCityIndices[i]]; var winningNodeIdx = ...
[ "function updateAllNodePosition() {\n for (const [node, position] of newNodePosition) {\n if (!nodePosition.has(node)) {\n nodePosition.set(node, {left: 0, top: 0})\n }\n\n const old = nodePosition.get(node)\n\n if (Math.abs(old.left - position.left) > 1) {\n node.style.left = `${position.lef...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
make it refresh itself whenever a new event is added to a user i'm thinking: turn each
function displayUserEvents() { for (user of website.users) { //would be hilarious, if this worked let userEvents = user.savedEvents.map(e => `<li>${e.title}<br>${e.location} - ${e.date}<br>${e.description}</li>`) $('#my-events').append(`${user.title}'s saved events:<br>${user...
[ "addUserToEvent(event) {\n if (this.orgReference.child(`eventList/${event}`) !== undefined && event !== '') {\n this.orgReference.child(`eventList/${event}/people/${this.props.firebaseUser.uid}`).set(this.props.firebaseUser.displayName)\n this.orgReference.child(`userList/${this.props.f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw component & fill data from fetching API
function drawComponent(urlAPI) { fetchAPIAll(urlAPI); }
[ "function _draw() {\n let template = ''\n let jobs = _jobService.Jobs\n\n // NOTE I don't have to worry about removing old jobs here because that's passed to Job Service\n jobs.forEach(job => {\n template += job.Template\n })\n\n document.querySelector(\"#jobs\").innerHTML = template\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets whether or not there is a current line terminator
get hasLineTerminator() { return this.state.hasLineTerminator; }
[ "peekLineTerminator () {\n var { lineNo } = this.captureState();\n\n var token = this.next();\n var nextLineNo = this._lineNo;\n\n this.restoreState();\n\n // if lines numbers are not equal, than we found new line\n return lineNo !== nextLineNo;\n }", "eol() { return this.pos >= this.string.len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
init Intiates call to load posts
function init() { loadPosts(); }
[ "function init() {\n getPosts();\n }", "function init() {\n getAllPosts(); //since we want to see all posts when a page loads\n\n }", "function loadPosts() {\n if (settings.single) {\n loadAllPosts();\n } else {\n loadPostsByMonth();\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check Little or Big Endian system.
function checkIsLittleEndian () { var a = new ArrayBuffer(4); var b = new Uint8Array(a); var c = new Uint32Array(a); b[0] = 0xa1; b[1] = 0xb2; b[2] = 0xc3; b[3] = 0xd4; if (c[0] === 0xd4c3b2a1) { return true; } if (c[0] === 0xa1b2c3d4) { return false; ...
[ "function checkIsLittleEndian ()\r\n{\r\n var a = new ArrayBuffer(4);\r\n var b = new Uint8Array(a);\r\n var c = new Uint32Array(a);\r\n\r\n b[0] = 0xa1;\r\n b[1] = 0xb2;\r\n b[2] = 0xc3;\r\n b[3] = 0xd4;\r\n\r\n if (c[0] === 0xd4c3b2a1)\r\n {\r\n return true;\r\n }\r\n\r\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the default browser context. The default browser context cannot be closed.
defaultBrowserContext() { return this._defaultContext; }
[ "browserContext() {\n return this._target.browserContext();\n }", "get defaultContext() {\n return result(this.constructor, 'defaultContext', {})\n }", "browserContext() {\n return __classPrivateFieldGet(this, _CDPPage_target, \"f\").browserContext();\n }", "async grabContext() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts HSL components to an HSV color.
function hsl2hsv(h, s, l) { s *= (l < 50 ? l : 100 - l) / 100; var v = l + s; return { h: h, s: v === 0 ? 0 : ((2 * s) / v) * 100, v: v }; }
[ "static HSVToRGB() {}", "function hsl2hsv(h, s, l) {\n s *= (l < 50 ? l : 100 - l) / 100;\n var v = l + s;\n return {\n h: h,\n s: v === 0 ? 0 : ((2 * s) / v) * 100,\n v: v,\n };\n}", "function hsv2hsl(h, s, v) {\n s /= _consts__WEBPACK_IMPORTED_MODULE_0__.MAX_COLOR_SATURATIO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
obtener los tramites en proceso de un usuario en especifico
function getTramitesProceso() { if (vm.usuarioOficina == "rc") { if (vm.usuarioTramites == 'A') { fire.ref('rh/tramitesProceso').orderByChild('usuarioOficina').equalTo('A').on('value', function(snapshot){ vm.listaTramitesProceso = snapshot.val(); $rootScope.$apply(); ...
[ "function getListTramites() {\n if (vm.usuarioOficina == \"rc\") {\n if (vm.usuarioTramites == 'A') {\n fire.ref('rh/tramites/registroyControl').orderByChild('tipoUsuario').equalTo('A').on('value', function(snapshot){\n vm.listaTramites = snapshot.val();\n $rootScope.$appl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the trigrams of the text (i.e. ngrams of length 3)
get trigrams () { return this.#ngram(3) }
[ "function get_trigrams(tlist){\n\tvar trigrams = new Map();\n\tvar tuptest = [\"\",\"\"];\n\tfor(var j = 0; j < tlist.length-2; j++){\n\t\ttuptest[0] = tlist[j];\n\t\ttuptest[1] = tlist[j+1];\n\t\tif(trigrams[tuptest]){\n\t\t\ttrigrams[tuptest].add(tlist[j+2]);\n\t\t}\n\t\telse{\n\t\t\ttrigrams[tuptest] = new Set([...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
handleEating Takes a Prey / Fruit object as an argument and checks if the hunter overlaps it. If so, reduces the prey's health and increases the hunter's. If the eatble dies, it gets reset.
handleEating(eatable) { // Calculate distance from this predator to the prey let d = dist(this.x, this.y, eatable.x, eatable.y); // Check if the distance is less than their two radii (an overlap) if (d < this.radius + eatable.radius) { if (eatable.health > 0) { // Increase hunter health an...
[ "handleEating(prey) {\n // Calculate distance from this predator to the prey\n let d = dist(this.x, this.y, prey.x, prey.y);\n // Check if the distance is less than their two radii (an overlap)\n if (d < this.radius + prey.radius) {\n // Increase predator health and constrain it to its possible ran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EXERCISE 3 Define a function, add2Numbers(num1, num2), to return the sum of 2 values
function add2Numbers(num1, num2) { return num1 + num2; }
[ "function add2Numbers(num1, num2){\n return num1+num2\n}", "function add2Numbers(num1, num2){\n return num1+num2;\n}", "function sum(num1, num2) {return num1 + num2}", "function addNumbers(num1, num2) {\n return num1 + num2\n}", "function sum(num1, num2) {}", "function addNumbers(number1, number2) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toggles the variable is_loading to false and removes the component loading state
removeLoadingState() { if (this.is_loading) { this.is_loading = false; this.reportComponentReadiness(); } $("#"+this.uid+"_ComponentContent").show(); $("#"+this.uid+"_ComponentPlaceholder").hide(); }
[ "removeLoadingState() {\n this.element.classList.remove(this.classNames.loadingState);\n this.element.removeAttribute('aria-busy');\n this.isLoading = false;\n }", "function hideLoading() {\n _updateState(hotelStates.HIDE_LOADING);\n }", "stopLoader() {\n this.loading = fa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
isStudentIdentifier: Returns true if grading option for this question is one that identifies a student
function isStudentIdentifier(grade_opt) { return (grade_opt === GRADING_OPT_STUD_ID); }
[ "function isStudent(id) {\n\treturn clients[id].permissions == \"student\";\n}", "function quesIdentifiesStudent(ques) \n { \n if (ques.indexOf('first') != -1)\n {\n return true;\n }\n else if (ques.indexOf('last') != -1)\n {\n return true;\n }\n else if (ques.indexOf('name...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IsUnicode / Script Name: IsUnicode.js Creation Date: 20080416 Last Modified: 20100316 Copyright: Copyright (c) 2010 by Mofi Original: Note: With UltraEdit v16.00 and later versions this function is not needed anymore because of document property codePage. The function IsUnicode returns true if the file is detected by U...
function IsUnicode (nDocumentNumber) { /* Determine the type of output for debug messages from the global variable g_nDebugMessage: 1 ... debug to output window, 2 ... debug to message dialog, all others ... no debug messages. If the global variable g_nDebugMessage does not exist, don't show debug...
[ "function fileOpened(filename)\r\n{\r\n var ed = newEditor();\r\n for(var i=0; i<editorsCount(); i++)\r\n {\r\n ed.assignEditorByIndex(i);\r\n var tmpFile = ed.fileName();\r\n\r\n if (tmpFile.toLowerCase() == filename.toLowerCase())\r\n return true;\r\n }\r\n return false;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
3D DISKFIELD This is unusual in that there's hardly any CODEF in it! We're calculating the 3D ourselves. This function is partially based on a 3D spritefield routine by Mellow Man. LAYER OPTIONS: diskfield: true/false (default is false)
function draw_diskField() { if ( defaultFalse( currentPart.diskfield ) ) { var halfWidth = 640 / 2; // Vanishing point in the centre of the screen var halfHeight = 480 / 2; var length = diskFieldCoordinates.length; for( var i = 0; i < length;...
[ "function vectorDisks() {\n\t\t\t/*\n\t\t\t * First set up the S:\n\t\t\t * 21012\n\t\t\t * 2-####\n\t\t\t * 1#----\n\t\t\t * 0-###-\n\t\t\t * 1----#\n\t\t\t * 2####-\n\t\t\t */\n\t\t vectorDiskImgS = new Array();\n\t\t vectorDiskImgS[0]=new image(DEMO_ROOT + \"/def/resources/disk2.gif\");\n\t\t var...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Connects caller to people oncall and builds a log of calls made
function call (twiml, context, event, payload) { log('call', event); return new Promise((resolve, reject) => { const {messages} = context; const {DialCallStatus, From} = event; const {callerId, firstCall, goToVM, phoneNumbers, teamsArray, voice} = payload; let {detailedLog, realCallerId} = payload; ...
[ "function storeCallLogs() {\n var callEventChannel, action, call, logEntry, contactName;\n return _regenerator2.default.wrap(function storeCallLogs$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0, _effects3.actio...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `FieldIdentifierProperty`
function CfnWebACL_FieldIdentifierPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but receive...
[ "function CfnSqlInjectionMatchSet_FieldToMatchPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines whether the specified path is relative or not.
function relative(path) { const char = path.substr(0, 1); return char !== '/' && char !== '@'; }
[ "function pathIsRelative(path){return /^\\.\\.?($|[\\\\/])/.test(path);}", "isRelative(path) {\n return (/^\\.{1,2}[/\\\\]?/.test(path) ||\n /[/\\\\]\\.{1,2}[/\\\\]/.test(path) ||\n /[/\\\\]\\.{1,2}$/.test(path) ||\n /^[a-zA-Z0-9_.][^:]*$/.test(path));\n }", "function ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
external divexact: t > t > t Provides: ml_z_divexact Requires: bigInt, ml_z_div
function ml_z_divexact(z1, z2) { return ml_z_div(z1, z2); }
[ "function ml_z_div_rem(z1, z2) {\n}", "function ml_z_div(z1, z2) {\n z2 = bigInt(z2)\n if(z2.equals(bigInt(0))) caml_raise_zero_divide();\n return ml_z_normalize(bigInt(z1).divide(bigInt(z2)))\n}", "function ml_z_perfect_square(z) {\n z = bigInt(z);\n if (z.lt(bigInt(0))) {\n return 0;\n }\n var root ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
frameLooper() animates any style of graphics you wish to the audio frequency Looping at the default frame rate that the browser provides(approx. 60 FPS)
function frameLooper(){ window.requestAnimationFrame(frameLooper); fbc_array = new Uint8Array(analyser.frequencyBinCount); frequencies = new Float32Array(analyser.frequencyBinCount); analyser.getFloatFrequencyData(frequencies); //converting the analyser frequency into javascript array analyser.getByteFreq...
[ "function frameLooper() {\n\n\t\t\t$window.requestAnimationFrame(frameLooper);\n\t\t\tfbc_array = new Uint8Array(analyser.frequencyBinCount);\n\t\t\tanalyser.getByteFrequencyData(fbc_array);\n\t\t\tctx.clearRect(0, 0, canvas.width, canvas.height); // Clear the canvas\n\t\t\tctx.fillStyle = _current_track === 0 ? \"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Callback for when ARKit is initialized deviceId: DOMString with the AR device ID
_onInit(deviceId){ this._deviceId = deviceId this._isInitialized = true try { this.dispatchEvent(new CustomEvent(ARKitWrapper.INIT_EVENT, { source: this })) } catch(e) { console.error('INIT_EVENT event error', e) } }
[ "function _getSetDeviceIdentifier(){\n\n let deviceId = _getVadrDeviceFromCookie();\n\n if (!deviceId)\n deviceId = _setVadrDeviceCookie();\n\n deviceInfo['deviceId'] = deviceId;\n\n}", "_onInit(deviceId) {\n\t\tthis._deviceId = deviceId\n\t\tthis._isInitialized = true\n\t\tthis.dispatchEvent(new ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
deleteCandidate_blockBased Input: 1 <= i, j, i_block, j_block <= 3 1 <= n <= 9 Results: None Side Effects: change this.candidates
deleteCandidate_blockBased(i_block, j_block, i, j, n){ this.deleteCandidate((i_block-1)*3+i, (j_block-1)*3+j, n); }
[ "deleteCandidate(i, j, n){\r\n const I = i-1;\r\n const J = j-1;\r\n const N = n-1;\r\n\r\n const n_bit_mask = 0b111111111 ^ (1<<N);\r\n this.candidates[I*9 + J] &= n_bit_mask;\r\n\r\n const i_bit_mask = 0b111111111 ^ (1<<I);\r\n const j_bit_mask = 0b111111111 ^ (1<<...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
load font from fonts folder to use for link text
function loadFont() { var loader = new THREE.FontLoader(); loader.load('../fonts/work_sans_regular.json', function (response) { font = response; refreshText(); }); }
[ "function loadFont() {\n\tvar loader = new THREE.FontLoader();\n\t\tloader.load( 'js/helvetiker_regular.typeface.js', function ( response ) {\n\t\t\taddMainShape();\n\t\t\taddShapes();\n\t\t\tcreateText();\n\t\t} );\n}", "loadFont(name, url) {\n var newFont = new FontFace(name, `url(${url})`);\n new...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
user dropped the payload on us at the given position. Defer the insertion to our actual constructViewer which has all the necessary props
onDrop(globalPosition, payload) { const blocks = this.constructViewer.addItemAtInsertionPoint(payload, this.insertion); this.constructViewer.blockSelected(blocks); this.constructViewer.constructSelected(this.constructViewer.props.constructId); }
[ "postDropped() {\n }", "addItemAtInsertionPoint(payload, insertionPoint) {\n const { item, type } = payload;\n if (type === sbolDragType) {\n // must have an insertion point for sbol\n if (insertionPoint) {\n // blocks with an sbol symbol can be dropped on an edge and get inserted\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return true if all points are in the given plane.
isInPlane(plane) { return PointHelpers_1.Point3dArray.isCloseToPlane(this._points, plane, Geometry_1.Geometry.smallMetricDistance); }
[ "isInPlane(plane) {\n let point = this._workPoint0;\n for (let i = 0;; i++) {\n point = this.getPolePoint3d(i, point);\n if (!point)\n return true;\n if (!plane.isPointInPlane(point))\n break; // which gets to return false, which isotherwi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public function `like`. Tests whether `data` 'quacks like a duck'. Returns true if `data` has all of the properties of `archetype` (the 'duck'), false otherwise.
function like (data, archetype) { var name; for (name in archetype) { if (archetype.hasOwnProperty(name)) { if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) { return false; } if (object(data[name]) && like(data[name], archetype[na...
[ "function like(data, archetype) {\n var name;\n\n for (name in archetype) {\n if (hasOwnProperty.call(archetype, name)) {\n if (hasOwnProperty.call(data, name) === false || _typeof(data[name]) !== _typeof(archetype[name])) {\n return false;\n }\n\n if (object(data[name]) && ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
sends several query commands to QMP to get details for a VM
function infoVM(uuid, types, callback) { var res = {}; var commands = [ 'query-version', 'query-chardev', 'query-block', 'query-blockstats', 'query-cpus', 'query-pci', 'query-kvm', ]; VM.log('DEBUG', 'LOADING: ' + uuid); VM.load(uuid, functio...
[ "function doQuery () {\n serial.write(query);\n }", "setQuery() {\n switch (this.queryType) {\n case QUERY_HOTTEST:\n this.query = this.query = this.fb_inst.database()\n .ref('serverState/')\n .orderByChild('temp')\n .limitToLast(this.details.limit);\n if...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Displays a new notification when the list of the users who are currently drawing is updated.
function updateUsersDrawing() { $('#notifications').text(''); switch(usersCurrentlyDrawing.length) { case 1: $('#notifications').text( usersCurrentlyDrawing[0] + ' is drawing...' ); break; case 2: $('#notifications').text( usersCurrentlyDrawing[0] + ' and ' + usersCurrentlyD...
[ "function updateUsersInLobby(){\n\t\tshowAdminButtons();\n\n var usersHtml = '';\n for (var i in g.users){\n var u = g.users[i];\n\t\t\tif (u !== null){\n\t usersHtml += '<li class=\"mdl-list__item mdl-list__item--two-line\">';\n\t usersHtml += '<span class=\"mdl-list__item-primary-content\">';...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get checkpoint by id
getCheckpoint (index) { for (var i = 0; i < this.checkpoints.length; i++) { if (this.checkpoints[i].id === index) { return this.checkpoints[i] } } }
[ "function getCheckpointByTask(task) {\n return vm.checkpoints.find(cp => cp.uid === task.checkpoint_id);\n }", "restoreCheckpoint(checkpointId) {\n let contents = this._manager.contents;\n let path = this._path;\n return this._manager.ready.then(() => {\n if (checkpointId) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return pool public ports
function getPublicPorts(ports, callback) { async.waterfall([ function(callback) { redisClient.keys(redisPrefix + ":ports:*", callback); }, function(portsKeys, callback2) { var redisCommands = portsKeys.map(function(k) { return ["hmget", k, "port", "use...
[ "inspectPool() {\n return this.connections.map(c => ({ broken: c.broken, free: c.free }))\n }", "list() {\n console.log(this.numberPool);\n }", "get publicIpv4Pool() {\n return this.getStringAttribute('public_ipv4_pool');\n }", "get pools() {\n return this.list()\n }", "get publi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }