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
Sets the current root span.
set currentRootSpan(root) { if (this.contextManager.active) { this.contextManager.set('rootspan', root); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get currentRootSpan() {\n return this.contextManager.get('rootspan');\n }", "setRoot(root) {\n if (this._root != root) {\n this._root = root;\n this.observer.setWindow((root.nodeType == 9 ? root : root.ownerDocument).defaultView || window);\n this.mountStyles();\...
[ "0.6542083", "0.63318145", "0.6041782", "0.5797447", "0.5735596", "0.5570875", "0.5542617", "0.54699224", "0.54119563", "0.5367039", "0.5364721", "0.53615725", "0.5355514", "0.5285799", "0.5285799", "0.5209652", "0.51851547", "0.515333", "0.509608", "0.5084557", "0.50539845",...
0.8445225
0
Gets the list of event listeners.
get eventListeners() { return this.eventListenersLocal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get listenedEvents() {\n\t\treturn DOM_EVENTS;\n\t}", "get eventListeners() {\n\t\treturn [\"onOpening\",\"onOpen\",\"onClosing\",\"onClose\",\"onCollapse\",\"onDragEnd\",\"onDragStart\",\"onExpand\",\"onMaximize\",\"onMinimize\",\"onResizeEnd\",\"onResizeStart\",\"onRestore\",\"onCreate\",\"onReady\"];\n...
[ "0.74521387", "0.72069794", "0.71104795", "0.7041065", "0.7025372", "0.693601", "0.6814862", "0.6811757", "0.67523307", "0.67523307", "0.67523307", "0.66157913", "0.6558052", "0.6540284", "0.65296954", "0.6528523", "0.6460375", "0.64094484", "0.64094484", "0.6381716", "0.6344...
0.78160334
0
Starts a root span.
startRootSpan(options, fn) { return this.contextManager.runAndReturn((root) => { let traceId; if (options && options.spanContext && options.spanContext.traceId) { traceId = options.spanContext.traceId; } else { // New root span. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onStartSpan(root) {\n if (!this.active)\n return;\n if (!root) {\n return this.logger.debug('cannot start trace - no active trace found');\n }\n if (this.currentRootSpan !== root) {\n this.logger.debug('currentRootSpan != root on notifyStart. Need more i...
[ "0.6558813", "0.6340922", "0.5952144", "0.5876859", "0.58363837", "0.54859084", "0.53258604", "0.53258604", "0.53109705", "0.5238624", "0.5179816", "0.5162038", "0.5117036", "0.5085824", "0.50515527", "0.50234973", "0.5013239", "0.50124073", "0.5006651", "0.4990504", "0.49881...
0.69586253
0
Notifies listeners of the span start.
onStartSpan(root) { if (!this.active) return; if (!root) { return this.logger.debug('cannot start trace - no active trace found'); } if (this.currentRootSpan !== root) { this.logger.debug('currentRootSpan != root on notifyStart. Need more investigation...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n\t\tthis.registerListeners();\n\t}", "function handleStart() {\n startTimer(START_TIMER_LENGTH, marker.startAnimation);\n clearInterval(trackerInterval)\n setHidden(document.getElementsByClassName('before'), true);\n setHidden(document.getElementsByClassName('during'), false);\n sendAll...
[ "0.6487421", "0.6095094", "0.5967797", "0.5955136", "0.58768827", "0.5823847", "0.5806804", "0.57379013", "0.57306105", "0.56632084", "0.56406635", "0.5625876", "0.5618891", "0.5607039", "0.5582378", "0.5551139", "0.5533194", "0.55224603", "0.55224603", "0.55224603", "0.55095...
0.63929546
1
Notifies listeners of the span end.
onEndSpan(root) { if (!this.active) return; if (!root) { this.logger.debug('cannot end trace - no active trace found'); return; } if (this.currentRootSpan !== root) { this.logger.debug('currentRootSpan != root on notifyEnd. Need more invest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onEnd() {\n //console.log('' + this);\n scope.emit('end', this);\n }", "onEnd() {\n\t\tthis.debug('onEnd');\n\t}", "function onEnd() {\n\n // reset the offsets\n stickyOffset = 0;\n\n if(poi...
[ "0.6922717", "0.665899", "0.650468", "0.64616287", "0.6307665", "0.6305015", "0.6285663", "0.6240128", "0.6200112", "0.61919916", "0.61379915", "0.60985845", "0.60616755", "0.596755", "0.5963614", "0.59502864", "0.59451765", "0.5937406", "0.5908351", "0.59051937", "0.5899079"...
0.69547445
0
Unregisters an end span event listener.
unregisterSpanEventListener(listener) { const index = this.eventListenersLocal.indexOf(listener, 0); if (index > -1) { this.eventListeners.splice(index, 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unbindEvents() {\n this.$node.off(transitionEndEvt);\n }", "_unlisten() {\n const that = this;\n\n if (that._trackListener) {\n that._trackListener.unlisten();\n }\n\n if (that._fillListener) {\n that._fillListener.unlisten();\n }\n\n if (that._...
[ "0.60851586", "0.60748583", "0.60718983", "0.5855086", "0.5849404", "0.5822508", "0.5798182", "0.574698", "0.57421094", "0.5722378", "0.57085824", "0.56886333", "0.55749", "0.55742645", "0.5573286", "0.55318373", "0.5527825", "0.55181587", "0.55138516", "0.55064297", "0.55032...
0.67406464
0
Binds the trace context to the given event emitter. This is necessary in order to create child spans correctly in event handlers.
wrapEmitter(emitter) { if (!this.active) { return; } const namespace = this.contextManager; namespace.bindEmitter(emitter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createChildSpanFromExtractedContext(service, traceContext) {\n let outputContext = Object.assign({}, traceContext, { service, spanId: undefined, parentSpanId: traceContext.spanId });\n return new Trace(new EventMessage_1.EventTraceMetadata(outputContext));\n }", "function setSpanContext(c...
[ "0.5849629", "0.54971176", "0.54971176", "0.5427367", "0.52306956", "0.51840407", "0.5175676", "0.5175676", "0.5044908", "0.50369483", "0.5023094", "0.5013168", "0.49104607", "0.4890938", "0.48898593", "0.48809123", "0.48643333", "0.48394364", "0.48394364", "0.48394364", "0.4...
0.6190996
0
Determine whether to sample request or not.
makeSamplingDecision(options, traceId) { // If users set a specific sampler in the TraceOptions, use it. if (options && options.samplingRate !== undefined && options.samplingRate !== null) { return sampler_1.SamplerBuilder.getSampler(options.samplingRate) .shouldS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testRequest (url, sample, cb) {\n // Try up to 10 times\n makeRequest(url, 1, 10, function (err, res, body) {\n if (err) {\n // Request error\n return cb(err);\n }\n if (body && body.indexOf(sample.msg) !== -1 &&\n (res.statusCode === 200 || res.statusCode === sample.code) &&...
[ "0.60836875", "0.5684607", "0.5514673", "0.5491761", "0.5486505", "0.5483886", "0.5480908", "0.54572463", "0.54304975", "0.5423665", "0.5420474", "0.53583", "0.5348599", "0.5329511", "0.5281898", "0.5265007", "0.5239986", "0.5223432", "0.5204264", "0.5197716", "0.5162278", ...
0.5844938
1
File/Function foe each of the screens in the app that is wrapped in a safe area view
function AppScreen({ children, style }) { return <SafeAreaView style={[styles.screen, style]}>{children}</SafeAreaView>; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderScreenContent(){}", "render() {\n return (\n <SafeAreaView style={styles.safeView}>\n <Disclaimer /> {/* Shows the disclaimer popup each time the homescreen is launched. */}\n <View style={styles.mainContainer}>{this.renderList()}</View>\n </SafeAreaView>\n );\n }", "functi...
[ "0.60957843", "0.5744888", "0.56959236", "0.5614057", "0.55938095", "0.5589559", "0.555714", "0.5527604", "0.54944134", "0.54944134", "0.54944134", "0.54930437", "0.5481988", "0.5415929", "0.54044473", "0.5402237", "0.5389176", "0.5369224", "0.5349239", "0.53421235", "0.53413...
0.59235495
1
Convert an array of property names to a hash Given an array of string property names, return an object whose keys are the names, each with value `true`.
function propertyArrayToHash(a) { return a.reduce(function (result, key) { result[key] = true; return result; }, {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}", "function toHash(arr) {\n const hash = {};\n for (const item of arr)\n hash[item] = true;\n return hash;\n}", "function arrayToBooleanHash (a) {\n var h = {}, i;\n ...
[ "0.65020895", "0.65020895", "0.6492471", "0.6239916", "0.58834106", "0.56543064", "0.5617156", "0.5532709", "0.5532709", "0.5532709", "0.5532709", "0.5532709", "0.5532709", "0.5532709", "0.5532709", "0.5505457", "0.5505457", "0.5505457", "0.5505457", "0.5505457", "0.54771113"...
0.74614686
0
Returns the number denoted by the numeric constant. If this is not a numeric constant, a ParseException is thrown.
function parseNumericConstant(constant) { if (constant.match(/^#[0-9]+$/)) { return parseInt(constant.substr(1), 10); } if (constant.match(/^#0x[0-9a-fA-F]+$/)) { return parseInt(constant.substr(3), 16); } if (constant.match(/^#&[0-9a-fA-F]+$/)) { return parseInt(constant.substr(3), 16); } if (constant....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "NumericLiteral() {\n const token = this._eat('NUMBER')\n return {\n type: 'NumericLiteral',\n value: Number(token.value),\n }\n }", "NumericLiteral() {\n const token = this._eat('NUMBER');\n return {\n type: 'NumericLiteral',\n value: Number(token.val...
[ "0.67003345", "0.66178185", "0.6313081", "0.6311807", "0.6311807", "0.6311807", "0.6311807", "0.6290463", "0.61903816", "0.61424017", "0.61071074", "0.60280013", "0.60226566", "0.60168517", "0.5997689", "0.599598", "0.59781605", "0.59587926", "0.5955474", "0.59446216", "0.592...
0.73020446
0
Many operations on ARM have different opcodes, but do practically the same. This is, among other reasons, because of the S flag, which defines whether flags should be set, and conditional execution. We try to solve this problem by defining the function populateCommandMap which populates commandMap with operations belon...
function populateCommandMap(name, command, isBranch) { function populateCommandMapConditionsSolved(name, command) { /* TODO implement arguments length checks for command. Must be done here, * only we know whether one of the arguments is writeStatus and whether we * must therefore subtract one from argument...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapToOperator (map) {\n return function (cmd) {\n const op = map[cmd]\n if (typeof op === \"string\") return map[op]\n else return op\n }\n}", "function handleBinary(op) {\n return pseudocode('D = y; M = x') +\n `M=${op}\\n` +\n pseudocode('SP--')\n}", "function binaryOperation(op) {...
[ "0.5558216", "0.5353698", "0.53272593", "0.5307804", "0.5231649", "0.5223023", "0.52224725", "0.5213573", "0.52013534", "0.5196796", "0.5155286", "0.51272327", "0.5117382", "0.5101934", "0.50537336", "0.50066054", "0.49942964", "0.49560618", "0.4953514", "0.49363512", "0.4934...
0.74089473
0
Returns a function which, when invoked, sets the content of the register denoted by registerString.
function setRegisterFunction(registerString) { var registerIndex = parseRegister(registerString); return function (value) { registers[registerIndex] = convToUInt32(value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRegisterFunction(registerString) {\n\t\t/*\n\t\tregisterString = registerString.toLowerCase();\n\t\tvar regex = /^r([0-9]|1[0-5])$/;\n\t\t// catch special registers here \n\t\tvar registerStringArray = registerString.match(regex);\n\t\tassert(registerStringArray, registerString + \" is invalid, it must...
[ "0.6961839", "0.6438158", "0.6146659", "0.5434481", "0.5254742", "0.5243887", "0.52384734", "0.5227275", "0.52251107", "0.5224312", "0.51783466", "0.5177911", "0.515186", "0.5127197", "0.5127197", "0.50840205", "0.50709695", "0.506397", "0.506397", "0.5034108", "0.5022588", ...
0.7868161
0
Returns a function which, when invoked, returns the content of the register denoted by registerString.
function getRegisterFunction(registerString) { /* registerString = registerString.toLowerCase(); var regex = /^r([0-9]|1[0-5])$/; // catch special registers here var registerStringArray = registerString.match(regex); assert(registerStringArray, registerString + " is invalid, it must match the regular expre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRegisterFunction(registerString) {\n\t\tvar registerIndex = parseRegister(registerString);\n\t\treturn function (value) {\n\t\t\tregisters[registerIndex] = convToUInt32(value);\n\t\t}\n\t}", "function register(name, fn, checkArgs, returns, expandMV) {\n\t STRING_FUNCTIONS[name] = {\n\t ...
[ "0.66893524", "0.63026667", "0.61140513", "0.5834684", "0.57282674", "0.5557656", "0.550791", "0.5362583", "0.5329876", "0.530583", "0.50831145", "0.50226766", "0.50146914", "0.5013615", "0.501203", "0.50030345", "0.49829683", "0.49829683", "0.49829683", "0.49829683", "0.4982...
0.77543247
0
necessary helping function to parse also special register names SP, PC, LR correctly
function parseRegister(registerString) { registerString = registerString.toLowerCase(); var regex = /^r([0-9]|1[0-5])$/; var registerStringArray; // catch special registers here switch (registerString) { case "sp": registerStringArray = ["","13"]; break; case "lr": registerStringArray = ["",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseSpecial_old(s) {\n\n\tfunction parseSymbol(s, regex, selector) {\n\t\t// Default to selecting the last regex group in the match\n\t\t// (The matched string if there are no groups, otherwise the last defined group)\n\t\t// This can be overridden using a custom `selector` funcion.\n\t\tselector = selec...
[ "0.52625805", "0.5247899", "0.5247454", "0.52384585", "0.5217218", "0.52019554", "0.5191151", "0.5191151", "0.5191151", "0.5191151", "0.5161916", "0.5147092", "0.509636", "0.5053926", "0.50195", "0.4999838", "0.49741742", "0.49581033", "0.49515492", "0.4935179", "0.49140596",...
0.6259115
0
Evaluates a flexible second operand and returns a function which, when invoked, returns a flexible second operand.
function evalFlexibleOperatorFunction(flexOpFirstPart, flexOpSecondPart, writeStatus) { // first, assume this is a constant. var constant; var bytecode = 0b000000000000; /* 11 - 7 | 6 - 5 | 4 | 3 - 1 * shift amount | shift | 0 | rm */ try { constant = parseNumericConstant(flexOpFirstPart); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Fn($1) { return function($2) { return Function_ ([$1, $2]); }; }", "function curry(binary, first) {\n return function(second) {\n return binary(first, second);\n };\n}", "function twice(binary) {\n return function(a) {\n return binary(a, a)\n }\n}", "function always2(x) { return function(y...
[ "0.5799981", "0.5746095", "0.5641024", "0.5627409", "0.5593124", "0.55787474", "0.55616117", "0.5560873", "0.5537315", "0.55314946", "0.5524197", "0.55222785", "0.5440314", "0.5435564", "0.5425061", "0.5402073", "0.53881", "0.5385228", "0.5385228", "0.5385228", "0.5385228", ...
0.6166474
0
Shows header based on login status
viewHeader() { if (this.state.page === "Info") { if (this.state.page === "Info") { return ( <div>Getting Started</div> ); } else { return ( <div>Welcome to Cast Off!</div> ); } } else { if (!this.props.userkey) { return ( <div>Welcome to Cast Off!</div> ); } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function configureHeaderLoginStatus() {\n $.ajax('/api/authentication', {\n data: {\n target: location.pathname,\n },\n }).done((loginStatus) => {\n const loginLink = document.getElementById('login-link');\n const headerUsername = document.getElementById('header-username');\n const usernameDr...
[ "0.7322912", "0.6510965", "0.64386815", "0.6429531", "0.6371566", "0.6355393", "0.63546264", "0.63124883", "0.6228726", "0.61645633", "0.6162587", "0.6161857", "0.6127552", "0.6077065", "0.6058754", "0.60506797", "0.60505486", "0.6042355", "0.60406667", "0.6038227", "0.602559...
0.6539278
1
Hide/Shows regions drawing mode section
toggleRegionsDrawingMode() { if ($('.regions-drawing-mode').is(':visible')) { $('.regions-drawing-mode').hide(); $('.regions-drawing-mode-toggler').removeClass('collapse-up'); $('.regions-drawing-mode-toggler').addClass('expand-down'); } else { $('.regions...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hide() {\r\n this.show = false;\r\n map.removeLayer(areasPolygons[this.polygonId]);\r\n }", "hideDrawingTool () {\n this.drawingManager.setDrawingMode(null)\n this.startedDrawing = false\n }", "function hideDrawingControl() {\n drawingManager.setOptions({\n drawingControl: false\n ...
[ "0.6882127", "0.6848569", "0.6829648", "0.64883757", "0.64136565", "0.6392942", "0.63019055", "0.6179397", "0.6155371", "0.6111463", "0.60871184", "0.605897", "0.6052407", "0.60511136", "0.60456043", "0.60064036", "0.6005892", "0.59901154", "0.5983939", "0.59409535", "0.59389...
0.7842387
0
Propagate selected shapes using chosen drawing modes
propagateSelectedShapes() { // we loop over all selected shapes and propagate them individually // since they could be in different t/z so that he propagation won't // be the same for each of them this.regions_info.selected_shapes.map( (id) => { let shape = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleModeChange(mode) {\r\n if (mode == \"pen\") {\r\n if (penclasses.contains(\"active\")) {\r\n // make options visible\r\n penOptions.classList.add(\"show\");\r\n } else {\r\n ctx.strokeStyle = \"blue\";\r\n ctx.lineWidth = 5;\r\n mytool = \"pen\";\r\n ctx.globalCo...
[ "0.64585704", "0.64083934", "0.63837904", "0.6323015", "0.6266175", "0.6250527", "0.61805105", "0.6156557", "0.6101951", "0.6071841", "0.60698223", "0.60563046", "0.60415685", "0.6020921", "0.59930474", "0.595301", "0.59322405", "0.5927547", "0.5926219", "0.58904684", "0.5831...
0.6776628
0
`createMelFilterbank` create filterbank for extraction process. If input parameters are incorrect, the process stop and exit. Return the filterbank model.
function createMelFilterbank(lowFreq, highFreq, nFilter, fftSize, sampleRate) { // parameter check. if (lowFreq < 0 || highFreq > sampleRate / 2) { console.log('Low frequency must more or equal 0' + ' and high frequency must less than or equal half of sample rate.' + ' Process exiting'); process...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructMelFilterBank(fftSize, nFilters, lowF, highF, sr) {\n var bins = [],\n fq = [],\n filters = [];\n \n var lowM = hzToMels(lowF),\n highM = hzToMels(highF),\n deltaM = (highM - lowM) / (nFilters+1);\n \n // Construct equidistant Mel values between lowM and highM...
[ "0.49710456", "0.4583053", "0.4506613", "0.42271787", "0.41985783", "0.41676098", "0.4155407", "0.41259134", "0.41214892", "0.40631264", "0.40580153", "0.40424612", "0.40166083", "0.39694974", "0.3943454", "0.39407435", "0.3918724", "0.3894058", "0.38818914", "0.38804346", "0...
0.61095953
0
`extractAndConvert` decode wav based on `filePath`, frame it, extract the file using MFCC. and convert it to tensorflow input shape. Return 4d tensor.
function extractAndConvert(filePath) { const preEmphasis = 0; const sampleRate = 16000; const frameSize = 25 / 1000 * sampleRate; // 400 const frameShift = 10 / 1000 * sampleRate; // 160 const window = ''; const fftSize = 512; // based on the next power of 2 from 400 -> 512. const lowFreq = 300; const h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractWav(file, label) {\n // decode wav.\n let sample;\n sample = wav.decode(fs.readFileSync(process.cwd() + '/data/collect/' + label + '/' + file)).channelData[0];\n\n // framing and windowing the sample.\n let preSample;\n if (preEmphasis !== 0) {\n preSample = new Float32Array(sample.length)...
[ "0.51241696", "0.49738607", "0.4764763", "0.4544576", "0.44202185", "0.43985188", "0.4374914", "0.43498456", "0.4336123", "0.43317807", "0.4271456", "0.41530192", "0.41152778", "0.41078004", "0.410655", "0.40967283", "0.40956572", "0.40243942", "0.40188843", "0.40140086", "0....
0.6521915
0
`uploadSpeech` upload file in the `request` based on defined directory and then convert its path location to url. Return the url and path location as `fileURL` and `filePath`.
function uploadSpeech(address, port, request) { const dirData = '\\data'; const dirSpeech = '\\speech\\'; const form = new formidable.IncomingForm(); form.uploadDir = process.cwd() + dirData + dirSpeech; form.keepExtensions = true; form.maxFieldsSize = 10 * 1024 * 1024; form.maxFields = 1000; form.mult...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadMediaFile(locationURL_) {\n\t//Build post string from object\n\t\n var post_data = querystring.stringify({\n 'username' : username,\n 'url' : locationURL_\n });\n \n //create the request parameter object\n \n var request_parameters = {\n\t host : 'voice.africastalking.com',...
[ "0.61728734", "0.6164676", "0.56254864", "0.55091333", "0.55091333", "0.5380647", "0.53737605", "0.5323597", "0.52386975", "0.5231015", "0.51671964", "0.5150478", "0.5135988", "0.5089249", "0.50704074", "0.5063519", "0.5061638", "0.5055838", "0.5055838", "0.50356805", "0.5022...
0.7141651
0
`router` handle all mimic app identify section request, each response corresponding to each request. There are 2 type request categorized by mimic app identify section, `uploadSpeech` and `identifySpeech`. When the request doesn't match anything it return nothing.
async function router(address, port, filename, request) { let response; if (request.method === 'POST') { if (filename.toString().indexOf('\\uploadSpeech') != -1) response = await uploadSpeech(address, port, request); if (filename.toString().indexOf('\\identifySpeech') != -1) response = await identifySpeech...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function handleIdentifyRoute(req, res) {\n let handled = false;\n\n // parse the route: /maps/default/{layerName}/query\n if (req.url.match(/maps\\/default\\/\\w+\\/query/ig)) {\n let parameters = parseIdentifyParameters(req);\n let features = await getIdentifyFeatures(parameters);\n ...
[ "0.5899772", "0.5329555", "0.528936", "0.508315", "0.4961136", "0.49568033", "0.49531648", "0.49504054", "0.4934274", "0.4931133", "0.49276146", "0.48991972", "0.487557", "0.48419705", "0.482884", "0.48256257", "0.48207834", "0.4819779", "0.4817993", "0.4746416", "0.47394636"...
0.6012975
0
defining button_pressed function, calls the sound() function with the pressed key as parameter
function button_pressed(event) { var key_pressed= event.key; console.log(key_pressed); // passing key pressed to sound () sound(key_pressed); // animation buttonAnimation(key_pressed); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sound(pressed)\r\n{\r\n \r\n \r\n \r\n switch (pressed) {\r\n case \"w\":\r\n {\r\n var audio = new Audio(\"sounds/tom-1.mp3\");\r\n audio.play();\r\n }\r\n \r\n break;\r\n \r\n case \"a\":\r\n ...
[ "0.7981284", "0.79307", "0.78104043", "0.77094656", "0.77046084", "0.7661903", "0.76092154", "0.7588807", "0.7584637", "0.7577073", "0.75372434", "0.7531139", "0.751248", "0.7479204", "0.7469017", "0.7427247", "0.74188226", "0.74150056", "0.74130386", "0.740666", "0.74022734"...
0.8723441
0
render single user page
function renderUserPage() { const userId = location.hash.split("users/")[1]; // get observations const observations = Model.get_user_observations(parseInt(userId)); loadPage("user-details", { user: Model.get_user(parseInt(userId)), observations: observations, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderUser(id) {\n const userId = id || getSelectedUser()\n console.log('Rendering user')\n if (userId) {\n const user = client.user.get(userId)\n const userDataString = JSON.stringify(user, null, 4)\n document.getElementById('display').innerHTML = userDataString\n if (user !=...
[ "0.7227052", "0.70828444", "0.70334107", "0.6972355", "0.68706053", "0.6842285", "0.68216234", "0.6766247", "0.67454016", "0.67396426", "0.66886985", "0.6687776", "0.66509366", "0.66139513", "0.6584215", "0.65532196", "0.65511453", "0.65456265", "0.64853054", "0.64651257", "0...
0.76909065
0
render single observation page
function renderObservationPage() { const observationId = location.hash.split("observations/")[1]; // get one observation const observation = Model.get_observation(parseInt(observationId)); const userId = observation.participant; loadPage("observation-details", { observation: Model.get_observation(parseInt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n res.render('socList', {\n title: 'Sentinel Project: SOC Manager',\n socs: socs,\n datapoints: resultsDatapoints\n });\n }", "function displayObservation(obs) {\n\t \n sys.innerHTML = obs.sys;\n dia.innerHTML = obs.dia;\n glucose.i...
[ "0.6348037", "0.6105521", "0.605985", "0.605985", "0.60368365", "0.59232837", "0.58968556", "0.589148", "0.5881461", "0.57514256", "0.57514256", "0.57514256", "0.57405424", "0.56935763", "0.5637198", "0.55944425", "0.5589139", "0.5587372", "0.5549141", "0.5529571", "0.5526250...
0.82938284
0
Side bar Loading Loads the Home screen
function loadHome() { hideall(); var top = document.getElementById("Welcome"); top.innerHTML=("Weclome Home " + user); $("#home").show(); $("#sidebar").show(); deactiveAll(); $("#side-home").addClass("active"); $("#navbar").show(); // Additonal calls clearC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function homePageLoader() {\n\n pageCreator(\"home-page\");\n navBar(\"home-page\");\n restaurantLogo();\n bookTableBtn(\"home-page\");\n socialMedia();\n}", "function _load() {\r\n document.getElementById(\"loading-icon\").style.visibility = \"hidden\";\r\n document.getEleme...
[ "0.7033249", "0.69398856", "0.6888617", "0.6858117", "0.6841716", "0.6711151", "0.6664711", "0.6662501", "0.6622334", "0.66154534", "0.6596945", "0.6582977", "0.65687066", "0.65643555", "0.6560308", "0.644394", "0.64279187", "0.64255667", "0.6407162", "0.6403798", "0.63981366...
0.72429913
0
Loads the Friends screen screen
function loadFriendsPage() { hideall(); $("#friends").show(); $("#sidebar").show(); deactiveAll(); $("#side-friends").addClass("active"); $("#navbar").show(); // Additonal calls }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFriends()\n{\n\t// remove the game button\n\t$('.start-game').val(\"Loading...\").attr(\"disabled\", \"disabled\");\n\n\tFB.api('/me', function(response) {\n\t\t// console.log(response);\n\t\t$('#greeting').html(\"Good Luck \" + response.first_name).show();\n\t});\n\n\t// get array of friends\n\tFB.ap...
[ "0.7029767", "0.63525456", "0.5847364", "0.5742667", "0.5711138", "0.569324", "0.56644535", "0.56533855", "0.55957085", "0.5594763", "0.5587776", "0.55580276", "0.5551829", "0.55477417", "0.55459785", "0.55091476", "0.55056554", "0.5502346", "0.5489433", "0.54728127", "0.5469...
0.6848367
1
Functions for map Loads a specific building
function loadBuilding(building) { // Building is the building name var table = document.getElementById("mapButtons"); let placeJSON = null; // Validate input var build = buildingsJSON["buildings"]; for (var i = 0; i < build.length; i++) { if (build[i].code == building) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadBuildings(show_buildings){\n var loader = new THREE.ColladaLoader();\n loader.load(BUILDING_3D, load_building_custom(show_buildings));\n}", "function mapViaUrl() {\r\n\r\n // The order of the follwing ifs is from specific to less specific location given in uri\r\n // If s...
[ "0.6723542", "0.6354771", "0.6335728", "0.6255154", "0.62447083", "0.6232895", "0.62259305", "0.6219352", "0.6170869", "0.61065316", "0.60756284", "0.6074149", "0.6045842", "0.6045065", "0.6030705", "0.6025786", "0.6008692", "0.60059595", "0.59465355", "0.5945257", "0.5935098...
0.6367882
1
suit:'h', 'd', 's', 'c' point(number): 1~13 displayPoint: 'A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'
function createCard(suit, point) { return { suit: suit, point: point, display: function () { let displayPoint = point + '' if (this.point === 1) displayPoint = 'A' if (this.point === 11) displayPoint = 'J' if (this.point === 12) displayPoint = 'Q' if (this.point === 13) disp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function /*char*/ suit(/*int*/ card) {\n\t//return( suits['c'+(card % NSUITS)] );\n\treturn( suits[card % NSUITS] );\n}", "function spots(frontNode, suit) {\n spotChar = \"\\u00a0\";\n var spotChars = {\n \"C\" : \"\\u2663\",\n \"D\" : \"\\u2666\",\n \"H\" : \"\\...
[ "0.67186564", "0.65843385", "0.65652305", "0.65585643", "0.6329461", "0.61910063", "0.6163508", "0.6156559", "0.61528707", "0.61360645", "0.6126363", "0.6122064", "0.6089098", "0.6072676", "0.5996988", "0.596271", "0.59451556", "0.5936932", "0.5918524", "0.5898956", "0.587501...
0.7316004
0
Create ouput sheet if not in spreadsheet
function checkForOuput() { var search = ss.getSheetByName("Formatted Addresses"); if (!search) { ss.insertSheet("Formatted Addresses"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSheet() {\n\tSheeter().createSheet('newSheet', 20, 5);\n}", "function getSheet( workBook, campaignName ){\r\n var sheet = workBook.getSheetByName(campaignName);\r\n if( ! sheet ){\r\n sheet = workBook.insertSheet(campaignName);\r\n sheet.getRange('A1').setValue(\"Montag\");\r\n sheet.ge...
[ "0.70377314", "0.67018795", "0.6566601", "0.64812267", "0.6447096", "0.63740337", "0.63117224", "0.62722456", "0.6222336", "0.61746454", "0.6168426", "0.61453277", "0.6127083", "0.6112584", "0.6071325", "0.6066322", "0.6064532", "0.6054181", "0.60486984", "0.60396373", "0.601...
0.7072744
0
Generates fake domain entities as if returned by the server. This has to be an AngularJS service so that it's dependencies from the real application can be injected (i.e. AnnotationValueType).
function fakeDomainEntities(AnnotationValueType, AnatomicalSourceType, PreservationTemperatureType, PreservationType, SpecimenType) { var nameCountByEntity = {}; var service = { domainE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getEntities() {\n let _entitiesItems = JSON.parse(JSON.stringify(this._config.entities))\n if (!_entitiesItems || _entitiesItems.length === 0) return\n _entitiesItems.forEach((item) => {\n if (item.entity) {\n const t = item.entity.split(\".\")\n item.i...
[ "0.5486025", "0.5486025", "0.5346626", "0.49913126", "0.49006012", "0.48452488", "0.4833571", "0.47714195", "0.47646362", "0.47033215", "0.46920094", "0.46673352", "0.465396", "0.46517155", "0.46189123", "0.461235", "0.45553678", "0.45204702", "0.45203838", "0.4518421", "0.44...
0.7228697
0
Generates a unique name for a domain entity type. If domain entity type is undefined, then a unique string is generated.
function domainEntityNameNext(domainEntityType) { domainEntityType = domainEntityType || 'string'; if (_.isUndefined(nameCountByEntity[domainEntityType])) { nameCountByEntity[domainEntityType] = 0; } else { nameCountByEntity[domainEntityType]++; } return domainEntityType ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateAUniqueEntityName() {\n const { characters, characterLength } = this.entityNameGeneratorConfig;\n let name;\n do {\n name = \"\";\n for (\n let characterIndex = 0;\n characterIndex < characterLength;\n characterIndex++\n ) {\n name += characters.charAt(\n...
[ "0.71647286", "0.64101684", "0.6319014", "0.6200665", "0.6167307", "0.6150132", "0.60809803", "0.60052085", "0.5887003", "0.58279264", "0.569653", "0.5691957", "0.5688205", "0.5663339", "0.56628877", "0.56141615", "0.5576771", "0.55709195", "0.5568722", "0.55471396", "0.55342...
0.7270346
0
We created the MediaDB in thumbnails.js. Now we need to finish setting it up.
function finishDBInitialization() { // Display a dialog if the DB needs to upgrade before becoming ready photodb.onupgrading = function(evt) { Overlay.show('upgrade'); }; // This is called when DeviceStorage becomes unavailable because the // sd card is removed or because it is mounted for U...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayThumbnails() {\n // thumbnails.js started created thumbanils offscreen.\n // We're ready now to deal with them\n\n // Copy stuff to global variables\n // jshint ignore:start\n thumbnails = Thumbnails.container; // The element that holds the thumbnail\n thumbnailList = Thumbnails....
[ "0.654216", "0.62056285", "0.6089224", "0.60452366", "0.5979606", "0.59587234", "0.5932121", "0.5914343", "0.5829761", "0.58047855", "0.57593405", "0.5758158", "0.57477665", "0.57239294", "0.56731087", "0.56556946", "0.56374687", "0.56082076", "0.56003684", "0.55965036", "0.5...
0.63034946
1
Register a handler for pick and browse activities
function registerActivityHandler() { navigator.mozSetMessageHandler('activity', function activityHandler(a) { var activityName = a.source.name; switch (activityName) { case 'browse': // The user is probably coming to us from the camera, and she probably // wants to see the list of ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webActivityHandler(activityRequest) {\n var activityName = activityRequest.source.name;\n switch (activityName) {\n case 'browse':\n if (launchedAsInlineActivity)\n return;\n // The 'browse' activity is just the way we launch the app\n // There's nothing else to do here.\n setView(thum...
[ "0.6135608", "0.5925668", "0.5862235", "0.57157505", "0.55701137", "0.5526934", "0.5457121", "0.53823584", "0.5348541", "0.53457075", "0.5329331", "0.5311447", "0.52992064", "0.5274851", "0.5273092", "0.51895726", "0.51720387", "0.51579314", "0.51517487", "0.51441187", "0.512...
0.740003
0
Get the thumbnails displayed
function displayThumbnails() { // thumbnails.js started created thumbanils offscreen. // We're ready now to deal with them // Copy stuff to global variables // jshint ignore:start thumbnails = Thumbnails.container; // The element that holds the thumbnail thumbnailList = Thumbnails.list; // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getThumbnails() {\n if (isMobile) {\n loadSingleThumbnails(dayIndex);\n loadThumbCarousel(\"singleThumbnailsContainer\");\n return;\n }\n else {\n if (displaymode == \"D\") { //D - doublepage, S - singlepage\n loadThumbnails(dayIndex);\n lo...
[ "0.73220056", "0.67359525", "0.66000664", "0.65762544", "0.6523396", "0.65217674", "0.6480626", "0.64574194", "0.6430481", "0.6416902", "0.6415016", "0.64078075", "0.6400895", "0.6393277", "0.63632894", "0.63411427", "0.63099605", "0.63051724", "0.6304309", "0.6291254", "0.62...
0.70183176
1
Randomly generates the toberemembered pattern TODO FIXME loading sizes? TODO: Only choose cells that haven't been chosen before and are neighbors of ones that have been chosen. The first cell is chosen randomly. we don't have to do that easy pattern 3x3 grid, make the pattern a straight line option: hardcode the origin...
function generate_random_pattern() { var j; while(generated_tile_ids.length < trial.loading_magnitude) { j = Math.floor(Math.random() * trial.grid_size); // valuex = 'tile_' + j; var index = generated_tile_ids.indexOf(j); if (index == -1) { generated_tile_ids.push(j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePattern() {\n var randomNumber = Math.ceil(Math.random() * 4);\n pattern.push(colors[randomNumber]);\n showMoves();\n}", "function randomizePattern(){\n for(let i=0; i<n;i++){\n pattern[i] = [0,0,0,0,0,0,0,0]\n } // console.log(pattern)\n // console.log(x_index)\n ...
[ "0.7560882", "0.70468545", "0.70262897", "0.684506", "0.6825162", "0.6810713", "0.6785717", "0.6699316", "0.6691604", "0.66466486", "0.6607695", "0.6587668", "0.6585337", "0.6584313", "0.65809554", "0.65670675", "0.6555404", "0.65544546", "0.65165997", "0.64929706", "0.647242...
0.7910702
0
Increment the num_correct and num_total according to round score 1 point for correct, 0.5 point for almost, 0 point for wrong
function change_score(round_score) { num_correct += round_score; num_total += 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcScore(){\n\tfor (var i = 0; i < userPicks.length; i++) {\n\t\tif(userPicks[i] == \"correct\"){\n\t\t\tcounters.updateCorrect();\n\t\t}\n\t\telse{\n\t\t\tcounters.updateIncorrect();\n\t\t}\n\t};\n\n\tif (userPicks.length < 6) {\n\t\tcounters.unanswered = 6 - userPicks.length;\n\t}\n\n}", "function ge...
[ "0.7321124", "0.7280847", "0.7224584", "0.71526444", "0.68725616", "0.67820364", "0.6763947", "0.6748187", "0.6743799", "0.6711507", "0.66856164", "0.6675338", "0.6675338", "0.6675338", "0.6675304", "0.66380996", "0.66281575", "0.6618286", "0.6598495", "0.6570859", "0.6555754...
0.8300266
0
Make GET request to recieve states and populate states
function getStates() { fetch(baseurl, { method: "GET", // *GET, POST, PUT, DELETE, etc. headers: { 'Content-Type': 'application/json' } }) .then(response => response.json()) .then(response => populateStates(response)) .catch(error => console.error('Error:', error)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllState() {\r\n return get('/state/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "function getstates() {\n statusMenu.section(0).title = 'WHA - updating ...';\n statusMenu.show();\n main.hide()...
[ "0.729157", "0.7142607", "0.69061816", "0.6823986", "0.6756618", "0.6592693", "0.6570254", "0.6525316", "0.6443045", "0.6406492", "0.63340527", "0.6280653", "0.62758934", "0.62654626", "0.6253832", "0.623306", "0.6224663", "0.61787874", "0.6103924", "0.6070895", "0.6056752", ...
0.810851
0
Populate State Dropdown with states
function populateStates(states) { let stateDropdown = document.getElementById("stateDropdown"); stateDropdown.innerHTML = ''; // Delete Children console.log(states); for (let i = 0; i < states.length; i++) { let s = document.createElement('option'); s.innerHTML = states[i].business_stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateState() {\n\tvar stateSelect = $(\".us-states\");\n\t$.each(usStates, function() {\n\t\t// creates new option for specific state, then appends into select box\n\t\tvar optionText = \"<option value=\\\"\" + this[\"name\"] + \"\\\">\" + this[\"abbreviation\"] + \"</option>\";\n\t\tstateSelect.append...
[ "0.8113976", "0.7724814", "0.7545694", "0.7542774", "0.7426107", "0.7134979", "0.6955599", "0.6925641", "0.6912846", "0.689595", "0.68786067", "0.6819586", "0.6766913", "0.6756387", "0.6742614", "0.6657369", "0.6634643", "0.6633609", "0.6631802", "0.66093177", "0.6595576", ...
0.7773123
1
Populate City Dropdown with cities
function populateCities(cities) { let cityDropdown = document.getElementById("cityDropdown"), businessList = document.getElementById('businessList'); cityDropdown.innerHTML = ''; // Delete Children businessList.innerHTML = ''; // Reset Business List console.log(cities); for (let i = 0; i <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateCities(data) {\n var selector = document.getElementById('selector-city');\n\n data.forEach(function (item) {\n var option = document.createElement('option');\n option.text = item;\n option.value = item;\n selector.appendChild(option);\n });\n}", "function populateSelect() {\n\t\t\...
[ "0.8119782", "0.7434198", "0.74241525", "0.7389937", "0.7226118", "0.7204277", "0.71718043", "0.70887834", "0.7059969", "0.70057493", "0.6921147", "0.68442893", "0.6722179", "0.66832685", "0.6650721", "0.660874", "0.6604488", "0.6597097", "0.65921533", "0.65688574", "0.655665...
0.77737325
1
Make GET request to update businesses after cityDropdown changes
function getBusinessesEvent(event) { let city = this.value, state = document.getElementById("stateDropdown").value; if (isEmpty(city) || isEmpty(state)) return; fetch(baseurl + state + '/' + city, { method: "GET", // *GET, POST, PUT, DELETE, etc. headers: { 'Con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStateCityData() {\n url = \"https://battuta.medunes.net/api/region/\" + countryCode + \"/all/?key=\" + BATTUTA_KEY + \"&callback=?\";\n let html = `\n <div class=\"searchPage\">\n <nav class=\"navbar navbar-inverse navbar-fixed-top\">\n <div class=\"container-flui...
[ "0.65642107", "0.6453793", "0.6453134", "0.64199275", "0.6257821", "0.6194839", "0.6185742", "0.6148783", "0.61320347", "0.61320347", "0.60984385", "0.60667217", "0.60382795", "0.60366243", "0.6015964", "0.6015189", "0.600657", "0.6005889", "0.59821904", "0.5973805", "0.59543...
0.6684033
0
Gets the palette index by module code. Basically it's the ranking of the mod
function getPaletteIndex(modCode) { return App.addedModules.indexOf(modCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPalette(idx){\n if (idx < 0 || idx > 14){return \"\";}//abort for invalid indexes\n if (this.pattern instanceof ACNHFormat){\n const c = this.pattern.getPalette(idx);\n return \"#\"+toHex(c[0])+toHex(c[1])+toHex(c[2]);\n }\n return ACNLFormat.paletteColors[this.pattern.getPalette(idx)];\n ...
[ "0.60921615", "0.6023275", "0.60129076", "0.57548547", "0.5480724", "0.5419928", "0.5348876", "0.5348876", "0.53029597", "0.52841663", "0.5261581", "0.52382565", "0.52172434", "0.51900405", "0.51814854", "0.51617557", "0.5157573", "0.5134814", "0.5134046", "0.5125548", "0.509...
0.79758394
0
Returns state of the loader
function loaderState(){ return this.isLoader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getState() {\n var state;\n\n state = internal.loader.cache().state();\n state = sys.extend(state, internal.loader.state());\n\n //We rename maxItems to maxPages\n state.maxPages = state.maxItems;\n delete state.maxI...
[ "0.6559751", "0.6413385", "0.6333044", "0.63228846", "0.63228846", "0.63228846", "0.63228846", "0.63228846", "0.6303883", "0.6215771", "0.62157136", "0.6207555", "0.6177867", "0.61605865", "0.61314404", "0.6126759", "0.61191165", "0.6110229", "0.61080974", "0.6107486", "0.606...
0.8148609
0
Incluye la opcion vacia al principio del array
function incluyeOpcionVacia(datos) { var datos2 = new Array(); datos2[0] = ['','']; for (var i=0;i<datos.length;i++) { datos2[i+1] = datos[i]; } return datos2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incluyeOpcionVacia(datos) {\n\tvar datos2 = new Array();\n\tdatos2[0] = ['',''];\n\t\n\tfor (var i=0;i<datos.length;i++) {\n \tdatos2[i+1] = datos[i];\n\t}\n\treturn datos2;\n}", "function incluyeOpcionVacia(datos) {\n\tvar datos2 = new Array();\n\tdatos2[0] = ['',''];\n\t\n\tfor (var i=0;i<datos.len...
[ "0.6896987", "0.6896987", "0.68483794", "0.6696187", "0.6598495", "0.64445186", "0.64170516", "0.6261575", "0.6226633", "0.6199037", "0.6192093", "0.61783624", "0.6167034", "0.61606836", "0.6154952", "0.6151246", "0.61488897", "0.6141224", "0.6141224", "0.6141043", "0.6131092...
0.6948319
0
sort the span IDs by the position
function sortSpanIds(sids) { function compare(a, b) { return((spans[a]['begin'] - spans[b]['begin']) || (spans[b]['end'] - spans[a]['end'])); } sids.sort(compare); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortMarksByOccurences(span, i, spans) {\n if (!span.marks || span.marks.length === 0) {\n return span.marks || [];\n }\n\n var markOccurences = span.marks.reduce(function (occurences, mark) {\n occurences[mark] = occurences[mark] ? occurences[mark] + 1 : 1;\n\n for (var siblingIndex = i + 1; s...
[ "0.6491921", "0.6491921", "0.6312822", "0.6103952", "0.60586476", "0.6053757", "0.6012488", "0.5900632", "0.5877236", "0.5807417", "0.57618934", "0.57413685", "0.57345706", "0.5725266", "0.5717879", "0.5652513", "0.5644718", "0.5641927", "0.5628477", "0.561455", "0.55993235",...
0.7805027
0
set the type of an entity
function setEntityType() { var new_type = $(this).attr('label') var edits = []; $(".entity.ui-selected").each(function() { var eid = this.id; edits.push({action:'change_entity_type', id:eid, old_type:entities[eid].type, new_type:new_type}); }); if (edits.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setType(type) {\n\t\tthis.type = type;\n\t}", "set type(type) {\n this._type = type;\n }", "setType(type) { }", "set type(value) {}", "set_type(new_type){\n if(new_type){\n this.type = new_type;\n }\n else{\n this.invalid();\n }\n }", "setTyp...
[ "0.71333325", "0.7020621", "0.6980245", "0.68519044", "0.6840313", "0.6589235", "0.64091676", "0.62684035", "0.6185267", "0.6094623", "0.5968555", "0.5960473", "0.5908873", "0.58911335", "0.5869603", "0.58156925", "0.57937956", "0.57460725", "0.57379174", "0.5707346", "0.5707...
0.7758811
0
assume the spanIds are sorted by the position. when there are embedded spans, the embedding ones comes earlier then embedded ones.
function renderSpan(sid, spanIds) { var element = document.createElement('span'); element.setAttribute('id', sid); element.setAttribute('title', '[' + sid + '] '); element.setAttribute('class', 'span'); var pid = getPidBySid(sid); var beg = spans[sid].begin; var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortSpanIds(sids) {\n function compare(a, b) {\n return((spans[a]['begin'] - spans[b]['begin']) || (spans[b]['end'] - spans[a]['end']));\n }\n sids.sort(compare);\n }", "function renderEntitiesOfSpanAsso(sid) {\n renderEntitiesOfSpan(sid);\n var c = spanI...
[ "0.7045474", "0.56081355", "0.55611455", "0.55611455", "0.55611455", "0.55438524", "0.55435634", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483", "0.5507483...
0.5941928
1
adjust the beginning position of a span
function adjustSpanBegin(beginPosition) { var pos = beginPosition; while (isNonEdgeCharacter(sourceDoc.charAt(pos))) {pos++} while (!isDelimiter(sourceDoc.charAt(pos)) && pos > 0 && !isDelimiter(sourceDoc.charAt(pos - 1))) {pos--} return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustSpanBegin2(beginPosition) {\n var pos = beginPosition;\n while ((pos < sourceDoc.length) && (isNonEdgeCharacter(sourceDoc.charAt(pos)) || !isDelimiter(sourceDoc.charAt(pos - 1)))) {pos++}\n return pos;\n }", "function getIncrementerStartValue() {\n \n var testSpan = d...
[ "0.6409351", "0.63070744", "0.6257075", "0.6212289", "0.6180254", "0.61122525", "0.6001948", "0.5908446", "0.58764267", "0.5835882", "0.5798058", "0.5798058", "0.5798058", "0.5787679", "0.57869434", "0.5780544", "0.5779774", "0.5761695", "0.57359767", "0.57330453", "0.5722344...
0.688599
0
adjust the end position of a span
function adjustSpanEnd(endPosition) { var pos = endPosition; while (isNonEdgeCharacter(sourceDoc.charAt(pos - 1))) {pos--} while (!isDelimiter(sourceDoc.charAt(pos)) && pos < sourceDoc.length) {pos++} return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustSpanEnd2(endPosition) {\n var pos = endPosition;\n while ((pos > 0) && (isNonEdgeCharacter(sourceDoc.charAt(pos - 1)) || !isDelimiter(sourceDoc.charAt(pos)))) {pos--}\n return pos;\n }", "get end() {\n return this.span.end;\n }", "function addSpan(start, end){\n...
[ "0.6673623", "0.6618513", "0.6199353", "0.61379886", "0.6109228", "0.6109228", "0.6099161", "0.6074388", "0.6074388", "0.5998796", "0.5891885", "0.5862422", "0.5852092", "0.5852092", "0.57870233", "0.5687091", "0.5671457", "0.5656317", "0.56457615", "0.5604222", "0.5602793", ...
0.70646966
0
adjust the beginning position of a span for shortening
function adjustSpanBegin2(beginPosition) { var pos = beginPosition; while ((pos < sourceDoc.length) && (isNonEdgeCharacter(sourceDoc.charAt(pos)) || !isDelimiter(sourceDoc.charAt(pos - 1)))) {pos++} return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustSpanBegin(beginPosition) {\n var pos = beginPosition;\n while (isNonEdgeCharacter(sourceDoc.charAt(pos))) {pos++}\n while (!isDelimiter(sourceDoc.charAt(pos)) && pos > 0 && !isDelimiter(sourceDoc.charAt(pos - 1))) {pos--}\n return pos;\n }", "function getIncrementerS...
[ "0.64909846", "0.59620196", "0.58442664", "0.57927406", "0.5698266", "0.56433916", "0.56433916", "0.5629278", "0.5602932", "0.5596622", "0.5595649", "0.559479", "0.559479", "0.559479", "0.559479", "0.55863446", "0.55863446", "0.55863446", "0.5583761", "0.5551745", "0.5546758"...
0.6147314
1
adjust the end position of a span for shortening
function adjustSpanEnd2(endPosition) { var pos = endPosition; while ((pos > 0) && (isNonEdgeCharacter(sourceDoc.charAt(pos - 1)) || !isDelimiter(sourceDoc.charAt(pos)))) {pos--} return pos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustSpanEnd(endPosition) {\n var pos = endPosition;\n while (isNonEdgeCharacter(sourceDoc.charAt(pos - 1))) {pos--}\n while (!isDelimiter(sourceDoc.charAt(pos)) && pos < sourceDoc.length) {pos++}\n return pos;\n }", "function addSpan(start, end){\n // spans mu...
[ "0.6667947", "0.60151386", "0.6002323", "0.6002323", "0.5824688", "0.57396203", "0.57354045", "0.5656677", "0.5575698", "0.5575698", "0.5575698", "0.5575698", "0.55731463", "0.5572892", "0.5556579", "0.5543133", "0.54819083", "0.54692733", "0.5433899", "0.5432427", "0.5432006...
0.63459605
1
get the max value of the connector Id
function getMaxConnId() { var maxIdNum = 0; for (var rid in relations) { var idNum = parseInt(rid.slice(1)); if (idNum > maxIdNum) { maxIdNum = idNum; } } return maxIdNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getMaxid() {\n const res = await query(\n `SELECT id FROM counters WHERE id=(SELECT max(id) FROM counters)`\n );\n console.log(\"max id result\", res.rows[0].id);\n return { success: true, payload: res.rows[0].id };\n}", "get max() {\r\n return this._max\r\n }", "get max() {\n ...
[ "0.70064104", "0.6647491", "0.66146314", "0.6568573", "0.6564694", "0.65303236", "0.65303236", "0.65303236", "0.65303236", "0.65303236", "0.65303236", "0.6511644", "0.65084803", "0.64911014", "0.6488972", "0.6468563", "0.6429332", "0.64242744", "0.64194953", "0.63616055", "0....
0.70560074
0
get the max value of the entity Id
function getMaxEntityId() { var maxIdNum = 0; for (var eid in entities) { var idNum = parseInt(eid.slice(1)); if (idNum > maxIdNum) { maxIdNum = idNum; } } return maxIdNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getMaxid() {\n const res = await query(\n `SELECT id FROM counters WHERE id=(SELECT max(id) FROM counters)`\n );\n console.log(\"max id result\", res.rows[0].id);\n return { success: true, payload: res.rows[0].id };\n}", "async function getMaxTodoId() {\n const res = await query(\n `SEL...
[ "0.69800055", "0.67759246", "0.67180794", "0.6654381", "0.6644777", "0.66445553", "0.661593", "0.661593", "0.6581112", "0.657853", "0.65761817", "0.6572569", "0.65661126", "0.6566084", "0.6541537", "0.650378", "0.6498328", "0.6498328", "0.6498328", "0.6498328", "0.6498328", ...
0.79134405
0
dismiss the default selection by the browser
function dismissBrowserSelection() { if (window.getSelection){ var selection = window.getSelection(); selection.collapse(document.body, 0); } else { var selection = document.selection.createRange(); selection.setEndPoint("EndToStart", selection); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unselectText() {\n window.getSelection().empty();\n}", "function removeSelectDefault() {\n\t\"use strict\";\n\tsizeSelector.selectedIndex = -1;\n}", "function removeSelectionHighlight() {\r\n hideSelectionRect();\r\n hideRotIndicator();\r\n }", "unselectText_() {\n try {\n ...
[ "0.7220448", "0.7082815", "0.7078367", "0.7019912", "0.69681823", "0.694936", "0.68736744", "0.6860183", "0.6849849", "0.6836399", "0.67695826", "0.67577493", "0.6746084", "0.6742501", "0.670496", "0.6701268", "0.66991895", "0.66977143", "0.6647508", "0.66214114", "0.66085315...
0.80651444
0
'Replicate Auto' button control
function enableButtonReplicateAuto() { $("#btn_replicate_auto").off('click', pushButtonReplicateAuto).on('click', pushButtonReplicateAuto); renderButtonEnable($("#btn_replicate_auto")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ButtonControl() {\n}", "addReplayButton() {\n this.interface.gui.add(this.gameOrchestrator, 'replayMoves').name('Replay Moves');\n }", "makeReverbRouteButton() {\n this.reverbRouteActive = false;\n this.reverbRouteButton = createButton('DELAY -> VERB');\n this.reverbRouteButto...
[ "0.60541755", "0.60275435", "0.593549", "0.5841923", "0.5756648", "0.57245797", "0.56331396", "0.5621275", "0.55948204", "0.55941117", "0.557973", "0.55753636", "0.55677253", "0.5554581", "0.55499214", "0.5543209", "0.55413795", "0.55386996", "0.55349797", "0.55224323", "0.55...
0.77445656
0
render the entities of a given span and dependent spans.
function renderEntitiesOfSpanAsso(sid) { renderEntitiesOfSpan(sid); var c = spanIds.indexOf(sid) for (var p = c - 1; isSpanEmbedded(spans[spanIds[c]], spans[spanIds[p]]); p--) renderEntitiesOfSpan(spanIds[p]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(){\n var i = spans.length,\n span;\n while (i-- > 0) {\n span = spans[i];\n renderSpan(span.start, span.end);\n }\n}", "function renderSpan(sid, spanIds) {\n var element = document.createElement('span');\n element.setAttribute('id', sid);\n element.s...
[ "0.72408664", "0.65807533", "0.5955769", "0.5833293", "0.56032336", "0.5435693", "0.5393679", "0.52768296", "0.523906", "0.52375937", "0.5234203", "0.52004653", "0.51888967", "0.5159771", "0.51404214", "0.5122814", "0.5105356", "0.5101732", "0.5093484", "0.5034531", "0.501297...
0.68923986
1
render the entity pane of a given span and its dependent spans.
function renderEntityPaneAsso(sid) { renderEntityPane(sid); // see if the pane of the parent node needs to be updated var pnode = document.getElementById(sid).parentElement; while (pnode && pnode.id && spans[pnode.id]) { renderEntityPaneAsso(pnode.id); pnode = pn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(){\n var i = spans.length,\n span;\n while (i-- > 0) {\n span = spans[i];\n renderSpan(span.start, span.end);\n }\n}", "function renderSpan(sid, spanIds) {\n var element = document.createElement('span');\n element.setAttribute('id', sid);\n element.s...
[ "0.6434716", "0.62751335", "0.60520524", "0.58595943", "0.54493487", "0.5377836", "0.5354887", "0.5351636", "0.5254234", "0.5229379", "0.5170953", "0.5161768", "0.5081798", "0.5066524", "0.5066524", "0.5001325", "0.49822778", "0.49686623", "0.4964813", "0.49522865", "0.487698...
0.6561414
0
event handler (entity is clicked)
function entityClicked(e) { var id = $(this).attr('id'); if (mode == "span") { // if (isCtrl) { if (e.ctrlKey) { if (isEntitySelected(id)) {deselectEntity(id)} else {selectEntity(id)} } else { clearSpanSelec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "fun...
[ "0.7452958", "0.7452958", "0.69942033", "0.6789969", "0.66973966", "0.66630137", "0.6645839", "0.66189677", "0.65914094", "0.6544147", "0.6539933", "0.6527327", "0.65070975", "0.65055776", "0.6462834", "0.64313513", "0.6424489", "0.64016014", "0.6398716", "0.6395645", "0.6377...
0.755219
0
Calculate the projected weight based on the anchor date and percentage change
function calculateProjectedWeight() { const anchorDate = anchorDateInput.value; const projectionLength = parseInt(projectionLengthSelect.value); if (!anchorDate) { return; } const percentages = [-0.01, -0.005, 0.005, 0.01]; const projectedData = percentages.map(() => []); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function weightFn(a, b, props) {\n var d = distance(point(a), point(b)) * 1000 / 100, // /100 is to normalize between [0,1]\n forwardSpeed,\n backwardSpeed,\n risk = 0.01 + props.crash,\n alpha = L.alpha;\n\n forwardSpeed = backwardSpeed = 30; // Simplification: we assume same spe...
[ "0.5828263", "0.5797617", "0.563792", "0.54998296", "0.5490209", "0.52522343", "0.5234612", "0.5207353", "0.5205617", "0.5203883", "0.5184134", "0.51746887", "0.5172994", "0.5167411", "0.5154961", "0.5130341", "0.50954956", "0.50685024", "0.5050937", "0.49936152", "0.49922732...
0.7692696
0
This function is executed every second to keep track of the global timer and switch exercises when the current exercise timer gets to zero
function countUp(){ if (currentExercise !== "Get set!"){ globalTime++; $(".global").html(timeConverter(globalTime)); } if (timerTime === 8 && currentTimer + 1 < chosenTimers.length && currentTimer !== 0){ var nextExerciseName = exerciseNames[currentTimer + 1] if(nextExerciseName==="Rest"){ r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTimer() {\n var startTimer = setInterval(() => {\n if (timer > 0) {\n timerEl.textContent = \"Time: \" + timer;\n timer--;\n } else if (timer === 0) {\n clearInterval(startTimer);\n endQuiz();\n } else if (timer < 0) {\n clearInterval(startTimer);\...
[ "0.678713", "0.6732701", "0.6601439", "0.6509005", "0.64925325", "0.6444847", "0.6429176", "0.6395068", "0.6372633", "0.6369451", "0.6344245", "0.6339737", "0.63300526", "0.632741", "0.6327336", "0.63008195", "0.6287488", "0.6263504", "0.6259363", "0.62566954", "0.625316", ...
0.74599487
0
while a is not equal to b do increase a by 1 decrease b by 1 Example For a = 2 and b = 6, the output should be isInfiniteProcess(a, b) = false; For a = 2 and b = 3, the output should be isInfiniteProcess(a, b) = true.
function isInfiniteProcess(a, b) { if ( a > b ) return true; else if ( a % 2 !== b % 2 ) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInfiniteProcess(a, b) {\r\n if(a>b){\r\n return true;\r\n }\r\n if((b-a)%2 == 0){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "function isFibo(a,b,f) {\n var c = a+b\n var prior =b\n while( c<f){\n b=c\n c+=prior //b+c, what is the new ...
[ "0.82290965", "0.58720076", "0.5469297", "0.5445927", "0.5272244", "0.5230605", "0.5209544", "0.5205086", "0.51935077", "0.5163352", "0.5108824", "0.51033634", "0.5082314", "0.5082314", "0.5082314", "0.5072868", "0.5040447", "0.5001288", "0.49964154", "0.49789307", "0.4963149...
0.80326116
1
Get the next item in the list based on the index of the given item.
function findNextOnItem(list, item) { var index = findIndexByItem(list, item); var nextIndex = index + 1; if (nextIndex >= list.length) { return null; } return list[nextIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextItem(xs, item) {\n let foundState = false;\n\n // foundState will be false until the item is seen. When that happens, we \n // iterate one more time then return the item after.\n for(let x of xs) {\n if(foundState)\n return x;\n\n if(x == item)\n foundState = true;\n }\n\n return...
[ "0.7044267", "0.69502056", "0.6567719", "0.6428443", "0.64187086", "0.63360876", "0.631965", "0.62974745", "0.6230913", "0.6201851", "0.6198181", "0.61950433", "0.61849236", "0.6166805", "0.61558247", "0.61253643", "0.6115644", "0.6114735", "0.6104858", "0.6085827", "0.608376...
0.807788
0
import FocusInput from './components/FocusInput'; import HookTimer from './components/HookTimer'; import Counter from './components/Counter'; import DataFetching from './components/DataFetching'; import Ani from './components/Ani' import HookCount from './components/HookCount'; import IntervalTimer from './components/I...
function App() { return ( <div className="App"> {/* <Hoek /> */} {/* <Ani /> */} {/* <IntervalTimer /> */} {/* <DataFetching /> */} {/* <Counter /> */} {/* <FetchData /> */} {/* <FocusInput /> */} {/* <HookTimer /> */} <DocOne /> <DocTwo /> {/* <Ho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div className=\"App\">\n {/* <HookCounter></HookCounter> */}\n {/* <Select1></Select1> */}\n {/* <SelectMultiple></SelectMultiple> */}\n {/* <test></test> */}\n {/* <VotingSystem></VotingSystem> */}\n{/* <RegistrationForm></RegistrationForm> */}\n ...
[ "0.62010765", "0.6096937", "0.60396826", "0.59828496", "0.58399844", "0.5710377", "0.5631302", "0.5628687", "0.55589217", "0.55512714", "0.5464841", "0.54610395", "0.54381365", "0.5435555", "0.5434996", "0.54143804", "0.5406358", "0.53989214", "0.5388772", "0.5371093", "0.536...
0.6126222
1
destroy a random card in target's board
function destroyRandom(state, target) { let board = state.board.get(target); let card = board.get(Math.floor(Math.random() * board.size)); if (!card) { return state; } return clearDeadCards(updateCard( state, card.id, card => { return { ...card, health: 0, }; })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dealCard(){\n let randChoice = Math.trunc(Math.random()*this._cards.length);\n let cardDealt = this._cards[randChoice];\n this._cards.splice(randChoice, 1);\n return cardDealt;\n }", "function drawRandomCard() {\n var drawnCard;\n var cardNum = Math.floor(Math.random() * deck...
[ "0.67848563", "0.67648244", "0.66343975", "0.65968853", "0.6551413", "0.65482384", "0.6510616", "0.6467618", "0.646018", "0.6455571", "0.64552766", "0.64502454", "0.64327914", "0.6412873", "0.64020866", "0.63849556", "0.6384278", "0.6334098", "0.63129455", "0.6295729", "0.629...
0.8146171
0
add movie to user likes
function userLikesMovie(userId, movie) { var deferred = q.defer(); // find the user UserModel.findById(userId, function (err, doc) { if (err) { deferred.reject(err); } else { // add movie id to user likes doc.likes.push(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertMovieIntoWatched(user, movie) {\n\n findOne(user, function (err, account) {\n if (err) throw err;\n console.log('this user is', user)\n account.watched.unshift(movie);\n account.save();\n // console.log(account.watched);\n // console.log('adding movie: ', movie)\n // console.lo...
[ "0.6964542", "0.66832495", "0.6514678", "0.6413285", "0.62420887", "0.6168033", "0.6162629", "0.6083231", "0.60564935", "0.6036704", "0.6003379", "0.6002469", "0.5968916", "0.59522873", "0.59476715", "0.5945546", "0.59308344", "0.5874445", "0.5844155", "0.5820912", "0.5811150...
0.7163173
0
By default changes will only be saved offline and when synced they will be stored online
function saveChanges(online) { if (online) { return manager.saveChanges(); } else { $log.log('save to local storage'); return putDataOffline(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function offlineMode () {\n if (localStorage.notes) {\n let parsedNotes = JSON.parse(localStorage.getItem('notes'));\n note._id = Math.floor(Math.random() * 100);\n\n if (localStorage.createNotes === undefined) {\n localStorage.setItem('createdNotes', JSON.stringify([note]));\n ...
[ "0.6780537", "0.650782", "0.63721323", "0.63483363", "0.631711", "0.63009167", "0.62986875", "0.6291973", "0.62075377", "0.62055045", "0.6199121", "0.6188659", "0.6187146", "0.6186715", "0.61782837", "0.6167375", "0.6164694", "0.6156542", "0.6156437", "0.61475086", "0.6139126...
0.70992434
0
Filter out addedObras from availableObras comparing their key and id
filterObras(allObras = [], selectedObras = []) { return allObras.filter(obra => { // Find if the obra is in addedObras return selectedObras.find( selectedObra => selectedObra.id === obra.key) === undefined ? true : false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function objectFilter(o) {\n return !isReenact || o.id < clientIDSpace;\n }", "function objectFilter(o) {\n return !isReenact || o.id < clientIDSpace;\n }", "borrarPersona(id) {\n\n let personaBorrada = this.getPersonaById(id);\n\n this.personas = this.pers...
[ "0.589038", "0.5802344", "0.5449839", "0.53805625", "0.52161837", "0.5211442", "0.52091086", "0.51969683", "0.51861924", "0.518486", "0.51296425", "0.5079634", "0.5079331", "0.5052875", "0.50357574", "0.5033277", "0.5025897", "0.50160396", "0.5010169", "0.49898967", "0.496906...
0.7720585
0
/ Quote Post insertion
function quotePost(postid, intro, rte) { toggleLayer('sfentryform'); var postcontent = document.getElementById(postid).innerHTML; document.addpost.newtopicpost.value = '<blockquote>'+intro+postcontent+'</blockquote><hr />'; if (rte) { tinyMCE.getInstanceById('mce_editor_0').getBody().innerHTML = '<blockquote>'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertPlQuotes(editor) {\n\tvar selectedHtml = \"\";\n\tvar selection = editor.getSelection();\n\tif (selection) {\n\t\tselectedHtml = getSelectionHtml(selection);\n\t}\n\teditor.insertHtml('„' + selectedHtml + '”');\n}", "function sfjquotePost(postid, intro, rte)\n{\n\tsfjtoggleLayer('sfpostform');\t\n...
[ "0.64733285", "0.6448087", "0.6417502", "0.6407648", "0.63988984", "0.6351312", "0.62463075", "0.61102384", "0.60664815", "0.60506064", "0.5976027", "0.5969277", "0.5852212", "0.5852212", "0.5852212", "0.5852212", "0.583392", "0.5781266", "0.57657796", "0.5736756", "0.5731627...
0.6507302
0
Function to build search table body
function buildSearchBody(data) { let rows = ``; for (let i = 0; i < data[0].length; i++) { rows += `<tr id="filter_col${i + 1}" data-column="${i + 1}">`; rows += `<td>Column - ${data[0][i]}</td>`; rows += `<td align="center"><input type="text" class="column_filter" id="col${i + 1}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable(search_data) { \n $tbody.innerHTML = \"\";\n for (var i = 0; i < search_data.length; i++) {\n \n var sighting = search_data[i];\n var fields = Object.keys(sighting);\n \n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j...
[ "0.69177586", "0.67591625", "0.66852975", "0.6320804", "0.6285484", "0.619972", "0.6170234", "0.6170001", "0.6161618", "0.6135872", "0.6104806", "0.6102674", "0.60913837", "0.60522527", "0.6043079", "0.6033188", "0.6031923", "0.60279477", "0.60239846", "0.6019883", "0.6008549...
0.78650475
0
Function to render search table
function renderSearch(data) { const body = buildSearchBody(data); const searchTable = ` <table cellpadding="3" cellspacing="0" border="0" style="width: 50%; margin: 0 auto 2em auto;"> <thead> <tr> <th>Target</th> <th>Search text</th> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable(search_data) { \n $tbody.innerHTML = \"\";\n for (var i = 0; i < search_data.length; i++) {\n \n var sighting = search_data[i];\n var fields = Object.keys(sighting);\n \n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j...
[ "0.80135137", "0.72403264", "0.716122", "0.69910556", "0.68553305", "0.68346554", "0.6807197", "0.6774524", "0.67222077", "0.6669925", "0.6668539", "0.6648837", "0.6647959", "0.66234684", "0.6596715", "0.65936893", "0.6558261", "0.6541271", "0.65357995", "0.65172666", "0.6512...
0.78532743
1
Function to build main table header
function buildTableHeader(data) { let rows = `<tr>`; rows += `<th>Index</th>`; for (let i = 0; i < data[0].length; i++) { rows += `<th>${data[0][i]}</th>`; } rows += `</tr>`; return rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_thead() {\n var schema = _store.active_columns();\n var total = _store.active_rows()['total'];\n var html = [ '<tr>' ];\n\n // create header\n schema.forEach( function ( column ) {\n html.push( '<td class=\"', column['key'], ' ' );\n html.pus...
[ "0.77078533", "0.7615221", "0.7613789", "0.75498426", "0.7549432", "0.7475478", "0.74600047", "0.745579", "0.7393476", "0.7379344", "0.73792845", "0.7371347", "0.73648506", "0.73375845", "0.7334948", "0.73287004", "0.73234653", "0.7321538", "0.7311472", "0.7310505", "0.730736...
0.7729547
0
Function to update index column with original row number
function addRowIndex() { const table = $('#main').DataTable(); table.rows().every( function ( rowIdx, tableLoop, rowLoop ) { const data = this.data(); data[0] = rowIdx + 1; this.data(data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRowInd(index)\r\n{\r\n _nColLibRow = index;\r\n}", "function setRowNumber() {\n $self.find('td.js-row-no').each(function (i) {\n i = i + 1;\n $(this).text(i);\n });\n }", "function ResetRowNumber(grd) {\n var items = grd.getData()...
[ "0.7349474", "0.6724737", "0.6602101", "0.65771127", "0.6445292", "0.6348286", "0.63238794", "0.6269464", "0.6227168", "0.62107795", "0.6195427", "0.6187574", "0.6168704", "0.61637396", "0.6153176", "0.6151935", "0.6125299", "0.61202765", "0.60454005", "0.6032101", "0.602645"...
0.68035984
1
Functon to add links to toggle column visibility
function addToggleLinks() { const table = $('#main').DataTable(); let headers = []; table.columns(':visible').every( function () { let header = $(this.header()).text(); headers.push(`<a class="toggle-vis" data-column="${this.index()}">${header}</a>`); }) headers.shift(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setExpandables()\r\n{\r\n //Added document readiness to set classes if the link toggles\r\n $(document).ready(function()\r\n {\r\n $(\".toggleVisibility\").each(function()\r\n {\r\n var link = $(this);\r\n var toggleAction;\r\n var targetElement;\r\n var targetElementId = $(this).attr(\"name\");...
[ "0.69793195", "0.6899984", "0.6597798", "0.6575787", "0.64577574", "0.6355747", "0.63366574", "0.63363415", "0.6264702", "0.62235194", "0.6222485", "0.6177232", "0.61318743", "0.6122077", "0.6109739", "0.6093015", "0.606896", "0.606896", "0.6064358", "0.6012169", "0.6007734",...
0.8362448
0
Get the city ID
function getCityID(street_id, city, country, postalcode, housenumber, callback) { var city_id; $.get(local + '/cities/exists/'+city, function(result) { if(result.length == 0) { var values = { city: city }; $.post(local + '/cities/create', JSON.stringify(values...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findId(name) {\n const cityId = cities.filter(city => city.location === name);\n return cityId[0].id;\n}", "function getCityId(city, date) {\n const apiUrl = `https://api.songkick.com/api/3.0/search/locations.json?query=${city}&apikey=lKGlBIRmnawI3yka`;\n\n fetch(apiUrl)\n .then(response ...
[ "0.7258705", "0.72418165", "0.71998835", "0.68064815", "0.6721577", "0.66522676", "0.643105", "0.6323456", "0.6317215", "0.6258228", "0.62527186", "0.62171185", "0.61928767", "0.61753464", "0.61444056", "0.6138698", "0.6137529", "0.612594", "0.609225", "0.60808164", "0.603286...
0.74879766
0
Get the country ID
function getCountryID(street_id, city_id, country, postalcode, housenumber, callback) { var country_id; $.get(local + '/countries/exists/'+country, function(result) { if(result.length == 0) { var values = { country: country }; $.post(local + '/countries/create...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countryCode(country)\r\n{\r\n // Placeholder waarde\r\n var code = 'xxx';\r\n \r\n // Itereer over de hele nested array in countries.js (database)\r\n for (var i = 0; i < country_codes.length; i++)\r\n {\r\n \t// Vergelijk om te kijken of het land in countries.js voorkomt\r\n i...
[ "0.73268545", "0.691581", "0.6891499", "0.68639094", "0.66462827", "0.6634528", "0.6571495", "0.6524549", "0.6392192", "0.6369782", "0.6361596", "0.6321976", "0.6307564", "0.627906", "0.6275878", "0.6275878", "0.6275878", "0.6275878", "0.6269348", "0.6267514", "0.62376446", ...
0.6942424
1
Set max number of players per room
function setPlayersPerRoom( nb ){ playersPerRoom = nb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setmaxNumberOfQuestions() { \n maxNumberOfQuestions = 60;\n}", "set nTeams(value) {\n while (this.teams.length < value) {\n let maxId = 0;\n this.teams.forEach(t=>{maxId=(maxId>t.id?maxId:t.id)});\n maxId += Math.floor((Math.random() * 100) + 1);\n this.teams...
[ "0.65134585", "0.6424521", "0.6082765", "0.5836702", "0.57865196", "0.574747", "0.5669107", "0.56541955", "0.5646013", "0.5620766", "0.5568416", "0.5565175", "0.5497689", "0.5493112", "0.54654497", "0.54608494", "0.5447932", "0.5439906", "0.54281235", "0.54225886", "0.5417688...
0.7876597
0
Compte le nombre de joueurs dans une room
function getRoomPlayersNumber( roomName ){ let room = io.sockets.adapter.rooms[roomName]; return (room === undefined)? 0 : room.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJoinedRoom(name)\n{\n var room_count = room.rooms.length\n for (var i = 0; i < room_count ; i++)\n {\n var r = room.getRoomById(room.rooms[i].id)\n if (r)\n {\n var p = r.isWaiting(name)\n if (p) // le joueur est inscrit dans cette room\n {...
[ "0.62626714", "0.61454797", "0.60536855", "0.5897463", "0.5707941", "0.5701247", "0.56890893", "0.5681843", "0.55640084", "0.55526304", "0.5460419", "0.5446464", "0.5432292", "0.5403039", "0.53819543", "0.5339525", "0.5321768", "0.5281209", "0.5279564", "0.5270902", "0.526150...
0.6282962
0
checks if room is full
function isFull(roomName){ return getRoomPlayersNumber(roomName) === playersPerRoom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFull() {\n return this.length() === this.capacity;\n }", "function isFull(position)\n{\n\treturn(board[position]==null);\n}", "function hasLeft(room) {\n var time = getRelativeTime(room, -4);\n if (time['nh'] > time['h']) {\n return true;\n } else if (time['nh'] === time['h'] && tim...
[ "0.7178595", "0.6934147", "0.68823653", "0.68261826", "0.68208075", "0.6766149", "0.6665995", "0.65382683", "0.6469754", "0.64375037", "0.6428586", "0.6402456", "0.63618404", "0.6346914", "0.6345128", "0.6282214", "0.62674433", "0.62334603", "0.6227439", "0.62237126", "0.6216...
0.76286095
0
Toggles search input focus/blur for style changes
function toggleSearchInputFocus() { ctrl.isSearchInputFocused = !ctrl.isSearchInputFocused; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusSearchBarOff(){\n searchContainer.style.boxShadow = \"\";\n searchContainer.style.borderColor= \"\";\n}", "function onSearchFocus() {\n if (activeSearch) {\n searchButton.className = \"pivot_searchbtn\"\n // pop up the suggestions as if we had pressed a key\n onSearchKeyPre...
[ "0.70644444", "0.7047729", "0.7016175", "0.6948191", "0.68689865", "0.6830543", "0.6789112", "0.67870516", "0.67870516", "0.67448926", "0.6720445", "0.667882", "0.66653836", "0.6656118", "0.6641137", "0.66334313", "0.66300267", "0.6612349", "0.6595038", "0.655891", "0.6545337...
0.82870233
0
Sets a new state to the viewvalue, which is an array of strings corresponding to the checked options
function updateViewValue() { var newViewValue = ctrl.groups ? {} : []; if (ctrl.groups) { lodash.forEach(ctrl.optionList, function (group, key) { var checkedItems = lodash.filter(group.options, 'checked'); group.allItemsChecked = checkedI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateChecked(state, checked) {\r\n state.checked = checked;\r\n }", "function setChecked(newArr, oldArr) {\n scope.checked = contains(newArr, value);\n }", "function setState(value) {\n state = value;\n appView.filterAll();\n }", "onChange(id){\n\t var tempA...
[ "0.6412371", "0.6296965", "0.6275775", "0.61751735", "0.6142095", "0.60288316", "0.596658", "0.5951946", "0.593959", "0.5925877", "0.59138614", "0.5909559", "0.58756286", "0.5859542", "0.5859542", "0.5859542", "0.5859542", "0.5859542", "0.5859542", "0.5859542", "0.58411396", ...
0.6648275
0
Ties up the contact data coming from CMDB to something expected by the templates
function cleanContact(contact, programmeList) { contact.id = contact.dataItemID; if (!contact.hasOwnProperty('name')) { contact.name = contact.id } delete contact.dataItemID; delete contact.dataTypeID; // look for relationships contact.xxx.[..,..,..] - but they should only be the rever...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateContacts(contacts) {\n\t\tfor(var i = 0; i < contacts.length; i++){\n\t\t\tvar node = template.cloneNode(true);\n\t\t\tnode.id = contacts[i].id;\n\t\t\tvar str = node.innerHTML.replace(\"1\", i+1);\n\t\t\tnode.innerHTML = str;\n\t\t\tvar str2 = node.innerHTML.replace(/index/g, i + node.id);\n\t\t\...
[ "0.6177776", "0.6089895", "0.6055916", "0.5985605", "0.590595", "0.58768594", "0.58598983", "0.5829432", "0.5789145", "0.57886875", "0.57713884", "0.5724939", "0.571165", "0.5706703", "0.56851226", "0.5654704", "0.5647725", "0.56453246", "0.5635528", "0.56313133", "0.56265223...
0.6571023
0
Examine a declaration (for example, of a class or function) and return metadata about any decorators present on the declaration.
getDecoratorsOfDeclaration(declaration) { const symbol = this.getClassSymbol(declaration); if (!symbol) { return null; } return this.getDecoratorsOfSymbol(symbol); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "acquireDecoratorInfo(classSymbol) {\n const decl = classSymbol.declaration.valueDeclaration;\n if (this.decoratorCache.has(decl)) {\n return this.decoratorCache.get(decl);\n }\n // Extract decorators from static properties and `__decorate` helper calls, then merge them\n ...
[ "0.62944275", "0.6024522", "0.5822833", "0.5725965", "0.5719475", "0.56053805", "0.55794257", "0.55692756", "0.5549904", "0.5458815", "0.54372597", "0.54372597", "0.54372597", "0.54372597", "0.5432289", "0.5310339", "0.5306922", "0.52772695", "0.5183242", "0.51720226", "0.517...
0.6729657
0
Reflect over the constructor of a class and return metadata about its parameters. This method only looks at the constructor of a class directly and not at any inherited constructors.
getConstructorParameters(clazz) { const classSymbol = this.getClassSymbol(clazz); if (!classSymbol) { throw new Error(`Attempted to get constructor parameters of a non-class: "${clazz.getText()}"`); } const parameterNodes = this.getConstructorParameterDeclarations(classSymbol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getConstructorParamInfo(classSymbol, parameterNodes) {\n const { constructorParamInfo } = this.acquireDecoratorInfo(classSymbol);\n return parameterNodes.map((node, index) => {\n const { decorators, typeExpression } = constructorParamInfo[index] ?\n constructorParamInfo[inde...
[ "0.6770649", "0.59713143", "0.59091735", "0.5770903", "0.57395947", "0.573381", "0.5702164", "0.56313044", "0.5355748", "0.5339394", "0.5271856", "0.52567744", "0.52465457", "0.5222787", "0.52019626", "0.5187766", "0.5151033", "0.5122526", "0.51101905", "0.50954854", "0.50880...
0.6577541
1
Trace an identifier to its declaration, if possible. This method attempts to resolve the declaration of the given identifier, tracing back through imports and reexports until the original declaration statement is found. A `Declaration` object is returned if the original declaration is found, or `null` is returned other...
getDeclarationOfIdentifier(id) { const superDeclaration = super.getDeclarationOfIdentifier(id); // If no declaration was found, return. if (superDeclaration === null) { return superDeclaration; } // If the declaration already has traits assigned to it, return as is. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveAliasedClassIdentifier(declaration) {\n this.ensurePreprocessed(declaration.getSourceFile());\n return this.aliasedClassDeclarations.has(declaration) ?\n this.aliasedClassDeclarations.get(declaration) :\n null;\n }", "getDeclarationOfSymbol(symbol, originalId) {\n ...
[ "0.61599964", "0.61424243", "0.5822731", "0.5377063", "0.5364877", "0.536074", "0.52106756", "0.5203043", "0.5079485", "0.50698596", "0.50052506", "0.50052506", "0.49903005", "0.49491203", "0.49380016", "0.48269835", "0.4740835", "0.46909454", "0.4689566", "0.4687691", "0.468...
0.70429254
0
Gets all decorators of the given class symbol. Any decorator that have been synthetically injected by a migration will not be present in the returned collection.
getDecoratorsOfSymbol(symbol) { const { classDecorators } = this.acquireDecoratorInfo(symbol); if (classDecorators === null) { return null; } // Return a clone of the array to prevent consumers from mutating the cache. return Array.from(classDecorators); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDecoratorsOfDeclaration(declaration) {\n const symbol = this.getClassSymbol(declaration);\n if (!symbol) {\n return null;\n }\n return this.getDecoratorsOfSymbol(symbol);\n }", "getMembersOfSymbol(symbol) {\n const members = [];\n // The decorators map c...
[ "0.61108404", "0.6085048", "0.60311735", "0.57067406", "0.5408994", "0.53322315", "0.5311988", "0.53055966", "0.5268892", "0.5268892", "0.50598544", "0.50240564", "0.5016201", "0.50128424", "0.5005922", "0.49458498", "0.49103492", "0.49103492", "0.49044147", "0.4886257", "0.4...
0.7445463
0
Search the given module for variable declarations in which the initializer is an identifier marked with the `PRE_R3_MARKER`.
getSwitchableDeclarations(module) { // Don't bother to walk the AST if the marker is not found in the text return module.getText().indexOf(PRE_R3_MARKER) >= 0 ? findAll(module, isSwitchableVariableDeclaration) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preDeclareHoisted(scope, node) {\n node.traverseTopDown(\n // var bla;\n 'VarDecl(x)', function(b, node) {\n node.setAnnotation(\"scope\", scope);\n scope.declare(b.x.value, b.x, PROPER);\n return node;\n },\n ...
[ "0.5091909", "0.5049267", "0.49740162", "0.49275267", "0.49056384", "0.47755507", "0.47696143", "0.4724772", "0.47180343", "0.4711796", "0.4711796", "0.46964973", "0.46946546", "0.46946546", "0.46685448", "0.46674258", "0.4646335", "0.4642894", "0.46306872", "0.46250105", "0....
0.5644678
0
Find all toplevel class symbols in the given file.
findClassSymbols(sourceFile) { const classes = new Map(); this.getModuleStatements(sourceFile) .forEach(statement => this.addClassSymbolsFromStatement(classes, statement)); return Array.from(classes.values()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClassMap() {\n return this.cache.getOrAdd('classMap', () => {\n const map = new Map();\n this.enumerateBrsFiles((file) => {\n var _a;\n if ((0, reflection_1.isBrsFile)(file)) {\n for (let cls of file.parser.references.classStatements)...
[ "0.5601337", "0.5075797", "0.49416706", "0.48451626", "0.4775744", "0.47756392", "0.4765684", "0.47016096", "0.46969798", "0.4653443", "0.46221596", "0.45638698", "0.45638698", "0.45638698", "0.45638698", "0.45625165", "0.45513454", "0.45422667", "0.4536226", "0.45178458", "0...
0.69327044
0
Get the number of generic type parameters of a given class.
getGenericArityOfClass(clazz) { const dtsDeclaration = this.getDtsDeclaration(clazz); if (dtsDeclaration && ts.isClassDeclaration(dtsDeclaration)) { return dtsDeclaration.typeParameters ? dtsDeclaration.typeParameters.length : 0; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countClasses(classes) {\n return classes.length\n}", "function count()\n {\n var count = 0;\n for(var t in templates){\n count += templates[t].count();\n }\n return count;\n }", "function countPassengersInClass(data, pclass) {...
[ "0.5885284", "0.53436697", "0.5288281", "0.52261454", "0.5200689", "0.51976824", "0.5112044", "0.51115143", "0.5101364", "0.50868165", "0.5082398", "0.50565165", "0.50365627", "0.5030771", "0.5020823", "0.5003732", "0.50034213", "0.49941555", "0.4969762", "0.49672982", "0.495...
0.7664219
0
Take an exported declaration of a class (maybe downleveled to a variable) and look up the declaration of its type in a separate .d.ts tree. This function is allowed to return `null` if the current compilation unit does not have a separate .d.ts tree. When compiling TypeScript code this is always the case, since .d.ts f...
getDtsDeclaration(declaration) { if (this.dts === null) { return null; } if (!isNamedDeclaration(declaration)) { throw new Error(`Cannot get the dts file for a declaration that has no name: ${declaration.getText()} in ${declaration.getSourceFile().fileName}`); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDeclarationOfIdentifier(id) {\n const superDeclaration = super.getDeclarationOfIdentifier(id);\n // If no declaration was found, return.\n if (superDeclaration === null) {\n return superDeclaration;\n }\n // If the declaration already has traits assigned to it, retu...
[ "0.58194774", "0.5614917", "0.5394565", "0.5371702", "0.5371702", "0.5371702", "0.5371702", "0.5371702", "0.5371702", "0.52935684", "0.5259825", "0.52364355", "0.5233956", "0.5199863", "0.5164888", "0.51215166", "0.4926942", "0.48496026", "0.47865343", "0.4781987", "0.4756116...
0.5866817
0
Check whether a `Declaration` corresponds with a known declaration, such as `Object`, and set its `known` property to the appropriate `KnownDeclaration`.
detectKnownDeclaration(decl) { if (decl.known === null && this.isJavaScriptObjectDeclaration(decl)) { // If the identifier resolves to the global JavaScript `Object`, update the declaration to // denote it as the known `JsGlobalObject` declaration. decl.known = KnownDeclarati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isResolvedDeclaration(declaration){if(Array.isArray(declaration)){return declaration.every(isResolvedDeclaration);}return!!resolveForwardRef(declaration);}", "function isResolvedDeclaration(declaration) {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n ...
[ "0.59634215", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.56519514", "0.5640372", "0.56140524", "0.5312225", "0.5299589", "0.52969825", "0.5234619", "0.52239126", "0.5026795", "0.50115067", "0.48467043", "...
0.7536168
0
Protected Helpers ///////////// Extract all the "classes" from the `statement` and add them to the `classes` map.
addClassSymbolsFromStatement(classes, statement) { if (ts.isVariableStatement(statement)) { statement.declarationList.declarations.forEach(declaration => { const classSymbol = this.getClassSymbol(declaration); if (classSymbol) { classes.set(classSy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClassMap() {\n return this.cache.getOrAdd('classMap', () => {\n const map = new Map();\n this.enumerateBrsFiles((file) => {\n var _a;\n if ((0, reflection_1.isBrsFile)(file)) {\n for (let cls of file.parser.references.classStatements)...
[ "0.60446507", "0.5650559", "0.5531398", "0.539819", "0.5319558", "0.5314471", "0.5298646", "0.52322465", "0.5232035", "0.52180445", "0.51689345", "0.51568764", "0.50788665", "0.5040879", "0.5015567", "0.498351", "0.49748933", "0.4959399", "0.4950736", "0.49131563", "0.4898052...
0.75817335
0
Compute the inner declaration node of a "class" from the given `declaration` node.
getInnerDeclarationFromAliasOrInner(declaration) { if (declaration.parent !== undefined && isNamedVariableDeclaration(declaration.parent)) { const variableValue = this.getVariableValue(declaration.parent); if (variableValue !== null) { declaration = variableValue; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createClassSymbol(outerDeclaration, innerDeclaration) {\n const declarationSymbol = this.checker.getSymbolAtLocation(outerDeclaration);\n if (declarationSymbol === undefined) {\n return undefined;\n }\n let implementationSymbol = declarationSymbol;\n if (innerDeclarati...
[ "0.58721286", "0.53411585", "0.5241312", "0.5174433", "0.5129974", "0.50978315", "0.4758651", "0.4613221", "0.45893195", "0.4584958", "0.45557138", "0.45557138", "0.4547704", "0.4515081", "0.45032215", "0.43797264", "0.43504277", "0.43475893", "0.43475893", "0.4334313", "0.43...
0.5679504
1
Creates an `NgccClassSymbol` from an outer and inner declaration. If a class only has an outer declaration, the "implementation" symbol of the created `NgccClassSymbol` will be set equal to the "declaration" symbol.
createClassSymbol(outerDeclaration, innerDeclaration) { const declarationSymbol = this.checker.getSymbolAtLocation(outerDeclaration); if (declarationSymbol === undefined) { return undefined; } let implementationSymbol = declarationSymbol; if (innerDeclaration !== null...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createOuterClass() {\n logBody.push(\"createOuterClass\");\n\n if (startofLine) {\n setClassaccessMod();\n } else {\n (tokenType === \"IDEN\") ? setClassName(): startClassBody()\n // this is lazy, setClassName is called when tok...
[ "0.5884795", "0.5346228", "0.51306754", "0.5020614", "0.5001697", "0.49425218", "0.48570466", "0.47276607", "0.46918768", "0.46158338", "0.46158338", "0.46153682", "0.45727143", "0.4519742", "0.4469288", "0.44347322", "0.4428778", "0.44128034", "0.43743575", "0.43538263", "0....
0.7703007
0
Finds the identifier of the actual class declaration for a potentially aliased declaration of a class. If the given declaration is for an alias of a class, this function will determine an identifier to the original declaration that represents this class.
resolveAliasedClassIdentifier(declaration) { this.ensurePreprocessed(declaration.getSourceFile()); return this.aliasedClassDeclarations.has(declaration) ? this.aliasedClassDeclarations.get(declaration) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getDeclarationOfIdentifier(id) {\n const superDeclaration = super.getDeclarationOfIdentifier(id);\n // If no declaration was found, return.\n if (superDeclaration === null) {\n return superDeclaration;\n }\n // If the declaration already has traits assigned to it, retu...
[ "0.65367264", "0.58959895", "0.58959895", "0.5751509", "0.5521228", "0.54709566", "0.5284471", "0.527048", "0.5130151", "0.5069289", "0.5049488", "0.504057", "0.4970324", "0.49335742", "0.49296185", "0.49286595", "0.4879225", "0.48704916", "0.4840404", "0.4803419", "0.4795595...
0.74653375
0
Ensures that the source file that `node` is part of has been preprocessed. During preprocessing, all statements in the source file will be visited such that certain processing steps can be done upfront and cached for subsequent usages.
ensurePreprocessed(sourceFile) { if (!this.preprocessedSourceFiles.has(sourceFile)) { this.preprocessedSourceFiles.add(sourceFile); for (const statement of this.getModuleStatements(sourceFile)) { this.preprocessStatement(statement); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSourceFileWorker(node) {\n var links = getNodeLinks(node);\n if (!(links.flags & 1 /* TypeChecked */)) {\n // If skipLibCheck is enabled, skip type checking if file is a declaration file.\n // If skipDefaultLibCheck is enabled, skip type checking if...
[ "0.6217679", "0.55435425", "0.54374176", "0.5426703", "0.54162836", "0.52147377", "0.51320314", "0.50435424", "0.50435424", "0.4962436", "0.49575564", "0.49478984", "0.48823848", "0.4860604", "0.4840596", "0.48400918", "0.48328793", "0.48328793", "0.48286074", "0.4793466", "0...
0.7108284
0
Get the top level statements for a module. In ES5 and ES2015 this is just the top level statements of the file.
getModuleStatements(sourceFile) { return Array.from(sourceFile.statements); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNameNodes() {\r\n const nodes = [];\r\n let current = this;\r\n do {\r\n nodes.push(this._getNodeFromCompilerNode(current.compilerNode.name));\r\n current = current.getFirstChildByKind(typescript_1.SyntaxKind.ModuleDeclaration);\r\n } while (current != null);\r\...
[ "0.5716598", "0.5155494", "0.504977", "0.49930626", "0.494378", "0.49342233", "0.49117357", "0.48714292", "0.48626435", "0.48565003", "0.48366457", "0.4826582", "0.48065388", "0.47989962", "0.4765817", "0.4747267", "0.47165412", "0.46971405", "0.46956515", "0.46912003", "0.46...
0.68058985
0
Try to retrieve the symbol of a static property on a class. In some cases, a static property can either be set on the inner (implementation or adjacent) declaration inside the class' IIFE, or it can be set on the outer variable declaration. Therefore, the host checks all places, first looking up the property on the inn...
getStaticProperty(symbol, propertyName) { var _a, _b, _c, _d; return ((_a = symbol.implementation.exports) === null || _a === void 0 ? void 0 : _a.get(propertyName)) || ((_c = (_b = symbol.adjacent) === null || _b === void 0 ? void 0 : _b.exports) === null || _c === void 0 ? void 0 : _c.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get property(){}", "function sc_getprop(sym, key) {\n var ht = sc_properties[sym];\n if (ht) {\n\tif (key in ht)\n\t return ht[key];\n\telse\n\t return false;\n } else\n\treturn false;\n}", "computeDecoratorInfoFromStaticProperties(classSymbol) {\n let classDecorators = null;\n ...
[ "0.6188553", "0.5759038", "0.5449223", "0.5280549", "0.5275", "0.5248585", "0.5234696", "0.52249527", "0.51467556", "0.51466", "0.51317096", "0.5129547", "0.5127511", "0.5127511", "0.51167166", "0.51167166", "0.51167166", "0.51024127", "0.50816864", "0.50816864", "0.50816864"...
0.67092264
0
This is the main entrypoint for obtaining information on the decorators of a given class. This information is computed either from static properties if present, or using `tslib.__decorate` helper calls otherwise. The computed result is cached per class.
acquireDecoratorInfo(classSymbol) { const decl = classSymbol.declaration.valueDeclaration; if (this.decoratorCache.has(decl)) { return this.decoratorCache.get(decl); } // Extract decorators from static properties and `__decorate` helper calls, then merge them // toget...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computeDecoratorInfoFromStaticProperties(classSymbol) {\n let classDecorators = null;\n let memberDecorators = null;\n let constructorParamInfo = null;\n const decoratorsProperty = this.getStaticProperty(classSymbol, DECORATORS);\n if (decoratorsProperty !== undefined) {\n ...
[ "0.7401799", "0.6216486", "0.60999155", "0.60586053", "0.60586053", "0.5996772", "0.5953823", "0.5762448", "0.570474", "0.5696058", "0.56947273", "0.56576896", "0.54974854", "0.5486137", "0.5476479", "0.5472794", "0.5464749", "0.5464749", "0.54427", "0.52501315", "0.52423096"...
0.78458166
0
Attempts to compute decorator information from static properties "decorators", "propDecorators" and "ctorParameters" on the class. If neither of these static properties is present the library is likely not compiled using tsickle for usage with Closure compiler, in which case `null` is returned.
computeDecoratorInfoFromStaticProperties(classSymbol) { let classDecorators = null; let memberDecorators = null; let constructorParamInfo = null; const decoratorsProperty = this.getStaticProperty(classSymbol, DECORATORS); if (decoratorsProperty !== undefined) { classD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "acquireDecoratorInfo(classSymbol) {\n const decl = classSymbol.declaration.valueDeclaration;\n if (this.decoratorCache.has(decl)) {\n return this.decoratorCache.get(decl);\n }\n // Extract decorators from static properties and `__decorate` helper calls, then merge them\n ...
[ "0.7112897", "0.5614082", "0.54252034", "0.53381556", "0.53250414", "0.5283636", "0.51000744", "0.5090575", "0.5090575", "0.50898284", "0.5072915", "0.5069886", "0.5069886", "0.50618637", "0.50473505", "0.49744335", "0.49744335", "0.49744335", "0.49656072", "0.48949173", "0.4...
0.7710532
0