query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
getData function is used to get the reports from the db | async function getData() {
var res = await get_all_reports();
await SetEventReports(res.data.data);
$("#eventReportTable").dataTable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getReportData() {\n if($scope.selectedInst.startDate !== \"\"){\n reqData = {\n startDate: $scope.selectedInst.startDate,\n instType: $scope.selectedInst.instType\n };\n DashboardService.getReport(reqData)\n ... | [
"0.74369156",
"0.71184975",
"0.70809865",
"0.70348",
"0.697599",
"0.6844091",
"0.68299043",
"0.68269545",
"0.68047386",
"0.67018473",
"0.66933006",
"0.66581136",
"0.66571987",
"0.66178715",
"0.65429217",
"0.6523101",
"0.65152407",
"0.65035325",
"0.65028095",
"0.6501919",
"0.6... | 0.7241886 | 1 |
withNoKey is areas where JSON sets up hierarchies(steps). | withNoKey(includeNoStepAreas = true) {
const token = includeNoStepAreas ? '|' : '';
return '(' +
'(' +
/* 1. -> }]},{, }]},[ */
// catch desc symbols
'(' +
'(?:' + commons.spaceOrNot + '[\\]}]' + commons.spaceOrNot + ')+' +
token + ')' +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createJSONhierarchyNOTFIL(flatDataset, rootKey, keys){\n\t\tvar hierarchy = d3.nest();\n\t\tkeys.forEach(applyKey);\n\t\t\n\t\tfunction applyKey(key, i){\n\t\t\thierarchy = hierarchy\n\t\t\t\t.key(function (d) { \n\t\t\t\t\treturn d[key];\n\t\t\t\t});\n\t\t}\n\t\t\n\t\t//Uncomment to see effect of rollup ... | [
"0.55750525",
"0.52678066",
"0.5215533",
"0.49642",
"0.49533334",
"0.48949847",
"0.4867748",
"0.4780635",
"0.4749387",
"0.4729593",
"0.4685231",
"0.4667344",
"0.46606353",
"0.46596006",
"0.4658577",
"0.46457157",
"0.46199012",
"0.46067104",
"0.46043253",
"0.46043253",
"0.4574... | 0.6497387 | 0 |
check if we should clean our list of loaded maps | function clean_maps() {
var count;
list_maps();
for (var k in maps) {
for (var i = 0; i < maps[k].length; i++) {
var map = maps[k][i];
count++;
// if map render job is idle and last render process is older than
// an hour, remove map
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CleanMap() {\n\tRemoveMarkers();\n\tRemovePolylines();\n}",
"clearMap() {\r\n localStorage.hasOwnProperty('houseMaps') == true ? localStorage.removeItem(\"houseMaps\") : null;\r\n }",
"cleanMap() {\n this.savedMarker.forEach(marker => {\n marker.setMap(null);\n });\n ... | [
"0.72361547",
"0.68190014",
"0.6782017",
"0.67750555",
"0.6729021",
"0.67077124",
"0.66959685",
"0.65828353",
"0.64847183",
"0.64552236",
"0.64150494",
"0.63861704",
"0.6337885",
"0.63310456",
"0.6312354",
"0.63067645",
"0.6291884",
"0.6291884",
"0.62736785",
"0.6273468",
"0.... | 0.74661916 | 0 |
Recursively wait for program command input. | function waitForCommandInput() {
/**
* Print menu & request input.
*/
function getCommandInput() {
prompt.get(['command'], function (err, input) {
if (err) {
console.log(err);
return 1;
}
console.log();
processCmd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wait(){}",
"enterWaitCommand(ctx) {\n\t}",
"function listenForUserInput() {\n rl.question(\"Where to? \", function(input) {\n if (input !== null) {\n if (input === `new` ) newBookSearch();\n if (input === `list` ) readingListView();\n if (input === `main` ) m... | [
"0.5748946",
"0.5433633",
"0.54191506",
"0.5404945",
"0.5392892",
"0.53488225",
"0.53445756",
"0.52594966",
"0.52358425",
"0.5198526",
"0.51588386",
"0.51510835",
"0.51106536",
"0.51093215",
"0.5090821",
"0.5062272",
"0.5050881",
"0.50453556",
"0.49785227",
"0.49752432",
"0.4... | 0.65038645 | 0 |
The scrap process logic. | function doScrape() {
console.log('Article Count : ' + articles.length);
console.log('URL in process : ' + kompas.getBaseURL());
kompas.scrap().then(function (scraps) {
scraps.forEach(function (news) {
if (!news.content || scrapLimit == articles.length) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async scrapeData() {\n this.scrapers += 1\n const urlEntity = this.dequeueUrlEntity()\n urlEntity.attempts += 1\n const { success, data, nextUrls } = await urlEntity.scraper.run(urlEntity.url)\n if (success) {\n this.enqueueDataEntities(new DataEntity(data, urlEntity.dataProcessor))\n this... | [
"0.70094264",
"0.67520946",
"0.64467144",
"0.6356337",
"0.6244518",
"0.6238356",
"0.6214908",
"0.6172346",
"0.60987145",
"0.6075068",
"0.60612273",
"0.60563713",
"0.60266924",
"0.60188943",
"0.6016134",
"0.5981837",
"0.5923604",
"0.58950764",
"0.58824146",
"0.5870199",
"0.585... | 0.70915204 | 0 |
Subscribe to commands requests | subscribe(request, cb) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
if (!request) {
reject(new Error('commands subscription requires a request object'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"start() {\n this.commands = CommandHandler.loadCommands.bind(this)();\n let listenerFunction = this.commandListener;\n this.loggingObject.on('chatMessage', listenerFunction);\n }",
"subscribe() {}",
"listenRequests() {\n this.request(event.detail.request);\n }",
"listenRequests() ... | [
"0.6255419",
"0.61407995",
"0.6140389",
"0.61007464",
"0.6053352",
"0.5987729",
"0.5965665",
"0.59598297",
"0.5957076",
"0.5891596",
"0.5885904",
"0.5885238",
"0.586861",
"0.584953",
"0.58405805",
"0.58358395",
"0.58032286",
"0.5757958",
"0.5750997",
"0.5743115",
"0.573663",
... | 0.63364184 | 0 |
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',
'leading-icon': 'leadingIcon',
'trailing-icon': 'trailingIcon',
errortext: 'errortext',
};
// set the label ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initBinder() {\n this.binder = new UniversalFieldNodeBinder(this);\n\n // set the attribute mappings\n this.binder.attributeMappings = {\n label: 'label',\n hint: 'hint',\n min_term_length: 'min-term-length',\n no_result_hint: 'no-result-hint',\n errortext: 'errortext',\n 'e... | [
"0.76379263",
"0.760064",
"0.75726944",
"0.75726944",
"0.71713424",
"0.57125795",
"0.53415596",
"0.51142675",
"0.51132596",
"0.50910395",
"0.50129175",
"0.5008345",
"0.50019884",
"0.49911585",
"0.49750564",
"0.4967092",
"0.49362507",
"0.4882076",
"0.4849916",
"0.4828641",
"0.... | 0.7640164 | 0 |
Closes the extendend details row in the table | function closeExtendedDetails() {
var extendedRow = document.getElementsByClassName("extended-tablecell");
var details = document.getElementById("extended-details");
if (details != null) {
details.remove();
}
extendedRow[0].classList.remove("extended-tablecell");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeTableRow() {\n const row = this._popStackItem();\n row.next.rows.push(row.cells);\n }",
"function closeEditPanel(table) {\n\tjQuery(table).closest('.ui-jqgrid-view').find('.jqgw-form').animate({height:'hide'}, 'fast', function () {\n\t\tjQuery(this).remove();\n\t});\n/*\tjQuery(tabl... | [
"0.6567685",
"0.6326847",
"0.630544",
"0.62804997",
"0.62219125",
"0.6133099",
"0.60405904",
"0.5895904",
"0.5893365",
"0.58911055",
"0.5877693",
"0.5839537",
"0.57989395",
"0.5779039",
"0.57317716",
"0.5729705",
"0.5726944",
"0.5716834",
"0.5716097",
"0.5694408",
"0.5688643"... | 0.74434984 | 0 |
Sorts the newly received projects | function sortProjects(newProjects) {
newProjects.sort(function(a, b) {
return a.last_updated < b.last_updated
});
projects = projects.concat(newProjects);
receivedProjects += newProjects.length;
if (connectorCallbacks == connectorAPIs.length) {
console.log("Added " + receivedProjects + " items to main... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByProjectByName(a, b) {\n var p1 = a[3].toLowerCase();\n var p2 = b[3].toLowerCase();\n\n var n1 = a[0].toLowerCase();\n var n2 = b[0].toLowerCase();\n\n if (p1 < p2) return -1;\n if (p1 > p2) return 1;\n if (n1 < n2) return -1;\n if (n1 > n2) return 1;\n return 0;\n}",
"function sortJSON()... | [
"0.67001575",
"0.6588279",
"0.6516143",
"0.64764625",
"0.62882376",
"0.6272126",
"0.6271575",
"0.61478597",
"0.6129773",
"0.60847205",
"0.6044808",
"0.6043597",
"0.59725136",
"0.5955278",
"0.59505177",
"0.5893392",
"0.5879459",
"0.58704984",
"0.5839848",
"0.58395463",
"0.5823... | 0.784213 | 0 |
Displays or hides the searching indicator | function toggleSearchingIndicator(showIndicator) {
var searchingIndicator = document.getElementById("searchingIndicator");
if (showIndicator) {
searchingIndicator.style.display = "block";
} else {
searchingIndicator.style.display = "none";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showLoading() {\n if (!this._isEnabled) {\n return;\n }\n this._isSearching = true;\n }",
"function hideSearch() {\n if(searchVisible === true) {\n noSearch(); \n } else { \n yesSearch(); \n }\n}",
"function showSearch() {\n var search = d... | [
"0.73641974",
"0.7092805",
"0.70540965",
"0.7026522",
"0.68847364",
"0.680919",
"0.6728372",
"0.67184645",
"0.67079586",
"0.6703599",
"0.66719586",
"0.6614829",
"0.6596002",
"0.6576687",
"0.6575102",
"0.6572745",
"0.65671515",
"0.6543419",
"0.6535007",
"0.65189606",
"0.650169... | 0.74288887 | 0 |
Adds the selected sources into the connectorAPIs array | function getConnectors() {
for (var i = 0; i < sources.length; i++) {
connectorAPIs.push(connectorManager.getConnector(sources[i]));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _addResourceSources(_sources) {\n var source = {};\n \n if ($.isFunction(_sources)) {\n // is it a function?\n source = {\n resources: _sources\n };\n sources.push(source);\n } else if (typeof _sources == 'string') {\n ... | [
"0.6201439",
"0.61476564",
"0.60114205",
"0.59187436",
"0.5909618",
"0.5710985",
"0.5659737",
"0.5651576",
"0.557511",
"0.55625254",
"0.5558552",
"0.5519817",
"0.5488716",
"0.54053134",
"0.5399555",
"0.53692913",
"0.53612804",
"0.5350652",
"0.5337904",
"0.53356045",
"0.529639... | 0.71458113 | 0 |
Adds the selected sources into the sources array | function getSources() {
var checkboxes = document.getElementsByName('source');
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked) {
sources.push(checkboxes[i].id);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSourcesToAdd(newSources, prevSources) {\n const sourcesToAdd = [];\n\n for (const sourceId in newSources) {\n const newSource = newSources[sourceId];\n const prevSource = prevSources ? prevSources[sourceId] : null;\n\n if (!prevSource) {\n sourcesToAdd.push(newSource);\n }\n }\n\n ... | [
"0.6618021",
"0.6467958",
"0.644093",
"0.6274462",
"0.6262191",
"0.6242241",
"0.61180335",
"0.6101797",
"0.60742813",
"0.6009994",
"0.6005541",
"0.59844166",
"0.5903955",
"0.5852964",
"0.58406705",
"0.5829141",
"0.582365",
"0.57785624",
"0.57662696",
"0.5722374",
"0.5683683",... | 0.65158826 | 1 |
Removes listeners for a models updates on the socket | unsyncUpdates(modelName) {
socket.removeAllListeners(modelName + ':save');
socket.removeAllListeners(modelName + ':remove');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unsyncUpdates(modelName) {\n socket.removeAllListeners(`${modelName}`);\n }",
"cleanup() {\n const { ws, udp } = this.sockets;\n\n if (ws) {\n ws.removeAllListeners('error');\n ws.removeAllListeners('ready');\n ws.removeAllListeners('sessionDescription');\n ws.removeAllListeners... | [
"0.8479141",
"0.72282875",
"0.7184978",
"0.7004949",
"0.69852084",
"0.6895172",
"0.68171924",
"0.68053955",
"0.6797941",
"0.6797941",
"0.6797941",
"0.674051",
"0.669406",
"0.65867627",
"0.657754",
"0.65357924",
"0.6530729",
"0.65093386",
"0.6483103",
"0.64670277",
"0.6458075"... | 0.85994476 | 1 |
send newchatmessage event to server | sendChatMessage(data) {
socket.emit('new-chat-message', data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}",
"sendnewMessage(mess) {\n if (mess.value) {\n // Sent event to server\n this.socket.emit(\"newMessage... | [
"0.7359438",
"0.7354533",
"0.7353207",
"0.7336971",
"0.7261915",
"0.71568906",
"0.7143424",
"0.7143424",
"0.70979154",
"0.70965093",
"0.7094387",
"0.7043675",
"0.7007581",
"0.6998439",
"0.69698346",
"0.6968696",
"0.69625807",
"0.69543374",
"0.69375515",
"0.6930439",
"0.690738... | 0.7853533 | 0 |
send sendtip event to server | sendTip(data) {
socket.emit('send-tip', data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onReceiveTip(cb){\n cb = cb || angular.noop;\n socket.on('send-tip', cb);\n }",
"function tellPos(p) {\n // console.log(\"Position X : \" + p.pageX + \"<br />Position Y : \" + p.pageY);\n send_http_data({\n url: \"https://genesis-ai-test.herokuapp.com/data_post_test/\",\n data: {\n ... | [
"0.6403656",
"0.59936166",
"0.580953",
"0.5750802",
"0.564691",
"0.5644115",
"0.5600155",
"0.55763054",
"0.5558345",
"0.55553246",
"0.55442226",
"0.5524308",
"0.55098504",
"0.54974407",
"0.54760283",
"0.54506606",
"0.54478264",
"0.5447263",
"0.54350847",
"0.5422979",
"0.54059... | 0.81653607 | 0 |
Event for send tip callback | onReceiveTip(cb){
cb = cb || angular.noop;
socket.on('send-tip', cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendTip(data) {\n socket.emit('send-tip', data);\n }",
"tooltipClicked() {}",
"showToolTip_(event) {\n this.updateToolTip_(event);\n }",
"_callToolTip () {\n const toolTip = this.getToolTip();\n const svg = this.getSVG();\n\n if (toolTip) {\n svg.call(toolTip);... | [
"0.76644063",
"0.64179623",
"0.6193453",
"0.5881844",
"0.58562905",
"0.58498996",
"0.5775589",
"0.57292444",
"0.5704063",
"0.56855106",
"0.5678188",
"0.5676898",
"0.56687194",
"0.5654968",
"0.5614235",
"0.5563004",
"0.5558277",
"0.55464673",
"0.5541523",
"0.5535867",
"0.54919... | 0.6871302 | 1 |
event check current model online | getCurrentModelOnline(roomId){
socket.emit('current-model-online', roomId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onCurrentModelOnline(cb){\n cb = cb || angular.noop;\n socket.on('current-model-online', cb);\n\n }",
"function modelIsReady() {\n modelStatus = \"ready\"\n console.log('Classificação de libras carregada!');\n console.log(\"Modelo pronto!\") \n}",
"onModelOnline(cb){\n cb = cb || a... | [
"0.70774865",
"0.6747645",
"0.67090756",
"0.6667606",
"0.6590989",
"0.65239024",
"0.6476454",
"0.64631784",
"0.64034456",
"0.63933885",
"0.63679576",
"0.6337206",
"0.63289964",
"0.6307874",
"0.6300558",
"0.6184769",
"0.6184147",
"0.6137388",
"0.61142296",
"0.6077017",
"0.6048... | 0.69471335 | 1 |
event get current model of room online | onCurrentModelOnline(cb){
cb = cb || angular.noop;
socket.on('current-model-online', cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCurrentModelOnline(roomId){\n socket.emit('current-model-online', roomId);\n }",
"ActiveRoom(){\r\n\t\tif(this.roomsMgr.RoomExists(this.activeRoom)){\r\n\t\t\treturn this.roomsMgr.Room(this.activeRoom);\r\n\t\t}\r\n\t\treturn this.roomsMgr.Room(SERVER_CH);\r\n\t}",
"onModelOnline(cb){\n c... | [
"0.8283319",
"0.63272417",
"0.6091808",
"0.6050797",
"0.6048539",
"0.60062563",
"0.59896284",
"0.57780665",
"0.57418174",
"0.57128996",
"0.56515795",
"0.5650952",
"0.5646678",
"0.56444657",
"0.564243",
"0.5641292",
"0.5628687",
"0.5605072",
"0.5603634",
"0.5584227",
"0.556977... | 0.66167486 | 1 |
model init public chat | onModelInitPublicChat(cb){
cb = cb || angular.noop();
//online status
socket.on('public-chat-init', cb);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chatModel() { }",
"function init() {\n \n initChatList();\n}",
"function initChat() {\n setConfigurations();\n greet();\n}",
"init() {\n\n // add the first ten messages to the chat.\n App.actions.loadMessages();\n\n // change the chat header to use the user's nickname\n ... | [
"0.8390154",
"0.70816547",
"0.7080606",
"0.68998975",
"0.68475676",
"0.6747584",
"0.6618267",
"0.6556365",
"0.65013885",
"0.64994407",
"0.6484086",
"0.646738",
"0.6315675",
"0.62782216",
"0.6275398",
"0.62319106",
"0.62162757",
"0.6203239",
"0.61909175",
"0.61826503",
"0.6179... | 0.74114794 | 1 |
notify with model when they receive new tokens | sendModelReceiveInfo(tokens){
socket.emit('model-receive-info', tokens)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tokenHandler(response) {\n client_configuration['notifications'] = {\n status: true,\n token : response\n };\n updateToken(response);\n userModel.set('udid', response);\n}",
"onRegister(token)\n {\n // console.log('TOKEN:', token);\n ... | [
"0.6384297",
"0.63628274",
"0.6326367",
"0.62886906",
"0.6123177",
"0.60420364",
"0.60373193",
"0.60373193",
"0.5922969",
"0.5861761",
"0.5778741",
"0.575047",
"0.57392204",
"0.57256716",
"0.56603384",
"0.5659298",
"0.56454873",
"0.5564847",
"0.5564755",
"0.55177426",
"0.5493... | 0.69206613 | 0 |
using tabletop to get gDoc | function tabletop(doc) {
Tabletop.init({
key: doc,
callback: insertDoc,
simpleSheet: false
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDoc() {\n return {\n \"blob\": {\n rows: ns.brd.rwMax,\n cols: ns.brd.colMax,\n cells: ns.brd.getCells()\n },\n \"readers\": [\"public\"]\n };\n }",
"function init() {\n Tabletop.init({\n key: url_publi... | [
"0.6179033",
"0.6114232",
"0.6005203",
"0.6005203",
"0.6005203",
"0.5893912",
"0.58752286",
"0.58082306",
"0.56582654",
"0.56007385",
"0.5584457",
"0.5494547",
"0.54440296",
"0.53850603",
"0.53730226",
"0.5343952",
"0.53418833",
"0.5322164",
"0.5306363",
"0.5300211",
"0.52891... | 0.7007145 | 0 |
Rounds irrational numbers to a whole token by truncation (rounding down), which matches the behavior of Solidity integer math (especially division). This accommodates rounding up of very tiny decimals short of a whole token without rounding up. | function round(amountIn) {
let amount = amountIn;
amount = amount / WEI;
let result = Math.floor(Math.floor(amount * 10 + 1) / 10);
result = tokensToWei(result);
if (log) console.log(' round: ' + amountIn + ' -> ' + result);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tidyround(x, r=1) {\n if (r < 0) return NaN\n if (r===0) return +x\n const y = round(x/r)\n const rpow = /^0?\\.(0*)10*$/ // eg .1 or .01 or .001 -- a negative power of 10\n const marr = normberlize(r).match(rpow) // match array; marr[0] is whole match\n if (!marr) return y*r\n const p = -marr[1].l... | [
"0.6551829",
"0.60753036",
"0.59241885",
"0.59232914",
"0.59014297",
"0.5892977",
"0.5884744",
"0.5859589",
"0.58579427",
"0.58576614",
"0.5835157",
"0.5818494",
"0.579295",
"0.5754615",
"0.5743777",
"0.57201326",
"0.57068515",
"0.56973344",
"0.56929046",
"0.56906456",
"0.565... | 0.6715343 | 0 |
Use the 'approve/transfer' method to transfer funds. | async function approveThenTransferFunds(from, to, amount) {
// In the 'from' account, approve 'to' to be able to take funds.
result.set(await CpuCoin.methods.approve(to, amount).send({from: from}));
result.checkTransactionOk('approveThenTransferFunds(): approve failed');
// Transfer appr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"transfer(amount, destination) {\n this.withdraw(amount);\n destination.deposit(amount);\n }",
"approve(id, payload) {\n return this.request.put(`/transaction/approve-withdraw-request/${id}`, payload);\n }",
"function transferFundingFee(person1Release,person2Release,doneeRelease,arbPaid... | [
"0.70241743",
"0.687871",
"0.6853504",
"0.6606352",
"0.65487397",
"0.65244216",
"0.64982027",
"0.6450211",
"0.63645136",
"0.62004507",
"0.61564565",
"0.6148275",
"0.6115484",
"0.61086154",
"0.6062428",
"0.6030169",
"0.5974809",
"0.59221256",
"0.58954746",
"0.58920634",
"0.586... | 0.74803156 | 0 |
Helper function to verify the vesting schedule day by day over many days | async function testVestingScheduleDayByDay(account, [totalAmount, vestingAmount, startDay], [duration, cliffDuration, interval, isRevocable = false]) {
// Verify unvested balance day by day, starting 2 days before day 0, and ending 2 days after the last day.
const dayIncrement = (interval % 3 === 0) ? i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_sched_conflict(dt,hr,mn,duration){\n //--- assume all is valid\n modelInspection.set(\"isvalid\",true);\n var idx_date = {Jan:\"0\",Feb:\"1\",Mar:\"2\",Apr:\"3\",May:\"4\",Jun:\"5\",Jul:\"6\",Aug:\"7\",Sep:\"8\",Oct:\"9\",Nov:\"10\",Dec:\"11\"};\n var arr = dt.split(\"-\");\n var new_... | [
"0.6332606",
"0.6205873",
"0.61887705",
"0.61755824",
"0.6031981",
"0.59912264",
"0.59738487",
"0.58729035",
"0.5866247",
"0.5853702",
"0.58502805",
"0.5827647",
"0.58210963",
"0.5810502",
"0.5791562",
"0.5786241",
"0.57534724",
"0.57482797",
"0.5682392",
"0.56683123",
"0.565... | 0.65929073 | 0 |
================================================================================ === Test roles behavior (adding/revoking/transferring). ================================================================================ | async function testRoleBehavior(testNumber, roleName, isRoleMethod, addRoleMethod, addRoleParams, removeRoleMethod) {
result.set(await CpuCoin.methods.isOwner().call({from: owner}));
result.checkIsTrue('Expected original owner to be owner');
result.set(await CpuCoin.methods[isRoleMethod](owner).... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setRole() {}",
"function shouldBehaveLikePublicRole (authorized, otherAuthorized, [other], rolename, manager) {\n rolename = capitalize(rolename);\n\n describe('should behave like public role', function () {\n beforeEach('check preconditions', async function () {\n expect(await this.contract[`is${role... | [
"0.7075765",
"0.69391835",
"0.6424751",
"0.62915456",
"0.6230075",
"0.61697185",
"0.6139872",
"0.61273456",
"0.6108326",
"0.61069983",
"0.6095997",
"0.6050492",
"0.6046664",
"0.5995757",
"0.5986404",
"0.598449",
"0.59601766",
"0.5951045",
"0.59241706",
"0.59157807",
"0.591578... | 0.7230119 | 0 |
(1, 3, ..) have the normal 2 ears. The even bunnies (2, 4, ..) we'll say have 3 ears, because they each have a raised foot. Recursively return the number of "ears" in the bunny line 1, 2, ... n (without loops or multiplication). | function bunnyEars(bunnyNumber) {
if (bunnyNumber <= 1) {
return 2
} else {
if (bunnyNumber % 2 === 0) {
return bunnyEars(bunnyNumber - 1) + 3
} else {
return bunnyEars(bunnyNumber - 1) + 2
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CountAnimals(tur,horse,pigs) {\n return tur*2+horse*4+pigs*4\n}",
"function CountAnimals(tur,horse,pigs) {\r\n\treturn tur*2+(horse+pigs)*4;\r\n}",
"function mystery(n) {\n let r = 0;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j <= n; j++) {\n for (let k = 1; k < j; k++) {\n ... | [
"0.63290626",
"0.63243884",
"0.6228685",
"0.6168914",
"0.6101198",
"0.5908468",
"0.5900963",
"0.5874848",
"0.5816717",
"0.58082795",
"0.5804886",
"0.5700157",
"0.5656495",
"0.5653385",
"0.5649403",
"0.5576442",
"0.5571299",
"0.5570101",
"0.5568525",
"0.55681914",
"0.5545646",... | 0.6808182 | 0 |
LISTENERS Listener responsible for setting the cable size into the view model | function setCableSize()
{
vm.design.cableSize = _orderCableSizeField.value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onChangeSize() {\n\t\t\t\tthis.collection.changeSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis._saveSize(this.model.get('width'), this.model.get('height'));\n\t\t\t\tthis.render();\n\t\t\t}",
"updated () {\n this.dispatchSizeChange()\n }",
"dispatchSizeChange () {\n this.$pare... | [
"0.6834364",
"0.6630434",
"0.6208103",
"0.61491066",
"0.61225504",
"0.6095537",
"0.6064507",
"0.60174793",
"0.5994956",
"0.58870405",
"0.58643514",
"0.5819964",
"0.5802421",
"0.5792798",
"0.57630414",
"0.57557887",
"0.5748812",
"0.57482475",
"0.56978095",
"0.569447",
"0.56944... | 0.7166029 | 0 |
generate linear integer array between "from" to "to" | function generateArray(from, to)
{
var array = [];
for(var i=from, index=0; i<=to; i++,index++) {
array[index] = i;
}
return array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function range (from, to) {\n return Array.from(Array(to), (_, i) => from + i)\n}",
"function range(from) {\n return function(to) {\n var result = [];\n for (var n = from; n < to; n += 1) result.push (n);\n return result;\n };\n }",
"function range(lo: number, hi: number): Array<number> ... | [
"0.8073645",
"0.7699398",
"0.746315",
"0.72530615",
"0.7245765",
"0.72230995",
"0.715638",
"0.71184045",
"0.7111521",
"0.707782",
"0.7048893",
"0.6984612",
"0.69813573",
"0.69783473",
"0.69599426",
"0.6938543",
"0.6936527",
"0.68988615",
"0.6894574",
"0.6894574",
"0.68874276"... | 0.8430876 | 0 |
The server doesn't tell us when key backup is set up, so we poll & cache the result | async _getKeyBackupInfo() {
const now = (new Date()).getTime();
if (!this._keyBackupInfo || this._keyBackupFetchedAt < now - KEY_BACKUP_POLL_INTERVAL) {
this._keyBackupInfo = await MatrixClientPeg.get().getKeyBackupVersion();
this._keyBackupFetchedAt = now;
}
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async checkAndStart() {\n _logger.logger.log(\"Checking key backup status...\");\n\n if (this.baseApis.isGuest()) {\n _logger.logger.log(\"Skipping key backup check since user is guest\");\n\n this.checkedForBackup = true;\n return null;\n }\n\n let backupInfo;\n\n try {\n backup... | [
"0.65267867",
"0.6065545",
"0.6023727",
"0.5804636",
"0.5632752",
"0.55798924",
"0.55646724",
"0.547726",
"0.5462382",
"0.54465014",
"0.5441699",
"0.5440966",
"0.54101175",
"0.53927404",
"0.5327254",
"0.5323729",
"0.53193414",
"0.52945405",
"0.52758527",
"0.52670085",
"0.5265... | 0.6809271 | 0 |
list recently closed issues (in the past week) see | function recentClosedIssuesReport(orgProject, callback) {
github.get('/repos/' + orgProject + '/issues?filter=all&state=closed&sort=updated&direction=desc&per_page=10&since=' + lastWeek().toISOString(), function(issues) {
var issuesWithoutPullRequests = rejectPullRequests(issues);
printIssues('recently ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getissues () {\n \t\tvar total \t\t\t= 0;\n\t \tvar within24Hours \t= 0;\n\t \tvar within7Days \t= 0;\n\t \tvar above7Days \t\t= 0;\n\t \tvar issueInfo \t\t= [];\n\t \tvar result\t\t\t= [];\n\t \tvar i=1;\n\t \twhile(1){\n\t \t\tresult = await repo.issuesAsync({\n\t \t\t\tpage: i,\n \t\t\... | [
"0.69957525",
"0.6840984",
"0.59953797",
"0.59837097",
"0.59402984",
"0.58427155",
"0.5777911",
"0.57155097",
"0.5698897",
"0.5685398",
"0.5670634",
"0.5655221",
"0.5615968",
"0.55938935",
"0.55687356",
"0.5532686",
"0.551261",
"0.547493",
"0.54522187",
"0.5430221",
"0.542561... | 0.73516214 | 0 |
Load serialized refract elements into Javascript objects. | load(elements) {
return this.minim.fromRefract(elements);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get serializedObject() {}",
"function deserialize (elements, data, clearForm) {\n var splits = decodeURIComponent(data).split('&'),\n $controls = get$controls(elements),\n i = 0,\n split = null,\n key = null,\n value = null,\n splitParts... | [
"0.5554846",
"0.54509825",
"0.53392637",
"0.53148544",
"0.527315",
"0.5271201",
"0.5239885",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
"0.5114441",
... | 0.57362074 | 0 |
initialize state for drafts | initDrafts() {
this.drafts = {};
// restore data from localStorage
const contents = window.localStorage.drafts;
if (contents != null) {
try {
this.drafts = JSON.parse(contents);
}
catch (e) {
window.localStorage.removeItem('drafts');
}
}
if (this.state.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init () {\n const { activePack, activeRole, messagesById } = this.props;\n try {\n const resourceId = (activePack && activePack.id) ||\n (activeRole && activeRole.id);\n const isSend = messagesById(resourceId)[0]\n .buttons[0]\n .payload\n .startsWith('/request');\n ... | [
"0.6429299",
"0.63463634",
"0.6131081",
"0.6078038",
"0.6074787",
"0.60570264",
"0.59956145",
"0.5952875",
"0.59486014",
"0.59424883",
"0.59314764",
"0.59304285",
"0.5923193",
"0.59226525",
"0.5918281",
"0.58914053",
"0.58898544",
"0.5873618",
"0.5849772",
"0.58469087",
"0.58... | 0.7139305 | 0 |
End this function implements showing different features based on a timer | function showFeatures() {
featureContainer.innerText = feature[i];
featureInfoContainer.innerText = featureInfo[i];
if (++i < feature.length) {
setTimeout(showFeatures, 5000);
}else if(i == 4) {
i = 0;
if(i == 0) {
showFeatures();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function myTimer()\n {\n var d = new Date();\n var n = d.getSeconds();\n if (n % 2 === 0) {\n showMapLayer(keyLayer);\n } else {\n hideMapLayer(keyLay... | [
"0.6582428",
"0.64378536",
"0.6431494",
"0.635793",
"0.635793",
"0.635793",
"0.6270963",
"0.6254275",
"0.62279063",
"0.61697966",
"0.61539614",
"0.613668",
"0.6132598",
"0.6131837",
"0.61142355",
"0.60814273",
"0.6061258",
"0.6055839",
"0.6053391",
"0.6053391",
"0.6053391",
... | 0.6802626 | 0 |
! ======== moduleInstances ======== returns PIN instances | function moduleInstances(inst)
{
let pinInstances = new Array();
if (inst.dataDirection != "ReceiveOnly") {
pinInstances.push(
{
name: "txPinInstance",
displayName: "UART Tx PIN Configuration While Pin is Not In Use",
moduleName: "/ti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moduleInstances(inst)\r\n{\r\n let pinInstances = new Array();\r\n\r\n switch (inst.pinType) {\r\n case \"None\":\r\n case \"ADCBuf\":\r\n break;\r\n case \"PWM\": {\r\n pinInstances.push(\r\n {\r\n name: \"pwmPinInstance\"... | [
"0.7917595",
"0.7501244",
"0.68299735",
"0.6564518",
"0.64721656",
"0.6271901",
"0.6122524",
"0.5679369",
"0.5641095",
"0.56116325",
"0.55746216",
"0.5370529",
"0.5326664",
"0.52433807",
"0.5204652",
"0.5193221",
"0.5193221",
"0.5193221",
"0.5170876",
"0.5170876",
"0.5170876"... | 0.7669591 | 1 |
! ======== extend ======== Extends a base exports object to include any device specifics This function is invoked by the generic UART module to allow us to augment/override as needed for the CC262X | function extend(base)
{
/* save base properies/methods, to use in our methods */
$super = base;
/* concatenate device-specific configs */
devSpecific.config = base.config.concat(devSpecific.config);
/* merge and overwrite base module attributes */
return (Object.assign({}, base, devSp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extend(base)\r\n{\r\n /* save base properies/methods, to use in our methods */\r\n $super = base;\r\n\r\n /* concatenate device-specific configs */\r\n devSpecific.config = base.config.concat(\r\n Common.newIntPri()).concat(devSpecific.config);\r\n\r\n /* merge and overwrite base mod... | [
"0.6405537",
"0.61636585",
"0.56936723",
"0.5263084",
"0.5183204",
"0.5144808",
"0.50990653",
"0.5092985",
"0.5059587",
"0.50589615",
"0.50589615",
"0.49330524",
"0.48923084",
"0.4879141",
"0.48343572",
"0.47771898",
"0.47452334",
"0.47353423",
"0.47272533",
"0.4709777",
"0.4... | 0.62349254 | 1 |
ADD TO main_windows LIST | function add_to_main_windows_list(window_id)
{
var temp_main_windows_list = get_main_windows_list();
var index = temp_main_windows_list.indexOf(window_id);
if (index < 0)
{
//this windows is not in the list currently
temp_main_windows_list.push(window_id);
}
localStorage.main_windows = temp_main_w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static addWindow(window) {\n window.setPosition(32 * (this._windows.length + 1), 32 * (this._windows.length + 1));\n window.setIndex(this.startIndex + this._windows.length);\n this._windows.push(window);\n window.show();\n }",
"function createNewFile() {\n winList.push(createWindo... | [
"0.6906541",
"0.67278105",
"0.6661764",
"0.66042954",
"0.6476415",
"0.64367485",
"0.6305858",
"0.6275763",
"0.62665355",
"0.6264729",
"0.62425685",
"0.61800134",
"0.61765593",
"0.61639965",
"0.6163887",
"0.6160281",
"0.61456704",
"0.61236465",
"0.6112322",
"0.6109656",
"0.610... | 0.7436428 | 0 |
REMOVE WINDOWS FROM THE main_windows LIST | function remove_from_main_windows_list(window_id)
{
var temp_main_windows_list = [];
if (localStorage.main_windows)
{
temp_main_windows_list = (localStorage.main_windows).split(",");
}
var index = temp_main_windows_list.indexOf(window_id);
if (index > -1) {
temp_main_windows_list.splice(index, 1);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static removeWindow(window) {\n let index = this._windows.indexOf(window);\n this._windows.splice(index, 1)[0].dispose();\n while (index < this._windows.length) {\n this._windows[index].setIndex(this.startIndex + index);\n index++;\n }\n }",
"function remove_f... | [
"0.70117044",
"0.6720704",
"0.65317035",
"0.64790744",
"0.6295255",
"0.6276301",
"0.6249168",
"0.6208899",
"0.6130544",
"0.61009896",
"0.60345393",
"0.59186316",
"0.5887941",
"0.5818442",
"0.5790322",
"0.5781066",
"0.5736475",
"0.5697499",
"0.5691616",
"0.567367",
"0.5654688"... | 0.7361325 | 0 |
REMOVE FROM actived_windows LIST | function remove_from_active_windows(window_id)
{
var temp_active_windows_list = get_active_windows_list();
var index = temp_active_windows_list.indexOf(window_id);
if (index > -1) {
temp_active_windows_list.splice(index, 1);
}
localStorage.actived_windows = temp_active_windows_list.join(",");
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_from_main_windows_list(window_id)\n{\n var temp_main_windows_list = [];\n if (localStorage.main_windows)\n {\n temp_main_windows_list = (localStorage.main_windows).split(\",\");\n }\n\n var index = temp_main_windows_list.indexOf(window_id);\n if (index > -1) {\n temp_main_windows_list.s... | [
"0.7223724",
"0.7193021",
"0.7118076",
"0.6802333",
"0.6351618",
"0.6325922",
"0.62705207",
"0.62637866",
"0.6202732",
"0.62004",
"0.61477387",
"0.6069765",
"0.6065565",
"0.6063067",
"0.6038561",
"0.59843916",
"0.59792036",
"0.59297913",
"0.59231853",
"0.59090376",
"0.5896093... | 0.7648657 | 0 |
ADD TO actived_windows LIST | function add_to_active_windows(window_id)
{
var temp_active_windows_list = get_active_windows_list();
var index = temp_active_windows_list.indexOf(window_id);
if (index < 0)
{
//this windows is not in active list currently
temp_active_windows_list.push(window_id);
}
localStorage.actived_windows =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_to_main_windows_list(window_id)\n{\n var temp_main_windows_list = get_main_windows_list();\n var index = temp_main_windows_list.indexOf(window_id);\n\n if (index < 0)\n {\n //this windows is not in the list currently\n temp_main_windows_list.push(window_id);\n }\n\n localStorage.main_windo... | [
"0.6978766",
"0.6702381",
"0.64045113",
"0.6379627",
"0.6259618",
"0.624009",
"0.5934907",
"0.5847054",
"0.583455",
"0.5829213",
"0.57926404",
"0.57822275",
"0.57815707",
"0.5768493",
"0.5737852",
"0.5732572",
"0.57142586",
"0.57039815",
"0.56935513",
"0.5688333",
"0.567899",... | 0.74698395 | 0 |
MANAGE CRASH If the last update didn't happened recently (more than time_period2) we will clear saved localStorage's data and reload the page | function manage_crash()
{
if (localStorage.last_update)
{
if (parseInt(localStorage.last_update) + (time_period * 2) < Date.now())
{
//seems a crash came! who knows!?
//localStorage.clear();
localStorage.removeItem('main_windows');
localStorage.removeItem('actived_windows');
lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function effacer_local_storage() {\n\tlocalStorage.clear();\n\tdocument.getElementById('id_msg_localstorageeffacer').innerHTML=\"Toutes les observations ont été effacées de votre appareil.\";\n}",
"function clearHistory() {\n var today = moment().format('DD');\n var yesterday = localStorage.getItem... | [
"0.65651923",
"0.6533029",
"0.6502114",
"0.6495178",
"0.6411284",
"0.63996214",
"0.627389",
"0.6250571",
"0.62355393",
"0.62329775",
"0.618896",
"0.6141226",
"0.61401623",
"0.6137733",
"0.6123369",
"0.6116879",
"0.610513",
"0.61042273",
"0.6056217",
"0.60532874",
"0.60476965"... | 0.7990048 | 0 |
CHECK CURRENT WINDOW STATUS | function check_current_window_status(test)
{
manage_crash();
if (PV_API)
{
var active_status = "Inactive";
var windows_list = get_main_windows_list();
var active_windows_list = get_active_windows_list();
if (windows_list.indexOf(localStorage.active_window) < 0)
{
//last actived window... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkStatus() {\n checkWin();\n checkLose();\n }",
"checkSessionStatus () {\n if (MatlabEditor.sessionStatus === null) {\n MatlabEditor.forceCheckSessionStatus()\n }\n\n return MatlabEditor.sessionStatus\n }",
"function checkWindowActive() {\n if (\"hidden\... | [
"0.7395715",
"0.66952527",
"0.65900236",
"0.64191294",
"0.63895077",
"0.6385721",
"0.63766176",
"0.6354666",
"0.6353934",
"0.63063616",
"0.6305878",
"0.62966645",
"0.6265973",
"0.6265973",
"0.62362206",
"0.6201297",
"0.6192613",
"0.6169068",
"0.6072217",
"0.6071875",
"0.60583... | 0.7450427 | 0 |
Mounting the star component | componentDidMount(){
console.log("inside ComponentDIdMOunt2");
this.getStar();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentWillMount() {\n this.setupStars(this.props);\n }",
"function Star() {\n Gem.call(this, Gem.TYPE_STAR);\n}",
"async componentDidMount() {\n this.getStarred();\n }",
"function Stars(props) {\n\n\t// Declare vars\n\tlet stars = [];\n\tlet fullCounter = 0;\n\tlet halfCounter = 0;\n\n\t// Separ... | [
"0.6798533",
"0.6229927",
"0.61847484",
"0.614865",
"0.6145095",
"0.6082608",
"0.60199714",
"0.59896594",
"0.5941313",
"0.5933303",
"0.59221077",
"0.5912242",
"0.59005666",
"0.58822805",
"0.5851661",
"0.5851128",
"0.58390814",
"0.581619",
"0.58087975",
"0.57976484",
"0.577722... | 0.6596349 | 1 |
This class defines a complete listener for a parse tree produced by helloParser. | function helloListener() {
antlr4.tree.ParseTreeListener.call(this);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sectealListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}",
"function ErlangListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}",
"function XMLParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}",
"function RListener()... | [
"0.6498913",
"0.6310594",
"0.6256308",
"0.6117427",
"0.61164415",
"0.60349613",
"0.601305",
"0.5977955",
"0.5977955",
"0.58929557",
"0.58838725",
"0.5758363",
"0.57467496",
"0.5745235",
"0.57378685",
"0.57207334",
"0.5703826",
"0.5679324",
"0.5665178",
"0.5590832",
"0.5568583... | 0.77068007 | 0 |
Gets the current page context that we're using. | get pageContext () {
return (this.currentContext && this.currentContext.page) || this.page
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get() { return currentContext; }",
"function getPageContext() {\n // Make sure to create a new context for every server-side request so that data\n // isn't shared between connections (which would be bad).\n\n if (!process.browser) {\n return createPageContext();\n }\n\n // Reuse context on the cl... | [
"0.7701269",
"0.72044057",
"0.72044057",
"0.7037696",
"0.6950455",
"0.6950455",
"0.6950455",
"0.6882033",
"0.6882033",
"0.6882033",
"0.682725",
"0.65053463",
"0.63795817",
"0.63795817",
"0.6355245",
"0.6355245",
"0.6296832",
"0.6206866",
"0.6180379",
"0.6123627",
"0.6123627",... | 0.80534273 | 0 |
Waits for the page title to match a given state. | async waitForPageTitle (expected) {
debug('waitForPageTitle')
var waitFor = this.wait.bind(this)
var pageTitle = this.pageTitle.bind(this)
return new Promise(async resolve => {
var result = await waitFor(async () => {
var title = await pageTitle()
if (expected instanceof RegExp) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getTitlePage() {\n const pageTitle = await this.page.title();\n console.log('\\t HomePage Title =', pageTitle);\n assert.strictEqual(pageTitle, \"Home loan borrowing power calculator | ANZ\");\n console.log('\\t Home Page title validation successful \\t \\n \\t Browser is open \\t');\n }",
"up... | [
"0.60974735",
"0.5953286",
"0.5866275",
"0.58126664",
"0.5676689",
"0.5641954",
"0.5542051",
"0.5534815",
"0.5517353",
"0.54108125",
"0.5407852",
"0.53823537",
"0.5381862",
"0.5328841",
"0.5321762",
"0.5312777",
"0.5291532",
"0.52829057",
"0.522675",
"0.5224467",
"0.5224467",... | 0.70848423 | 0 |
Resizes the page to a desired width and height. | async resize (width, height) {
debug('resizing to', width, height)
this.pageContext.set('viewportSize', {width, height})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize(width, height) {\n var ratio = config.width/config.height;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n if (width / height >= ratio) {\n w = height * ratio;\n x = (width - w)/2;\n h = height;\n } else {\n w = width;\n h = width / ratio;\n y = (height - h)/2;\n }\n... | [
"0.66251177",
"0.66251177",
"0.66171414",
"0.6455627",
"0.6360668",
"0.62927675",
"0.62512326",
"0.62284154",
"0.6226105",
"0.6222441",
"0.62088305",
"0.62065643",
"0.6201167",
"0.61872506",
"0.61862844",
"0.6172158",
"0.6164775",
"0.6164046",
"0.61317945",
"0.6121351",
"0.60... | 0.7391791 | 0 |
Waits for an element to exist in the page. | async waitForElement (selector) {
debug('waitForElement', selector)
// Scoping gets broken within async promises, so bind these locally.
var waitFor = this.wait.bind(this)
var findElement = this.findElement.bind(this)
return new Promise(async resolve => {
var element = await waitFor(async () =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async elementIsPresent(selector) {\n await selector.waitForExist();\n await selector.waitForDisplayed();\n const isPresent = await selector.isExisting();\n return await browser.waitUntil(async function () {\n return isPresent;\n }, this.timeout);\n }",
"function waitForElement(elementPath, c... | [
"0.7376577",
"0.69851696",
"0.68460655",
"0.6768232",
"0.67567515",
"0.6709671",
"0.66557807",
"0.66288835",
"0.6570584",
"0.6544086",
"0.65057176",
"0.64313996",
"0.6426147",
"0.641153",
"0.6351654",
"0.63230085",
"0.6317715",
"0.6316466",
"0.62494034",
"0.6187767",
"0.61373... | 0.7025991 | 1 |
Waits for an element to be hidden, or removed from the dom. | async waitForElementNotVisible (selector) {
debug('waitForElementNotVisible', selector)
var waitFor = this.wait.bind(this)
var findElement = this.findElement.bind(this)
return new Promise(async resolve => {
var isHidden = await waitFor(async () => {
var el = await findElement(selector)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wait(element, a, className) {\n setTimeout(() => {\n switch (a) {\n case \"add\":\n return AddRemoveClass(element, \"add\", className);\n break;\n case \"remove\":\n return AddRemoveClass(element, \"remove\", className);\n break;\n case \"vO... | [
"0.68312395",
"0.66598105",
"0.6247354",
"0.6176008",
"0.6061072",
"0.6046392",
"0.6037947",
"0.6021586",
"0.5963158",
"0.5917278",
"0.5915698",
"0.58687395",
"0.5863781",
"0.58550656",
"0.58409363",
"0.58247244",
"0.5821937",
"0.58211243",
"0.58211243",
"0.5810906",
"0.58096... | 0.7278034 | 0 |
Waits for an element to exist, and be visible. | async waitForElementVisible (selector) {
debug('waitForElementVisible', selector)
var waitFor = this.wait.bind(this)
var findElement = this.findElement.bind(this)
return new Promise(async resolve => {
var visibleEl = await waitFor(async () => {
var el = await findElement(selector)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function waitForDisplayed(selector) {\n Reporter_1.Reporter.debug(`Wait for an element to be visible '${selector}'`);\n isExist(selector);\n tryBlock(() => $(selector).waitForDisplayed(DEFAULT_TIME_OUT), `Element not visible '${selector}'`);\n }",
"function isVisible(selector) {\n ... | [
"0.7592516",
"0.75513786",
"0.7320563",
"0.7285848",
"0.70863765",
"0.6976132",
"0.697018",
"0.69347245",
"0.6751063",
"0.6674769",
"0.666487",
"0.6625",
"0.65970457",
"0.65662503",
"0.65445983",
"0.6494572",
"0.6473789",
"0.64186686",
"0.6398961",
"0.6376361",
"0.6351681",
... | 0.7951893 | 0 |
Waits for a child page to be loaded. | waitForPage (url) {
debug('waitForPage', url)
var waitFor = this.wait.bind(this)
var childPages = this.childPages
return new Promise(async resolve => {
var page = await waitFor(async () => {
return childPages.filter((val) => {
return val.url.includes(url)
})
})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_waitForParent(callback) {\n\t if (!this._mustWaitForParent ||\n\t this.parent === null ||\n\t !this.parent.loading) {\n\t callback();\n\t return;\n\t }\n\t // Wait for parent\n\t this.parent.onLoad = callback;\n\t }",
"function pagePrelo... | [
"0.65516055",
"0.6235817",
"0.6219093",
"0.6189505",
"0.6163713",
"0.60864115",
"0.6082393",
"0.6008764",
"0.5977478",
"0.59076756",
"0.5837436",
"0.58346266",
"0.58022124",
"0.5779403",
"0.571158",
"0.5693914",
"0.5692215",
"0.56757885",
"0.5658827",
"0.5651048",
"0.56447077... | 0.7077801 | 0 |
get mouse x coordinate | function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX) {
return evt.clientX + (document.documentElement.scrollLeft ?
document.documentElement.scrollLeft :
document.body.scrollLeft);
}
else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function $getMouseX(e) {\r\n\t\tvar scrollX = $getScrollX();\r\n\t\tif (e.pageX) return e.pageX + scrollX;\r\n\t\tif (e.clientX) return e.clientX + scrollX;\r\n\t\treturn 0;\r\n\t}",
"get_global_mouse_x(mouse_event) {\n const scale = this.get_empirical_scale();\n const annbox = jquery_default()(\"#... | [
"0.79967755",
"0.78583664",
"0.77842593",
"0.77012104",
"0.7612257",
"0.75924236",
"0.7496519",
"0.74170196",
"0.73720926",
"0.7353065",
"0.73480827",
"0.7340595",
"0.7340005",
"0.7339915",
"0.7302481",
"0.7293253",
"0.727331",
"0.72476184",
"0.7245745",
"0.7205906",
"0.72038... | 0.7986222 | 1 |
get horizontal box placement | function horizontalPlacement() {
placeX = v_xcoordinate + v_xoffset;
return placeX;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getpositions(box) {\n var _box = $(box);\n var muro = _box.position();\n var width = _box.width();\n var height = _box.height();\n return [ [ muro.left, muro.left + width ], [ muro.top, muro.top + height ] ];\n}",
"function box_position($box) {\n\t\tvar row_col = function(position) {\n\t\t\tvar row... | [
"0.62913555",
"0.6255792",
"0.6198178",
"0.6097309",
"0.6040691",
"0.60270965",
"0.5998257",
"0.5992759",
"0.59659314",
"0.59350836",
"0.5926706",
"0.58937144",
"0.5891674",
"0.5877108",
"0.58371794",
"0.5830208",
"0.5830208",
"0.5826854",
"0.58070225",
"0.57697636",
"0.57512... | 0.7479044 | 0 |
get vertical box placement | function verticalPlacement() {
return v_ycoordinate + v_yoffset;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function box_position($box) {\n\t\tvar row_col = function(position) {\n\t\t\tvar row, col;\n\t\t\tif ((position >= 1) && (position <= 3)) {\n\t\t\t\tbox_row = 1;\n\t\t\t\tbox_col = position;\n\t\t\t} else if ((position >= 4)&&(position <= 6)) {\n\t\t\t\tbox_row = 2;\n\t\t\t\tbox_col = position - 3;\n\t\t\t} else i... | [
"0.64736366",
"0.6293785",
"0.629248",
"0.6265693",
"0.6265693",
"0.6241139",
"0.6198311",
"0.61977434",
"0.61840075",
"0.61621374",
"0.612839",
"0.6093938",
"0.60602754",
"0.5938779",
"0.59289217",
"0.5920314",
"0.5909264",
"0.58997226",
"0.5879891",
"0.58663684",
"0.5859572... | 0.78415674 | 0 |
If the offer you sent changes | function sentOfferChanged(offer) {
connection.query("UPDATE offers SET state = '" + offer.state + "' WHERE tradeofferid = '" + offer.id + "'");
switch (offer.data('type')) {
case "deposit": //Deposit Trade
if(offer.state == 3) //Acceppted
{
var prices = JSON.parse(fs.readFileSync('html/api/prices.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function confirmChanges() {\r\n return isChanged;\r\n}",
"@api hasChanges() {\n console.log('[hasChanges]');\n\n connection.trigger('setActivityDirtyState', true);\n }",
"isChange() {\n return this.state.status !== this.props.invite.status;\n }",
"function confirmChanges() {\r\n re... | [
"0.65649956",
"0.6392869",
"0.62547123",
"0.62009627",
"0.60413843",
"0.59952927",
"0.5944175",
"0.5938628",
"0.5889441",
"0.58883035",
"0.58674854",
"0.58629966",
"0.5814249",
"0.5807173",
"0.5805562",
"0.578352",
"0.57801986",
"0.57769626",
"0.57688355",
"0.57369006",
"0.56... | 0.6680143 | 0 |
Ao selecionar um estado no combo de estados. | function aoSelecionarEstado(item, model) {
controller.filtro.cidade = undefined;
if (item) {
cidadeService.findAllByEstado(item.id).success(function(cidades) {
controller.cidades = cidades;
newOption = {
id : "",
nome : "Todas"
};
controller.cidades.unshift(newOption);
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectModel(){\n var estado=$(this).attr('data-estado');\n var id=$(this).attr('data-id');\n if(estado=='inactivo'){\n homeFunctions.modelosSeleccionados.push(id);\n $(this).attr('data-estado','activo');\n }else{\n homeFunctions.modelosSeleccionados.spli... | [
"0.6205863",
"0.6049819",
"0.60109437",
"0.59958947",
"0.59900683",
"0.5970348",
"0.5965316",
"0.5961663",
"0.5904184",
"0.5878214",
"0.587109",
"0.58402133",
"0.58324116",
"0.58023936",
"0.5793787",
"0.5793787",
"0.5774523",
"0.5769381",
"0.57659113",
"0.5759511",
"0.5721735... | 0.62865144 | 0 |
This function iterates over the pixels that (probably) get drawn / on when rasterizing the line and calls the provided visitor with / the pixels' coordinates as arguments (once per pixel). / It is totally ok if this function overapproximates the pixels / since clients are expected to check for the actual distance of / ... | visitLinePixels(visitor, line) {
const vec = { dx: line.x1 - line.x0, dy: line.y1 - line.y0 }
// If line is a point we're lazy (and eliminate some special cases)
if (vec.dx === 0 && vec.dy === 0) {
const x = Math.floor(line.x0);
const y = Math.floor(line.y0);
const idx = x + this.width * y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"paintTile(pixels, index) {\n const tileXOffset = index % TILES_PER_LINE;\n const tileYOffset = Math.floor(index / TILES_PER_LINE);\n\n const pixelXOffset = TILE_PIXEL_WIDTH * tileXOffset;\n const pixelYOffset = TILE_PIXEL_HEIGHT * tileYOffset;\n\n // pixels along the tile's x axis\n for (let x = ... | [
"0.6037921",
"0.5819778",
"0.58041257",
"0.5717442",
"0.5609363",
"0.556133",
"0.55311126",
"0.5491213",
"0.5489987",
"0.5450112",
"0.5448814",
"0.5428318",
"0.53756785",
"0.5373171",
"0.5319504",
"0.53133297",
"0.5307949",
"0.5305462",
"0.52859163",
"0.5250375",
"0.52078915"... | 0.6900496 | 0 |
The fold applies the correct operation to the future's value, if the future has been resolved. Or we run the operation instead. For optimisation purposes, we cache the result of the operation, so if we started an operation before, we mark it as started and push any subsequent forks into a pending queue that will be inv... | function fold(g, h) {
return resolved? h(value)
: rejected? g(value)
: started? addToPendingOperations(g, h)
: /* otherwise */ resolveFuture(g, h)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function foldOp(fn, args, makeNode, options) {\n return args.reduce(function (a, b) {\n if (!(0, _is.isNode)(a) && !(0, _is.isNode)(b)) {\n try {\n return _eval(fn, [a, b], options);\n } catch (ignoreandcontinue) {}\n\n a = _toNode(a);\n b = _toNode(b);\n } else if... | [
"0.55321074",
"0.54794997",
"0.5416365",
"0.5335265",
"0.52300113",
"0.51125175",
"0.5092901",
"0.50841457",
"0.50841457",
"0.50411224",
"0.50060695",
"0.4998494",
"0.49895647",
"0.49895647",
"0.49895647",
"0.49895647",
"0.49895647",
"0.49895647",
"0.49895647",
"0.49657276",
... | 0.68155277 | 0 |
Resolves the future, and memorises its value and resolution strategy | function resolveFuture(g, h) {
started = true
return f( function(a) { rejected = true
value = a
invokePending('rejected', a)
return g(a) }
, function(b) { resolved = true
value = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static resolve(f) { return new StatefulPromise(Promise.resolve(f)) }",
"function promiseResolve(val) {\n\t\t\treturn _resolve(val);\n\t\t}",
"function promiseResolve(val) {\n\t\t\treturn _resolve(val);\n\t\t}",
"static resolve(value) {\n return new Promise(resolve => { resolve(value) });\n }",
"resolve... | [
"0.68263596",
"0.6780801",
"0.6780801",
"0.66175336",
"0.6471275",
"0.6444176",
"0.64370275",
"0.6385537",
"0.6357569",
"0.63532215",
"0.6309605",
"0.6277867",
"0.62775785",
"0.6269873",
"0.6248429",
"0.6248429",
"0.624055",
"0.62321335",
"0.62184846",
"0.620134",
"0.6180154"... | 0.6781521 | 1 |
Takes list of paths and updates the internal state as well as DOM. | updateForPaths(paths) {
if (!paths) return;
let selected = null;
let remaining = [];
for (const projectElement of this.projects) {
if (projectElement.isChecked()) {
selected = projectElement.path;
}
projectElement.markUnchecked();
if (projectElement.path in paths) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static updateDOM()\n {\n //clear dom\n let rootDOM = document.getElementById(\"file-system\");\n while (rootDOM.firstChild) {\n rootDOM.removeChild(rootDOM.firstChild);\n }\n\n //set directory text\n let dirTextDom = document.getElementById(\"file-system-dir-val\");\n dirTextDom.textCont... | [
"0.61441994",
"0.5854031",
"0.58471805",
"0.5793559",
"0.5788243",
"0.57676685",
"0.5734351",
"0.57100177",
"0.5657486",
"0.5641595",
"0.5640606",
"0.5627781",
"0.5621995",
"0.5615287",
"0.5567662",
"0.5564193",
"0.5556164",
"0.5546532",
"0.5533594",
"0.5513738",
"0.551192",
... | 0.69906604 | 0 |
Create callbacks list on unique hash | function setupCallbacks(callbacks) {
return _.reduce(callbacks, function(memo, val){
memo[val] = $.Callbacks();
return memo;
}, {});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CallbackArray(){\n this.callbacks = new SortedArray(\n function(a,b){\n if (a.uid < b.uid) {return -1;};\n if (a.uid > b.uid) {return 1;};\n if (a.counter < b.counter){ return -1;};\n if (a.counter > b.counter){ return 1;};\n return 0;\n ... | [
"0.5793232",
"0.563692",
"0.563692",
"0.56362575",
"0.56119835",
"0.55944586",
"0.55943525",
"0.5573077",
"0.55585974",
"0.551948",
"0.5487136",
"0.5487136",
"0.5487136",
"0.5485746",
"0.54789114",
"0.5405905",
"0.5380554",
"0.5380554",
"0.5371797",
"0.5371465",
"0.5353043",
... | 0.5642337 | 1 |
CONCERNS FUNCTION IMPLEMENTATIONS / This function loads the 5 most recent concerns addressed to the user. | function retrieveRecentConcerns()
{
var location = window.location.href;
var url = (location.substr(location.length - 1) === "/") ? "retrieve-recent-concerns" : "/retrieve-recent-concerns";
$.ajax({
method : "GET",
url : window.location + url,
success : f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateRecentConcerns()\n {\n var location = window.location.href;\n var url = (location.substr(location.length - 1) === \"/\") ? \"update-recent-concerns\" : \"/update-recent-concerns\";\n\n $.ajax({\n method : \"GET\",\n url : window.location + url,\n ... | [
"0.5967415",
"0.54793346",
"0.5388464",
"0.52859133",
"0.52590764",
"0.51364493",
"0.5092736",
"0.5087135",
"0.49664396",
"0.4953693",
"0.4895385",
"0.48889542",
"0.48721424",
"0.4862523",
"0.48450163",
"0.48372653",
"0.48347366",
"0.48287284",
"0.48232493",
"0.4812274",
"0.4... | 0.6608724 | 0 |
This function updates the recent concerns addressed to the user. | function updateRecentConcerns()
{
var location = window.location.href;
var url = (location.substr(location.length - 1) === "/") ? "update-recent-concerns" : "/update-recent-concerns";
$.ajax({
method : "GET",
url : window.location + url,
success : functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateOmissions () {\n // We don't want anything from the accepted list or the suggestion pool;\n this.omissions = this.suggestionPool.map(el => el.name);\n this.omissions = this.omissions.concat(this.state.accepteds.map(el => el.name));\n }",
"function updateUserPreferences(atts) {\n\t\t... | [
"0.5881229",
"0.52509606",
"0.5186469",
"0.5082687",
"0.50707465",
"0.4994829",
"0.49726805",
"0.49651626",
"0.49616158",
"0.49501204",
"0.49421895",
"0.49109986",
"0.4909755",
"0.49096298",
"0.48907155",
"0.4873546",
"0.48517478",
"0.4850317",
"0.48474124",
"0.48105627",
"0.... | 0.62519413 | 0 |
Load most recent changes | function loadMostRecentChanges()
{
var location = window.location.href;
var url = (location.substr(location.length - 1) === "/") ? "retrieve-recent-changes" : "/retrieve-recent-changes";
$.ajax({
type : "GET",
url : url,
success : function(result)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async poll() {\n let qual = Object.values(this.all).\n filter(follow => !this.updating.includes(follow) && isOutOfDate(follow, this.fetched))\n if (qual.length > 0) {\n let oldest = qual.reduce((old, follow) =>\n (fetchedAt(this.fetched, old.id) || 0) > (fetchedAt(this.fetched, follow.id) ||... | [
"0.644622",
"0.6342709",
"0.61188644",
"0.59999865",
"0.597917",
"0.5976946",
"0.5947654",
"0.58641624",
"0.58640206",
"0.58458525",
"0.5843489",
"0.5843432",
"0.5841777",
"0.58345383",
"0.57905537",
"0.5752059",
"0.57368505",
"0.5732999",
"0.5708413",
"0.5695265",
"0.5684839... | 0.73056465 | 0 |
handle mousedown events iterate through texts[] and see if the user mousedown'ed on one of them If yes, set the selectedText to the index of that text | function handleMouseDown(e) {
e.preventDefault();
startX = parseInt(e.clientX - offsetX);
// console.log(startX);
startY = parseInt(e.clientY - offsetY);
// console.log(startY);
// Put your mousedown stuff here
// for (var i = 0; i < texts.length; i++) {
// if (textHittest(startX, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleMouseDown(e) {\n $(\"#submitTextOnCanvas\").css(\"background\",\"green\");\n $(\"#submitTextOnCanvas\").css(\"color\",\"white\");\n $(\"#hint\").html(\"Then click 'Save'\");\n e.preventDefault();\n text_startX = parseInt(e.clientX - text_canvas.offset().left);\n ... | [
"0.77008283",
"0.66333437",
"0.65052795",
"0.64662814",
"0.6251216",
"0.6165629",
"0.61162907",
"0.611509",
"0.6094136",
"0.6067603",
"0.6055563",
"0.6045656",
"0.6044407",
"0.6042475",
"0.6022609",
"0.59630114",
"0.5961425",
"0.5938343",
"0.59324",
"0.5908986",
"0.5898126",
... | 0.7730222 | 0 |
handle mousemove events calc how far the mouse has been dragged since the last mousemove event and move the selected text by that distance | function handleMouseMove(e) {
if (selectedText < -1) { return; }
e.preventDefault();
mouseX = parseInt(e.clientX - offsetX);
mouseY = parseInt(e.clientY - offsetY);
// Put your mousemove stuff here
var dx = mouseX - startX;
var dy = mouseY - startY;
startX = mouseX;
startY = mouseY... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleMouseMove(e) {\n if (selectedText < 0) {\n return;\n }\n e.preventDefault();\n var mouseX = parseInt(e.clientX - text_canvas.offset().left);\n var mouseY = parseInt(e.clientY - text_canvas.offset().top);\n\n // Put your mousemove stuff here\n ... | [
"0.78774804",
"0.68534327",
"0.68510234",
"0.67832804",
"0.6687581",
"0.66430545",
"0.6562785",
"0.64638495",
"0.6450654",
"0.6447548",
"0.6440653",
"0.6422464",
"0.6327646",
"0.6327646",
"0.6323279",
"0.63052887",
"0.63011837",
"0.629792",
"0.62950206",
"0.62950206",
"0.6283... | 0.79373914 | 0 |
Update the repo in the store with all the account coins | function setGeneralAccounts (repo, accountCoins) {
// For each account find the store coin and set the quantity
for (const accountCoin of accountCoins) {
const repoCoin = repo.coins.find(coin => coin.symbol === accountCoin.symbol)
if (repoCoin) {
repoCoin.quantity = accountCoin.quantity
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async update () {\n await this.updateUnspent()\n await this.updateCoinbase()\n\n this.regularTxns = this.unspent.filter(filterOutRepeats(this.coinbase))\n }",
"update(chain, chainoffset) {\n\t\tthis.coins = [];\n\t\tthis.searchForCoins(chain, chainoffset);\n\t\tthis.countBalance();\n\t\tthis.lastUpdate... | [
"0.6356478",
"0.63039035",
"0.6275233",
"0.61964",
"0.59881365",
"0.595949",
"0.592375",
"0.5842851",
"0.5828044",
"0.5789208",
"0.5707985",
"0.5672546",
"0.5668165",
"0.564795",
"0.5630151",
"0.5614479",
"0.5565572",
"0.5515176",
"0.55109113",
"0.54663736",
"0.54542094",
"... | 0.69767827 | 0 |
for oop count up running a for loop for each number checking if they are divisable by 1 through 20 | function question5() {
var divisible = false;
for (let index = 1; divisible === false; index++) {
if (index % 2 === 0 && index % 3 === 0 && index % 4 === 0 && index % 5 === 0 && index % 6 === 0 && index % 7 === 0 && index % 8 === 0 && index % 9 === 0 && index % 10 === 0 && index % 11 === 0 && index % 12 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function diviserator(num) {\r\n var counter = 0;\r\n for (var i = 1; i < Math.sqrt(num); i++) {\r\n if (num % i === 0) {\r\n counter += 2;\r\n }\r\n }\r\n if (counter > 1000) {\r\n return true;\r\n }\r\n}",
"function findFactors(number) {\n for (var i=2; i<=number;) {\n if (number % ... | [
"0.6770706",
"0.6427484",
"0.64138407",
"0.6404076",
"0.634051",
"0.6335359",
"0.6322292",
"0.6287791",
"0.6270587",
"0.6253374",
"0.6250388",
"0.6241438",
"0.62401843",
"0.6227301",
"0.6218825",
"0.6213101",
"0.6208936",
"0.62035143",
"0.6192244",
"0.6182573",
"0.618222",
... | 0.6777326 | 0 |
TODO emit end TODO emit close a partition is ready for writing | function partitionsReady() {
if(this.produceBuffer.flush()) {
logger.info('drain', this.name)
this.emit('drain')
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _write() {\n if (this._writing) return;\n\n // Loop because items may get pushed onto queue while we're writing\n while (this._queue) {\n let q = this._queue;\n const {resolve, reject} = q;\n delete this._queue;\n this._writing = true;\n try {\n // Slice to most recen... | [
"0.5874734",
"0.5823903",
"0.5770251",
"0.57104975",
"0.55999315",
"0.5552756",
"0.55480206",
"0.55436414",
"0.554323",
"0.55370873",
"0.55370873",
"0.55151856",
"0.5416244",
"0.5407981",
"0.5351479",
"0.5303893",
"0.5273178",
"0.5257433",
"0.5248815",
"0.52387136",
"0.523246... | 0.6378438 | 0 |
Emits a 'data' event for each message of a fetch response. If the stream is paused, the message is added to bufferedMessages, which is flushed when the stream is resumed. payloads: an array of Buffers | function emitMessages(payloads) {
for (var i = 0; i < payloads.length; i++) {
var data = payloads[i]
if (this.encoding) {
data = data.toString(this.encoding)
}
if (this.paused) {
logger.info(
'buffering', this.name,
'length', this.bufferedMessages.length
)
this.bufferedMessages.p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onData(data) {\n\n // Attach or extend receive buffer\n _receiveBuffer = (null === _receiveBuffer) ? data : Buffer.concat([_receiveBuffer, data]);\n\n // Pop all messages until the buffer is exhausted\n while(null !== _receiveBuffer && _receiveBuffer.length > 3) {\n ... | [
"0.5868912",
"0.55907106",
"0.5517464",
"0.5517464",
"0.5495215",
"0.53424835",
"0.5264977",
"0.52348286",
"0.5222723",
"0.5218782",
"0.5218402",
"0.5136501",
"0.51222354",
"0.5119493",
"0.5109919",
"0.51012075",
"0.509028",
"0.5082475",
"0.506425",
"0.506425",
"0.50430095",
... | 0.7043341 | 0 |
SLICE 1 function that updates the coffee counter on page | function updateCoffeeView(coffeeQty) {
// create a variable to store and update the coffee counter
let coffeeCounter = document.getElementById('coffee_counter');
coffeeCounter.innerText = coffeeQty;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nbrCoups(){\n coups++;\n counter.innerHTML =\"Coups : \" + coups;\n }",
"function add1Counter() {\n clicks += 1;\n counter.innerHTML = clicks;\n}",
"function counter() {\n\n}",
"function updateCounter() {\n $('#cart-counter').first().text($('.cart-item').length);\n }",
"func... | [
"0.6836675",
"0.6675218",
"0.65865165",
"0.6577477",
"0.657618",
"0.6558813",
"0.6532966",
"0.6498275",
"0.6497747",
"0.6467959",
"0.64442843",
"0.6370678",
"0.63484335",
"0.63305336",
"0.6328703",
"0.6319796",
"0.6313157",
"0.63104486",
"0.6308082",
"0.63036853",
"0.62977517... | 0.71639305 | 0 |
SLICE 2 changes 'unlocked' to 'true when the player's coffee count is equal or larger than half the initial price of the producer data.producers[0].unlocked = true; | function unlockProducers(producers, coffeeCount) {
producers.forEach(producer => {
if (coffeeCount >= producer.price / 2) {
producer.unlocked = true;
}
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUnlockedProducers(data) {\n // create array - does not mutate the data\n let unlockedProducers = [];\n // filters out producer objects which are not unlocked\n data.producers.forEach(producer => {\n if (producer.unlocked) { // unlocked: true,\n unlockedProducers.push(producer);\n ... | [
"0.51828665",
"0.5073389",
"0.5014611",
"0.4997681",
"0.49703825",
"0.49295005",
"0.48819473",
"0.48790252",
"0.48619664",
"0.48595473",
"0.48207322",
"0.4819335",
"0.47939593",
"0.47836852",
"0.47596443",
"0.47570243",
"0.47489828",
"0.4744486",
"0.47314385",
"0.47244117",
"... | 0.6420313 | 0 |
returns an array of unlocked producer objects | function getUnlockedProducers(data) {
// create array - does not mutate the data
let unlockedProducers = [];
// filters out producer objects which are not unlocked
data.producers.forEach(producer => {
if (producer.unlocked) { // unlocked: true,
unlockedProducers.push(producer);
}
})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get lockers() {\n return Object.assign({}, (this._lockers || {}));\n }",
"function unlockProducers(producers, coffeeCount) {\n producers.forEach(producer => {\n if (coffeeCount >= producer.price / 2) {\n producer.unlocked = true;\n }\n })\n }",
"function renderProducers(data)... | [
"0.60203654",
"0.5495555",
"0.5435096",
"0.539679",
"0.51338786",
"0.508739",
"0.50798357",
"0.50518113",
"0.4977984",
"0.49563822",
"0.49533936",
"0.4928778",
"0.49063832",
"0.49028268",
"0.4898131",
"0.4877379",
"0.4874985",
"0.48222846",
"0.481314",
"0.47805727",
"0.477311... | 0.7451164 | 0 |
The renderProducers function 4) calls document.getElementById() or document.querySelector() 5) appends some producer div elements to the producer container 6) unlocks any locked producers which need to be unlocked 7) only appends unlocked producers 8) deletes the producer container's children before appending new produ... | function renderProducers(data) {
// calls document.getElementById() or document.querySelector()
let container = document.getElementById('producer_container');
// unlocks any locked producers which need to be unlocked
unlockProducers(data.producers, data.coffee);
let unlockedProducers = getUnlockedProducers(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeProducerDiv(producer) {\n const containerDiv = document.createElement('div');\n containerDiv.className = 'producer';\n const displayName = makeDisplayNameFromId(producer.id);\n const currentCost = producer.price;\n const upgrades = producer.upgrades;\n let sellButtonDisplay = 'none'\n if(produc... | [
"0.6605928",
"0.59566176",
"0.59055406",
"0.5863401",
"0.5854642",
"0.5849139",
"0.58446527",
"0.58232045",
"0.5800942",
"0.5665526",
"0.53993297",
"0.53266925",
"0.5250637",
"0.52343947",
"0.51875",
"0.51723546",
"0.5100861",
"0.5094055",
"0.5071395",
"0.5062736",
"0.5062448... | 0.8438963 | 0 |
SLICE 3 returns an object returns the correct producer object (selected by id, e.g. id: 'chemex') | function getProducerById(data, producerId) {
//return {};
// find only returns object that matches ID first
return data.producers.find(producer => producerId === producer.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function putInProducersIds(id, data) {\n var waitMessage = document.getElementById(\"waitTest\");\n if (waitMessage != undefined || waitMessage != null) {\n waitMessage.remove();\n }\n producersIds[id] = {\n data: getDataChart(data)\n }\n\n}",
"function fromDatastore(item){\n ... | [
"0.50820154",
"0.49086285",
"0.48979154",
"0.48954818",
"0.48189843",
"0.48089954",
"0.48086107",
"0.47864264",
"0.4741554",
"0.47270408",
"0.47193214",
"0.4711727",
"0.47114703",
"0.4701761",
"0.4672267",
"0.46610856",
"0.4658003",
"0.46539998",
"0.46411994",
"0.46311074",
"... | 0.6519019 | 0 |
returns true if the player can afford the producer returns false if the player cannot afford the producer | function canAffordProducer(data, producerId) {
let producer = getProducerById(data, producerId);
if (data.coffee >= producer.price) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canAfford(amount){\n if(playerState.gold - amount >= 0)\n {\n return true; \n }\n else\n return false;\n }",
"canBuy() {\n return this.level < this.maxLevel && this.canAfford();\n }",
"canBuy() {\n return this.level < this.maxLeve... | [
"0.6887524",
"0.67773837",
"0.67773837",
"0.66374826",
"0.63868964",
"0.63578135",
"0.62582266",
"0.6253419",
"0.6239655",
"0.62344444",
"0.62270415",
"0.62050784",
"0.62",
"0.62",
"0.61761224",
"0.61253786",
"0.61165637",
"0.60988253",
"0.6095274",
"0.60682464",
"0.60529166"... | 0.6779854 | 1 |
calls document.getElementById() or document.querySelector() updates the total cps indicator to display the current total cps | function updateCPSView(cps) {
let cpsIndicator = document.getElementById('cps');
cpsIndicator.innerText = cps;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayTotal(total) {\n document.querySelector(\"#count-total\").textContent += total / 100;\n}",
"function updateCounter() {\n document.querySelector('#counter').textContent = (points);\n}",
"function populateCounters() {\r\n circulating = minted - burned;\r\n $(\"#minted\").html(thousa... | [
"0.67706424",
"0.67457294",
"0.6727555",
"0.67009807",
"0.66927016",
"0.6687827",
"0.666039",
"0.66266614",
"0.6621281",
"0.6613705",
"0.66132444",
"0.6612279",
"0.6590794",
"0.6575803",
"0.6550345",
"0.6544679",
"0.6519479",
"0.6507771",
"0.6499188",
"0.64797306",
"0.6449616... | 0.71448976 | 0 |
Constructs a new UserOrder. | constructor() {
UserOrder.initialize(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Order() {\r\n\tthis.orderNumber=NextOrder();\r\n\tthis.orderDate=GetDate();\r\n\tthis.customerName=\"\";\r\n\tthis.customer = new Customer();\r\n\tthis.items = new Array();\r\n}",
"function createOrder(order_id, tradingsymbol, transaction_type, quantity, trigger_price, price, target){\n let order = {... | [
"0.64974976",
"0.6455293",
"0.636422",
"0.6305537",
"0.6102577",
"0.59162664",
"0.5800946",
"0.56676924",
"0.5651134",
"0.55993575",
"0.55505806",
"0.5546912",
"0.5489192",
"0.5473906",
"0.54527473",
"0.5421612",
"0.5383066",
"0.534518",
"0.53393734",
"0.5332971",
"0.5308454"... | 0.70496994 | 0 |
expand "more info" tab | function expandInfo() {
if(more.style.display === "block"){
more.style.display = "none";
}
else{
more.style.display = "block";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMoreInfoUrl() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tbookmarks.sethash('#moreinfo', showFooterPopup, localStorage.getItem(\"userMoreInformation\"));\n\treturn false;\n}",
"function expandInfo() {\n if(aboutContent.style.display === \"block\"){\n aboutContent.style.di... | [
"0.67801857",
"0.66760254",
"0.6584026",
"0.6526022",
"0.6525943",
"0.6521328",
"0.64567024",
"0.64089113",
"0.6393408",
"0.6329787",
"0.62594837",
"0.6250721",
"0.62400377",
"0.622915",
"0.6216475",
"0.62143755",
"0.6139312",
"0.6134605",
"0.61069405",
"0.61009586",
"0.61009... | 0.7612159 | 0 |
Update all animation clocks | function updateAllClocks() {
// Loop through clocks
var clockCount = clocks.length;
for (var i = 0; i < clockCount; i++) {
// Update clock
clocks[i].update();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update() {\n this.view.drawArrows(Clock.getCurrentDate());\n // SetTimeout for next iteration if clock is working.\n if (this.isWork) {\n setTimeout(() => {\n this.update.apply(this);\n }, 50);\n }\n }",
"function update() {\n clock += change();\n render();\n }",
... | [
"0.71432275",
"0.68653274",
"0.6838407",
"0.6766906",
"0.66181314",
"0.65979904",
"0.65851134",
"0.6526222",
"0.65231174",
"0.64931923",
"0.6492548",
"0.6482599",
"0.6477786",
"0.64647055",
"0.64513475",
"0.64487356",
"0.6437742",
"0.6434705",
"0.6408321",
"0.6407518",
"0.640... | 0.7511356 | 0 |
Returns a position along a cubic Bezier curve | function bezier(u, p0, p1, p2, p3) {
return Math.pow(u, 3) * (p3 + 3 * (p1 - p2) - p0)
+ 3 * Math.pow(u, 2) * (p0 - 2 * p1 + p2)
+ 3 * u * (p1 - p0) + p0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wingPositionFunction(t)\n{\n var height = .25;\n\n var p0 = new THREE.Vector3(0,0,0);\n var p1 = new THREE.Vector3(0,0,1);\n\n var p2 = new THREE.Vector3(0,0,1);\n var p3 = new THREE.Vector3(1,0,1);\n\n var curve = new THREE.CubicBezierCurve3(p0, p1, p2, p3);\n\n return curve.getPoint... | [
"0.71950936",
"0.697803",
"0.6894344",
"0.68725795",
"0.6865777",
"0.6803314",
"0.67898726",
"0.6729984",
"0.66061604",
"0.65902054",
"0.6569337",
"0.6561545",
"0.6561134",
"0.6539076",
"0.65342355",
"0.65053236",
"0.65053236",
"0.65053236",
"0.65053236",
"0.65053236",
"0.650... | 0.70122004 | 1 |
uint16 Returns true iff the flags have the IGNORE bit set. | function isIgnore(flags) {
return (flags & FLAGS.IGNORE) === FLAGS.IGNORE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"assure16Bit_() {\n this.assureUncompressed_();\n if (this.bitDepth != '16') {\n this.toBitDepth('16');\n }\n }",
"assure16Bit_() {\r\n this.assureUncompressed_();\r\n if (this.bitDepth != '16') {\r\n this.toBitDepth('16');\r\n }\r\n }",
"isHidden() {\n return (this.flags & ... | [
"0.56152105",
"0.56127805",
"0.5088048",
"0.5057154",
"0.49046424",
"0.4887768",
"0.4882455",
"0.48463044",
"0.47558427",
"0.47525397",
"0.47422063",
"0.47397557",
"0.47313398",
"0.4653973",
"0.46511492",
"0.4586959",
"0.458093",
"0.4578936",
"0.45768705",
"0.45676413",
"0.45... | 0.57277626 | 0 |
Returns true iff the flags have the METADATA bit set. | function isMetadata(flags) {
return (flags & FLAGS.METADATA) === FLAGS.METADATA;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get isMetaMask() {\n return this._overrideIsMetaMask;\n }",
"hasMeta () {\r\n return (this.meta != null && !Object.keys(this.meta).length > 0)\r\n }",
"function atomHasContent(atom) {\n if (!atom)\n return false;\n if (atom.attributes.length > 0)\n return t... | [
"0.6018508",
"0.5906545",
"0.59055656",
"0.5808282",
"0.5616235",
"0.54701275",
"0.54601574",
"0.5450677",
"0.5450677",
"0.5450677",
"0.5450677",
"0.5450677",
"0.5450677",
"0.5450677",
"0.54480493",
"0.5447566",
"0.54445773",
"0.543665",
"0.543665",
"0.543665",
"0.5433461",
... | 0.79597664 | 0 |
Returns true iff the flags have the COMPLETE bit set. | function isComplete(flags) {
return (flags & FLAGS.COMPLETE) === FLAGS.COMPLETE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ === this.univComplete) &&\n (this.coAuthor === this.coAuthorComplete)\n }",
"get is_complete() {\n return !!(this.flags & PaintVolumeFlags.IS_CO... | [
"0.67198396",
"0.6354281",
"0.6340552",
"0.6340552",
"0.6340552",
"0.6054409",
"0.59302264",
"0.587029",
"0.587029",
"0.58562225",
"0.58562225",
"0.5838131",
"0.5823202",
"0.5697258",
"0.56972",
"0.55937755",
"0.55825955",
"0.55713415",
"0.55538315",
"0.55385303",
"0.5500766"... | 0.8194418 | 0 |
Returns true iff the flags have the NEXT bit set. | function isNext(flags) {
return (flags & FLAGS.NEXT) === FLAGS.NEXT;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasNext() {\n if (this.first) return true;\n return (!this.curr || this.curr.next == null) ? false : true;\n }",
"isNextBitSet(){\n return this.data[this.index++] === '1';\n }",
"hasNext() {\n return this.state.offset > 0 && this.state.history.length > 1;\n }",
"isNext() {\n ... | [
"0.6593253",
"0.6303848",
"0.62367773",
"0.6180731",
"0.59004986",
"0.5786006",
"0.5786006",
"0.5744321",
"0.573298",
"0.5701805",
"0.5654112",
"0.5622694",
"0.5622694",
"0.5622694",
"0.5561175",
"0.5524823",
"0.5511951",
"0.5480964",
"0.5438177",
"0.5398914",
"0.53970134",
... | 0.8480845 | 0 |
Returns true iff the flags have the RESPOND bit set. | function isRespond(flags) {
return (flags & FLAGS.RESPOND) === FLAGS.RESPOND;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isComplete(flags) {\n return (flags & FLAGS.COMPLETE) === FLAGS.COMPLETE;\n }",
"isActive() {\n return (this.flags & 0x10) !== 0;\n }",
"get isRevealed() {\n return this._isRevealed;\n }",
"bool() {\n this.throw_if_less_than(1);\n let val = this.buffer[thi... | [
"0.5839753",
"0.51699114",
"0.5116398",
"0.507849",
"0.5064726",
"0.5064356",
"0.50447583",
"0.50447583",
"0.50447583",
"0.50401306",
"0.5019268",
"0.5011608",
"0.4973289",
"0.49139354",
"0.49035245",
"0.49035245",
"0.49035245",
"0.4869812",
"0.48639506",
"0.48532313",
"0.483... | 0.79780877 | 0 |
Returns true iff the flags have the RESUME_ENABLE bit set. | function isResumeEnable(flags) {
return (flags & FLAGS.RESUME_ENABLE) === FLAGS.RESUME_ENABLE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isActive() {\n return (this.flags & 0x10) !== 0;\n }",
"_shouldCheckForUpdateOnResume() {\n // In case a pause event was missed, assume it didn't make the cutoff\n if (!localStorage.getItem('reloaderLastPause')) {\n return false;\n }\n\n // Grab the last time we paused\n const lastP... | [
"0.55676746",
"0.5172628",
"0.49629998",
"0.4770961",
"0.47660467",
"0.47482634",
"0.47353604",
"0.47008872",
"0.4684009",
"0.46768302",
"0.4671271",
"0.46593004",
"0.46432298",
"0.46358407",
"0.45935705",
"0.45935705",
"0.45693892",
"0.4518856",
"0.45187083",
"0.44881272",
"... | 0.7965159 | 0 |
Returns true iff the flags have the LEASE bit set. | function isLease(flags) {
return (flags & FLAGS.LEASE) === FLAGS.LEASE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isActive() {\n return (this.flags & 0x10) !== 0;\n }",
"function isResumeEnable(flags) {\n return (flags & FLAGS.RESUME_ENABLE) === FLAGS.RESUME_ENABLE;\n }",
"isLeftPressed() {\n return this.currentKeys.get(LEFT);\n }",
"function checkWin() {\n // Determines if the # of placed... | [
"0.5605096",
"0.5374848",
"0.4737772",
"0.47054145",
"0.4683663",
"0.4670973",
"0.4638822",
"0.46223888",
"0.46075183",
"0.4590362",
"0.45860493",
"0.45563254",
"0.45342606",
"0.4518779",
"0.44879183",
"0.4472027",
"0.4472027",
"0.4472027",
"0.44635457",
"0.44635457",
"0.4463... | 0.6501814 | 0 |
Returns true iff the frame type is counted toward the implied client/server position used for the resumption protocol. | function isResumePositionFrameType(type) {
return (
type === FRAME_TYPES.CANCEL ||
type === FRAME_TYPES.ERROR ||
type === FRAME_TYPES.PAYLOAD ||
type === FRAME_TYPES.REQUEST_CHANNEL ||
type === FRAME_TYPES.REQUEST_FNF ||
type === FRAME_TYPE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isRTCP(packet) {\n if (packet.byteLength < 1) {\n return false;\n }\n const view = new DataView(packet);\n const payloadType = view.getUint8(1) & 0x7f;\n return payloadType >= 72 && payloadType <= 79;\n}",
"hasFrameSize() {\n return this.frameSize != VideoData.FRAME_SIZE_NOT_REA... | [
"0.5627414",
"0.56116545",
"0.5329177",
"0.5163794",
"0.5130809",
"0.5066666",
"0.5051189",
"0.49281177",
"0.4896962",
"0.48921198",
"0.48850852",
"0.48827702",
"0.48824942",
"0.48719886",
"0.4871584",
"0.48528177",
"0.48473817",
"0.4845036",
"0.48435283",
"0.48320353",
"0.48... | 0.5843797 | 0 |
Given a RSocket error code, returns a humanreadable explanation of that code, following the names used in the protocol specification. | function getErrorCodeExplanation(code) {
const explanation = ERROR_EXPLANATIONS[code];
if (explanation != null) {
return explanation;
} else if (code <= 0x00300) {
return 'RESERVED (PROTOCOL)';
} else {
return 'RESERVED (APPLICATION)';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RPCError(code, message) {\n this.code = code;\n this.message = message;\n}",
"function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}",
"function errorMsg (err, protocol) {\n return 'Connection OFF to ' + \n host + ' port ' + \n port + ', protocol \"' + \n ... | [
"0.6457462",
"0.6446083",
"0.6365495",
"0.6228935",
"0.6210976",
"0.61366683",
"0.61338",
"0.6064124",
"0.59988207",
"0.5995772",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"0.5923807",
"... | 0.69088626 | 0 |
Prettyprints the frame for debugging purposes, with types, flags, and error codes annotated with descriptive names. | function printFrame(frame) {
const obj = _objectSpread2({}, frame);
obj.type = getFrameTypeName(frame.type) + ` (${toHex(frame.type)})`;
const flagNames = [];
forEachObject_1(FLAGS, (flag, name) => {
if ((frame.flags & flag) === flag) {
flagNames.push(name);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"print_frame(frame) {\n // Output reference for nested frames.\n if (this.level > 0 && frame.state != ANONYMOUS) {\n this.print_symbol(frame.id);\n return;\n }\n\n // If frame has already been printed, only print a reference.\n let ref = this.refs && this.refs.get(frame);\n if (ref) {\n ... | [
"0.666214",
"0.5963467",
"0.5766749",
"0.5692492",
"0.56718594",
"0.54659104",
"0.54397655",
"0.53475404",
"0.53407943",
"0.53175163",
"0.5283127",
"0.51998585",
"0.51959306",
"0.5176563",
"0.5143733",
"0.5122686",
"0.5110491",
"0.5093842",
"0.5045439",
"0.50254047",
"0.50198... | 0.7500695 | 0 |
Returns the byte length of a string when encoded. This is not the same as String.prototype.length, which does not account for the encoding that is used to convert the string into bytes. | static byteLength(string, encoding = 'utf8') {
if (typeof string != 'string') {
return string.byteLength;
}
encoding = normalizeEncoding(encoding) || 'utf8';
return encodingOps[encoding].byteLength(string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function byteLength(string) {\n var length = 0 | 0;\n Array.prototype.forEach.call(string, function(chr) {\n var code = chr.charCodeAt(0);\n length += (code < 0x80) ? 1 : (code < 0x800) ? 2 : 3;\n });\n return length;\n}",
"function stringByteLength(str) {\n if (useNodeBuffer) {\n return Buff... | [
"0.7612082",
"0.74914944",
"0.74914944",
"0.73306626",
"0.73306626",
"0.73306626",
"0.73306626",
"0.73306626",
"0.73306626",
"0.73306626",
"0.72748077",
"0.7191323",
"0.71780294",
"0.71780294",
"0.71780294",
"0.71780294",
"0.71780294",
"0.71780294",
"0.71780294",
"0.71780294",
... | 0.7725231 | 0 |
Returns a new Buffer which is the result of concatenating all the Buffer instances in the list together. | static concat(list, totalLength) {
if (totalLength == undefined) {
totalLength = 0;
for (const buf of list) {
totalLength += buf.length;
}
}
const buffer = new Buffer$1(totalLength);
let pos = 0;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function concatBufferList(buflist, len) {\n\t\tlet tmp = new Uint8Array(len);\n\t\tlet pos = 0;\n\t\tfor (let i = 0; i < buflist.length; i++) {\n\t\t\ttmp.set(new Uint8Array(buflist[i]), pos);\n\t\t\tpos += buflist[i].byteLength;\n\t\t}\n\t\treturn tmp.buffer;\n\t}",
"function bufferConcat(bufs) {\n var length ... | [
"0.67258877",
"0.6507208",
"0.6507208",
"0.6507208",
"0.6402935",
"0.6070843",
"0.6017776",
"0.60055435",
"0.56706053",
"0.5668092",
"0.5663794",
"0.5662956",
"0.56545585",
"0.56267476",
"0.56267476",
"0.56267476",
"0.56267476",
"0.56267476",
"0.56267476",
"0.56267476",
"0.56... | 0.7118346 | 0 |
Returns true if obj is a Buffer, false otherwise. | static isBuffer(obj) {
return isInstance(obj, Buffer$1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}",
"function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n }",
"function isBuffer(obj) {\n return obj != nul... | [
"0.8482506",
"0.8434369",
"0.84142154",
"0.84142154",
"0.84142154",
"0.84037733",
"0.83881116",
"0.83881116",
"0.83881116",
"0.83881116",
"0.83881116",
"0.8384724",
"0.8384724",
"0.8384724",
"0.8384724",
"0.8384724",
"0.8384724",
"0.8384724",
"0.8384724",
"0.83114594",
"0.831... | 0.88191926 | 0 |
Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise. | equals(otherBuffer) {
if (!isInstance(otherBuffer, Uint8Array)) {
throw new TypeError(
// eslint-disable-next-line max-len
`The "otherBuffer" argument must be an instance of Buffer or Uint8Array. Received type ${typeof otherBuffer}`
);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buffersEqual(a, b) {\n if(!isBuffer(a) || !isBuffer(b)) {\n return false\n }\n\n if(a.length !== b.length) {\n return false\n }\n\n for(var i = 0; i < a.length; i++) {\n if(a[i] !== b[i]) {\n return false\n }\n }\n\n return true\n}",
"function equal (bufferA, bufferB) {\n //wa... | [
"0.77628523",
"0.7532679",
"0.7507709",
"0.7303836",
"0.72884667",
"0.72884667",
"0.71378535",
"0.687568",
"0.67848635",
"0.67536306",
"0.6427567",
"0.6283379",
"0.62195027",
"0.59485257",
"0.5929745",
"0.58864754",
"0.585636",
"0.5852429",
"0.5847109",
"0.5847109",
"0.584710... | 0.79507476 | 0 |
Writes string to buf at offset according to the character encoding in encoding. The length parameter is the number of bytes to write. If buf did not contain enough space to fit the entire string, only part of string will be written. However, partially encoded characters will not be written. | write(string, offset = 0, length = this.length, encoding = 'utf8') {
encoding = checkEncoding(encoding);
switch (encoding) {
case 'utf8':
if (typeof TextEncoder !== 'undefined') {
// $FlowFixMe
const resultArray ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeString(buf, str, offset, encoding) {\n\tif (offset === undefined) {\n\t\toffset = 0;\n\t}\n\n\tif (encoding === undefined) {\n\t\tencoding = 'utf8';\n\t}\n\n\tvar string = new Buffer(str, encoding);\n\tstring.copy(buf, offset);\n\tbuf.writeUInt8(0, offset + string.length);\n}",
"writeStringLT255(s,... | [
"0.6619682",
"0.5684727",
"0.54917246",
"0.54917246",
"0.54804754",
"0.5410865",
"0.5410865",
"0.540559",
"0.5385406",
"0.53152806",
"0.5300928",
"0.5204906",
"0.52040726",
"0.5180524",
"0.5180524",
"0.5171089",
"0.51630896",
"0.51630896",
"0.51628006",
"0.51628006",
"0.51259... | 0.64216226 | 1 |
Handle a frame received from the transport client. Handle connection frames (stream id === 0). | _handleConnectionFrame(frame) {
switch (frame.type) {
case FRAME_TYPES.ERROR:
const error = createErrorFromFrame(frame);
this._handleConnectionError(error);
break;
case FRAME_TYPES.EXT:
// Extensi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleStreamFrame(streamId, frame) {\n if (this._isRequest(frame.type)) {\n const leaseError = this._useLeaseOrError(this._responderLeaseHandler);\n if (leaseError) {\n this._sendStreamError(streamId, leaseError);\n return;\n ... | [
"0.7054878",
"0.6065095",
"0.5722315",
"0.5649513",
"0.5632568",
"0.5551869",
"0.54543793",
"0.5373388",
"0.5366875",
"0.53124046",
"0.530713",
"0.5276732",
"0.5247072",
"0.52428746",
"0.5218175",
"0.5212472",
"0.5205755",
"0.5203871",
"0.5196752",
"0.5171988",
"0.5171988",
... | 0.7122158 | 0 |
Handle streamspecific frames (stream id !== 0). | _handleStreamFrame(streamId, frame) {
if (this._isRequest(frame.type)) {
const leaseError = this._useLeaseOrError(this._responderLeaseHandler);
if (leaseError) {
this._sendStreamError(streamId, leaseError);
return;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleUserMedia2(stream) {\n\tconsole.log('Adding local fake stream.');\n\tsendMessage('got user media');\n}",
"function gotStream(stream) {\n // This is just like a video/stream from createCapture(VIDEO)\n otherVideo = stream;\n //otherVideo.id is the unique identifier for this peer\n //oth... | [
"0.58876216",
"0.5876602",
"0.57597196",
"0.5744812",
"0.57100856",
"0.56777716",
"0.5618242",
"0.5614001",
"0.5589206",
"0.55797976",
"0.5578856",
"0.55587906",
"0.5534844",
"0.5489226",
"0.54478383",
"0.54170865",
"0.5416314",
"0.5409673",
"0.53939867",
"0.5388094",
"0.5374... | 0.75363564 | 0 |
Read a uint24 from a buffer starting at the given offset. | function readUInt24BE(buffer, offset) {
const val1 = buffer.readUInt8(offset) << 16;
const val2 = buffer.readUInt8(offset + 1) << 8;
const val3 = buffer.readUInt8(offset + 2);
return val1 | val2 | val3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ruint8(buffer, endian, offset)\n{\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset >= buffer.length)\n\t\tthrow (new Error... | [
"0.63110846",
"0.63110846",
"0.59456164",
"0.594192",
"0.5797187",
"0.5776887",
"0.57514364",
"0.5545142",
"0.5545142",
"0.55400205",
"0.5475244",
"0.5475244",
"0.5475244",
"0.5475244",
"0.54648274",
"0.5454777",
"0.5451167",
"0.5451167",
"0.54510707",
"0.54510707",
"0.544528... | 0.8082929 | 0 |
Writes a uint24 to a buffer starting at the given offset, returning the offset of the next byte. | function writeUInt24BE(buffer, value, offset) {
offset = buffer.writeUInt8(value >>> 16, offset); // 3rd byte
offset = buffer.writeUInt8((value >>> 8) & 0xff, offset); // 2nd byte
return buffer.writeUInt8(value & 0xff, offset); // 1st byte
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readUInt24BE(buffer, offset) {\n const val1 = buffer.readUInt8(offset) << 16;\n const val2 = buffer.readUInt8(offset + 1) << 8;\n const val3 = buffer.readUInt8(offset + 2);\n return val1 | val2 | val3;\n }",
"function wuint8(value, endian, buffer, offset)\n{\n\tvar val;\n\... | [
"0.7052166",
"0.5940283",
"0.5940283",
"0.55205023",
"0.55205023",
"0.5226657",
"0.51677924",
"0.51557946",
"0.5058492",
"0.5058492",
"0.5058492",
"0.5004628",
"0.4960914",
"0.49417078",
"0.4843743",
"0.4843743",
"0.48353297",
"0.48184776",
"0.4785689",
"0.4785689",
"0.475959... | 0.74191844 | 0 |
Write a uint64 (technically supports up to 53 bits per JS number representation). | function writeUInt64BE(buffer, value, offset) {
const high = (value / BITWISE_OVERFLOW) | 0;
const low = value % BITWISE_OVERFLOW;
offset = buffer.writeUInt32BE(high, offset); // first half of uint64
return buffer.writeUInt32BE(low, offset); // second half of uint64
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"writeUInt64BE(n) {\n const buf = this.reserveBytes(8);\n buf.writeUInt32BE(0);\n buf.writeUInt32BE(n, 4);\n }",
"function readUInt64 (data)\n{\n\treturn h2d (data.toString ('ascii', 0, 16));\n}",
"u64(num) {\n this._convo.u64[0] = num;\n this.buffer.set(this._convo.u8.slice(0, 8), this.... | [
"0.7577129",
"0.64990896",
"0.63446873",
"0.6328444",
"0.62821317",
"0.620301",
"0.6007344",
"0.6005887",
"0.5992971",
"0.58688205",
"0.58239245",
"0.5780186",
"0.57353425",
"0.5642143",
"0.5575373",
"0.5550002",
"0.554749",
"0.54618716",
"0.54456294",
"0.5419394",
"0.5384449... | 0.7168664 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.