file_name
large_stringlengths
4
140
prefix
large_stringlengths
0
12.1k
suffix
large_stringlengths
0
12k
middle
large_stringlengths
0
7.51k
fim_type
large_stringclasses
4 values
path_utils.rs
use crate::borrow_check::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation}; use crate::borrow_check::places_conflict; use crate::borrow_check::AccessDepth; use crate::borrow_check::Upvar; use crate::dataflow::indexes::BorrowIndex; use rustc_data_structures::graph::dominators::Dominators; use rustc_middle::mir::Bo...
// // X // / // R <--+ Except for this // / \ | diamond // \ / | // A <------+ // | // Z // // Note that we assume that: // - the reservation R dominates the activation A // - the activation A post-dominates the res...
// Otherwise, it is active for every location *except* in between // the reservation and the activation:
random_line_split
path_utils.rs
use crate::borrow_check::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation}; use crate::borrow_check::places_conflict; use crate::borrow_check::AccessDepth; use crate::borrow_check::Upvar; use crate::dataflow::indexes::BorrowIndex; use rustc_data_structures::graph::dominators::Dominators; use rustc_middle::mir::Bo...
else { // Otherwise, this point is outside the diamond, so // consider the borrow active. This could happen for // example if the borrow remains active around a loop (in // which case it would be active also for the point R, // which would generate an error). true } ...
{ false }
conditional_block
test.conf.js
/** * @license angular-sortable-column * (c) 2013 Knight Rider Consulting, Inc. http://www.knightrider.com * License: MIT */ /** * * @author Dale "Ducky" Lotts * @since 7/21/13 */ basePath = '..'; files = [ JASMINE, JASMINE_ADAPTER, 'bower_components/jquery/dist/jquery.js', 'bower_...
// list of files to exclude exclude = [ ]; preprocessors = { '**/src/js/*.js': 'coverage' }; // test results reporter to use // possible values: 'dots', 'progress', 'junit' reporters = ['progress', 'coverage']; // web server port port = 9876; // cli runner port runnerPort = 9100; // enable / disable colors i...
'bower_components/angular-route/angular-route.js', 'bower_components/angular-mocks/angular-mocks.js', 'src/js/sortableColumn.js', 'test/*.spec.js' ];
random_line_split
sw.js
/* =========================================================== * sw.js * =========================================================== * Copyright 2016 @huxpro * Licensed under Apache 2.0 * Register service worker. * ========================================================== */ const PRECACHE = 'precache-v1'; con...
event.respondWith( Promise.race([fetched.catch(_ => cached), cached]) .then(resp => resp || fetched) .catch(_ => caches.match('offline.html')) ); // Update the cache with the version we fetched (only for ok status) event.waitUntil( Promise.all([fetchedCopy, caches.open(RUNTI...
{ // Redirect in SW manually fixed github pages 404s on repo?blah if(shouldRedirect(event.request)){ event.respondWith(Response.redirect(`${event.request.url}/`)) return; } // Stale-while-revalidate // similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12...
conditional_block
sw.js
/* =========================================================== * sw.js * =========================================================== * Copyright 2016 @huxpro * Licensed under Apache 2.0 * Register service worker. * ========================================================== */ const PRECACHE = 'precache-v1'; con...
// request.mode of 'navigate' is unfortunately not supported in Chrome // versions older than 49, so we need to include a less precise fallback, // which checks for a GET request with an Accept: text/html header. const isNavigationReq = (req) => (req.mode === 'navigate' || (req.method === 'GET' && req.headers.get('acce...
// The Util Function to filter out Navigation Requests.
random_line_split
combineEpics.spec.ts
import { expect } from 'chai'; import { Action } from 'redux-actions'; import { map } from 'rxjs/operators/map'; import { toArray } from 'rxjs/operators/toArray'; import { Subject } from 'rxjs/Subject'; import * as sinon from 'sinon'; import { ActionsObservable, combineEpics } from '../'; import { TEpic, } from '../m...
result.subscribe((emittedAction) => emittedActions.push(emittedAction)); subject.next({ type: 'ACTION1' }); subject.next({ type: 'ACTION2' }); expect(emittedActions).to.deep.equal([ { type: 'DELEGATED1', action: { type: 'ACTION1' }, store }, { type: 'DELEGATED2', action: { type: 'ACTION2' ...
random_line_split
cfg-macros-notfoo.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
() { assert!(!bar!()) }
main
identifier_name
cfg-macros-notfoo.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
}
} } pub fn main() { assert!(!bar!())
random_line_split
cfg-macros-notfoo.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
{ assert!(!bar!()) }
identifier_body
NumberListInput.vue.ts
import { Component, Prop } from 'vue-property-decorator'; import { Multiselect } from 'vue-multiselect'; import { IListMetadata, IListOption } from 'components/shared/inputs'; import { BaseInput } from 'components/shared/inputs/BaseInput'; @Component({ components: { Multiselect } }) export default class ListInput exte...
}; } get currentMultiselectValue() { const option = this.options.options.find( (opt: IListOption<number>) => this.value === opt.value, ); if (option) return option; if (this.options.allowEmpty) return null; return this.options.options[0]; } get selectedOption(): IListOption<numb...
...options, allowEmpty: !!options.allowEmpty, // undefined value is not working for vue-multiselect
random_line_split
NumberListInput.vue.ts
import { Component, Prop } from 'vue-property-decorator'; import { Multiselect } from 'vue-multiselect'; import { IListMetadata, IListOption } from 'components/shared/inputs'; import { BaseInput } from 'components/shared/inputs/BaseInput'; @Component({ components: { Multiselect } }) export default class ListInput exte...
(): IListOption<number, unknown> { return this.options.options.find(option => option.value === this.value); } }
selectedOption
identifier_name
NumberListInput.vue.ts
import { Component, Prop } from 'vue-property-decorator'; import { Multiselect } from 'vue-multiselect'; import { IListMetadata, IListOption } from 'components/shared/inputs'; import { BaseInput } from 'components/shared/inputs/BaseInput'; @Component({ components: { Multiselect } }) export default class ListInput exte...
} getOptions(): IListMetadata<number> { const options = super.getOptions(); return { ...options, allowEmpty: !!options.allowEmpty, // undefined value is not working for vue-multiselect }; } get currentMultiselectValue() { const option = this.options.options.find( (opt: IList...
{ this.emitInput(option.value); this.$nextTick(); }
conditional_block
domrectlist.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::DOMRectListBinding; use dom::bindings::codegen::Bindings::DOMRectListBinding...
} impl Reflectable for DOMRectList { fn reflector<'a>(&'a self) -> &'a Reflector { &self.reflector_ } }
fn IndexedGetter(self, index: u32, found: &mut bool) -> Option<Temporary<DOMRect>> { *found = index < self.rects.len() as u32; self.Item(index) }
random_line_split
domrectlist.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::DOMRectListBinding; use dom::bindings::codegen::Bindings::DOMRectListBinding...
} impl Reflectable for DOMRectList { fn reflector<'a>(&'a self) -> &'a Reflector { &self.reflector_ } }
{ *found = index < self.rects.len() as u32; self.Item(index) }
identifier_body
domrectlist.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::DOMRectListBinding; use dom::bindings::codegen::Bindings::DOMRectListBinding...
(window: JSRef<Window>, rects: Vec<JSRef<DOMRect>>) -> DOMRectList { let rects = rects.iter().map(|rect| JS::from_rooted(*rect)).collect(); DOMRectList { reflector_: Reflector::new(), rects: rects, window: JS::from_rooted(window), } ...
new_inherited
identifier_name
domrectlist.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::DOMRectListBinding; use dom::bindings::codegen::Bindings::DOMRectListBinding...
else { None } } fn IndexedGetter(self, index: u32, found: &mut bool) -> Option<Temporary<DOMRect>> { *found = index < self.rects.len() as u32; self.Item(index) } } impl Reflectable for DOMRectList { fn reflector<'a>(&'a self) -> &'a Reflector { &self.reflec...
{ Some(Temporary::new(rects[index as uint].clone())) }
conditional_block
index_test.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import * as path from 'path'; import {setup} from './test_support'; describe('ngc_wrapped', () => { it('should w...
});
random_line_split
squirrelStartup.js
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import AutoLaunch from 'auto-launch'; import {app} from 'electron'; function shouldQuitApp(cmd) { if (process.platform !== 'win32') { return false; } const sq...
await appLauncher.disable(); } else if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') { // If we're updating and already have an registry entry for auto launch, make sure to update the path const enabled = await appLauncher.isEnabled(); if (enabled) { await appLauncher.enable(); ...
isHidden: true, }); if (cmd === '--squirrel-uninstall') { // If we're uninstalling, make sure we also delete our auto launch registry key
random_line_split
squirrelStartup.js
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import AutoLaunch from 'auto-launch'; import {app} from 'electron'; function shouldQuitApp(cmd) { if (process.platform !== 'win32') { return false; } const sq...
} } export default function squirrelStartup(callback) { if (process.platform === 'win32') { const cmd = process.argv[1]; setupAutoLaunch(cmd).then(() => { if (require('electron-squirrel-startup') && callback) { // eslint-disable-line global-require callback(); } }); return shou...
{ await appLauncher.enable(); }
conditional_block
squirrelStartup.js
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import AutoLaunch from 'auto-launch'; import {app} from 'electron'; function shouldQuitApp(cmd)
async function setupAutoLaunch(cmd) { const appLauncher = new AutoLaunch({ name: app.getName(), isHidden: true, }); if (cmd === '--squirrel-uninstall') { // If we're uninstalling, make sure we also delete our auto launch registry key await appLauncher.disable(); } else if (cmd === '--squirrel-...
{ if (process.platform !== 'win32') { return false; } const squirrelCommands = ['--squirrel-install', '--squirrel-updated', '--squirrel-uninstall', '--squirrel-obsolete']; return squirrelCommands.includes(cmd); }
identifier_body
squirrelStartup.js
// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import AutoLaunch from 'auto-launch'; import {app} from 'electron'; function shouldQuitApp(cmd) { if (process.platform !== 'win32') { return false; } const sq...
(callback) { if (process.platform === 'win32') { const cmd = process.argv[1]; setupAutoLaunch(cmd).then(() => { if (require('electron-squirrel-startup') && callback) { // eslint-disable-line global-require callback(); } }); return shouldQuitApp(cmd); } return false; }
squirrelStartup
identifier_name
test_printers.py
"""Test the print-to-python-file module This just uses the simpleparsegrammar declaration, which is parsed, then linearised, then loaded as a Python module. """ import os, unittest import test_grammarparser testModuleFile = 'test_printers_garbage.py' class PrintersTests(test_grammarparser.SimpleParseGrammarTests): ...
( self ): from simpleparse import simpleparsegrammar, parser, printers, baseparser p = parser.Parser( simpleparsegrammar.declaration, 'declarationset') open(testModuleFile,'w').write(printers.asGenerator( p._generator )) import test_printers_garbage reload( test_printers_garbage ) class RParser( test_pri...
setUp
identifier_name
test_printers.py
"""Test the print-to-python-file module This just uses the simpleparsegrammar declaration, which is parsed, then linearised, then loaded as a Python module. """ import os, unittest import test_grammarparser testModuleFile = 'test_printers_garbage.py' class PrintersTests(test_grammarparser.SimpleParseGrammarTests): ...
def doBasicTest(self, parserName, testValue, expected, ): result = self.recursiveParser.parse( testValue, production=parserName ) assert result == expected, '''\nexpected:%s\n got:%s\n'''%( expected, result ) def getSuite(): return unittest.makeSuite(PrintersTests,'test') if __name__ == "__main__": unitte...
try: os.remove( testModuleFile ) except IOError, err: pass
identifier_body
test_printers.py
"""Test the print-to-python-file module This just uses the simpleparsegrammar declaration, which is parsed, then linearised, then loaded as a Python module. """ import os, unittest import test_grammarparser testModuleFile = 'test_printers_garbage.py' class PrintersTests(test_grammarparser.SimpleParseGrammarTests): ...
if __name__ == "__main__": unittest.main(defaultTest="getSuite")
result = self.recursiveParser.parse( testValue, production=parserName ) assert result == expected, '''\nexpected:%s\n got:%s\n'''%( expected, result ) def getSuite(): return unittest.makeSuite(PrintersTests,'test')
random_line_split
test_printers.py
"""Test the print-to-python-file module This just uses the simpleparsegrammar declaration, which is parsed, then linearised, then loaded as a Python module. """ import os, unittest import test_grammarparser testModuleFile = 'test_printers_garbage.py' class PrintersTests(test_grammarparser.SimpleParseGrammarTests): ...
unittest.main(defaultTest="getSuite")
conditional_block
date.ts
/** * Date-fns utilities. */ import { zhCN } from 'date-fns/esm/locale'; import { format, startOfWeek, endOfWeek, startOfDay, eachDayOfInterval } from 'date-fns'; export type WeekStarts = 0 | 1 | 2 | 3 | 4 | 5 | 6; /** weekdays */ export enum Weekday { Sunday, Monday, Tuesday, Wensday, Thur...
date, return a brand new reference */ export function cloneDate(day: Date): Date { return new Date(day); }
tartOfWeek(day, { weekStartsOn: 1 }); } /** * clone
identifier_body
date.ts
/** * Date-fns utilities. */ import { zhCN } from 'date-fns/esm/locale'; import { format, startOfWeek, endOfWeek, startOfDay, eachDayOfInterval } from 'date-fns'; export type WeekStarts = 0 | 1 | 2 | 3 | 4 | 5 | 6; /** weekdays */ export enum Weekday { Sunday, Monday, Tuesday, Wensday, Thur...
export function getStartOfWeek(day: Date): Date { return startOfWeek(day, { weekStartsOn: 1 }); } /** * clone date, return a brand new reference */ export function cloneDate(day: Date): Date { return new Date(day); }
} /** * Return the start of a week for the given date. The result will be in the local timezone. */
random_line_split
date.ts
/** * Date-fns utilities. */ import { zhCN } from 'date-fns/esm/locale'; import { format, startOfWeek, endOfWeek, startOfDay, eachDayOfInterval } from 'date-fns'; export type WeekStarts = 0 | 1 | 2 | 3 | 4 | 5 | 6; /** weekdays */ export enum Weekday { Sunday, Monday, Tuesday, Wensday, Thur...
Weekday): string[] { return getCurrentWeekArray(new Date(), weekStartsOn) .map((day: Date) => format(day, 'EEEEE', { locale: zhCN })); } /* * get current date's week start date and end date */ export function getCurrentWeekArray(day: Date, weekStartsOn: Weekday): Date[] { return eachDayOfInterval( ...
ekStartsOn:
identifier_name
example_dance.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Dance example. This example demonstrates how to integrate a server application with Authentiq Connect. It uses the popular Flask-Dance package to make this trivial in Flask. """ from __future__ import ( absolute_import, division, print_function, u...
app.wsgi_app = ProxyFix(app.wsgi_app) blueprint = make_authentiq_blueprint( client_id=CLIENT_ID, client_secret=CLIENT_SECRET, scope=" ".join(REQUESTED_SCOPES), ) app.register_blueprint(blueprint, url_prefix="/login") @app.route("/") def index(): if not authentiq.authorized: return redirect(url...
random_line_split
example_dance.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Dance example. This example demonstrates how to integrate a server application with Authentiq Connect. It uses the popular Flask-Dance package to make this trivial in Flask. """ from __future__ import ( absolute_import, division, print_function, u...
app.run()
import os # Allow insecure oauth2 when debugging os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
conditional_block
example_dance.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Dance example. This example demonstrates how to integrate a server application with Authentiq Connect. It uses the popular Flask-Dance package to make this trivial in Flask. """ from __future__ import ( absolute_import, division, print_function, u...
(): if not authentiq.authorized: return redirect(url_for("authentiq.login")) resp = authentiq.get("/userinfo") assert resp.ok data = resp.json() return "You are {name} on Authentiq!".format( name=data.get("name") or data.get("email") or "anonymous") if __name__ == "__main__": ...
index
identifier_name
example_dance.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Dance example. This example demonstrates how to integrate a server application with Authentiq Connect. It uses the popular Flask-Dance package to make this trivial in Flask. """ from __future__ import ( absolute_import, division, print_function, u...
if __name__ == "__main__": if app.debug: import os # Allow insecure oauth2 when debugging os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1" app.run()
if not authentiq.authorized: return redirect(url_for("authentiq.login")) resp = authentiq.get("/userinfo") assert resp.ok data = resp.json() return "You are {name} on Authentiq!".format( name=data.get("name") or data.get("email") or "anonymous")
identifier_body
testExpressionsApi.py
# -*- coding: utf-8 -*- """ /******************************************************************************* * Copyright (c) cortical.io GmbH. All rights reserved. * * This software is confidential and proprietary information. * You shall use it only in accordance with the terms of the * license agreement you en...
def testSimilarTerms(self): terms = self.api.getSimilarTermsForExpressionContext(conf.RETINA_NAME, oneTermInputJSON, context_id=None, pos_type="NOUN", get_fingerprint=True, start_index=0, max_results=8, sparsity=1.0) self.assertTrue(terms != None) self.assertEqual(8, len(terms)) t0 =...
def setUp(self): self.api = ExpressionsApi(conf.client) self.jsonBulkExpression = None # path relative to current working dir with open("bulkInput.json", "r") as f: self.jsonBulkExpression = "".join(f.readlines()) def testExpressions(self): fp = self.api....
identifier_body
testExpressionsApi.py
# -*- coding: utf-8 -*- """ /******************************************************************************* * Copyright (c) cortical.io GmbH. All rights reserved. * * This software is confidential and proprietary information. * You shall use it only in accordance with the terms of the * license agreement you en...
(self): terms = self.api.getSimilarTermsForExpressionContext(conf.RETINA_NAME, oneTermInputJSON, context_id=None, pos_type="NOUN", get_fingerprint=True, start_index=0, max_results=8, sparsity=1.0) self.assertTrue(terms != None) self.assertEqual(8, len(terms)) t0 = terms[0] self.a...
testSimilarTerms
identifier_name
testExpressionsApi.py
# -*- coding: utf-8 -*- """ /******************************************************************************* * Copyright (c) cortical.io GmbH. All rights reserved. * * This software is confidential and proprietary information. * You shall use it only in accordance with the terms of the * license agreement you en...
self.assertTrue(isinstance(c0.context_label, unicode)) self.assertTrue(c0.context_id == 0) def testSimilarTerms(self): terms = self.api.getSimilarTermsForExpressionContext(conf.RETINA_NAME, oneTermInputJSON, context_id=None, pos_type="NOUN", get_fingerprint=True, start_index=0, max_results=...
random_line_split
testExpressionsApi.py
# -*- coding: utf-8 -*- """ /******************************************************************************* * Copyright (c) cortical.io GmbH. All rights reserved. * * This software is confidential and proprietary information. * You shall use it only in accordance with the terms of the * license agreement you en...
def testExpressionSimilarTermsBulk(self): termsLists = self.api.getSimilarTermsForBulkExpressionContext(conf.RETINA_NAME, self.jsonBulkExpression, get_fingerprint=True, max_results=7) self.assertTrue(len(termsLists) == 6) for termList in termsLists: self.assertTrue(len(termList...
self.assertGreater(len(context.fingerprint.positions), 50) self.assertTrue(isinstance(context.context_label, unicode)) self.assertTrue(context.context_id == i)
conditional_block
converter.js
// // converter.js // Mr-Data-Converter // // Created by Shan Carter on 2010-09-01. // function DataConverter(nodeId)
{"text":"Ruby", "id":"ruby", "notes":""}, {"text":"XML - Properties", "id":"xmlProperties", "notes":""}, {"text":"XML - Nodes", "id":"xml", "notes":""}, ...
{ //--------------------------------------- // PUBLIC PROPERTIES //--------------------------------------- this.nodeId = nodeId; this.node = $("#"+nodeId); this.outputDataTypes = [ {"text":"Actionscript", "id":"as", ...
identifier_body
converter.js
// // converter.js // Mr-Data-Converter // // Created by Shan Carter on 2010-09-01. // function DataConverter(nodeId) { //--------------------------------------- // PUBLIC PROPERTIES //--------------------------------------- this.nodeId = nodeId; this.node = $("#"+nod...
this.commentLine = "//"; this.commentLineEnd = ""; this.tableName = "MrDataConverter" this.useUnderscores = true; this.headersProvided = true; this.downcaseHeaders = true; this.upcaseHeaders = false; this.includeWhiteSpace = true; t...
this.inputText = ""; this.outputText = ""; this.newLine = "\n"; this.indent = " ";
random_line_split
converter.js
// // converter.js // Mr-Data-Converter // // Created by Shan Carter on 2010-09-01. // function
(nodeId) { //--------------------------------------- // PUBLIC PROPERTIES //--------------------------------------- this.nodeId = nodeId; this.node = $("#"+nodeId); this.outputDataTypes = [ {"text":"Actionscript", "id":"as...
DataConverter
identifier_name
converter.js
// // converter.js // Mr-Data-Converter // // Created by Shan Carter on 2010-09-01. // function DataConverter(nodeId) { //--------------------------------------- // PUBLIC PROPERTIES //--------------------------------------- this.nodeId = nodeId; this.node = $("#"+nod...
else { this.indent = ""; this.newLine = ""; // console.log("no") } CSVParser.resetLog(); var parseOutput = CSVParser.parse(this.inputText, this.headersProvided, this.delimiter, this.downcaseHeaders, this.upcaseHeaders); var dataGrid = parseOutput.dataGrid; var headerNames = pars...
{ this.newLine = "\n"; // console.log("yes") }
conditional_block
tdigest.js
}; TDigest.prototype._digest = function(x, n) { // incorporate value x, having count n into the TDigest. // var min = this.centroids.min(); var max = this.centroids.max(); var nearest = this.find_nearest(x); if (nearest && nearest.mean === x) { // accumulate exact matches into the centr...
{ return false; }
conditional_block
tdigest.js
.discrete) ? "exact " : "approximating "; var s = [approx + this.n + " samples using " + this.size() + " centroids", "min = "+this.percentile(0), "Q1 = "+this.percentile(0.25), "Q2 = "+this.percentile(0.5), "Q3 = "+this.percentile(0.75), "max = "+t...
TDigest.prototype.push = function(x, n) { // incorporate value or array of values x, having count n into the // TDigest. n defaults to 1. // n = n || 1; x = Array.isArray(x) ? x : [x]; for (var i = 0 ; i < x.length ; i++) { this._digest(x[i], n); } }; TDigest.prototype.push_centro...
{ // order two centroids by mean_cumn. // if (a === null) { // XXX super-narrow workaround for https://github.com/vadimg/js_bintrees/pull/14 return NaN; } return (a.mean_cumn - b.mean_cumn); }
identifier_body
tdigest.js
adding x to // nearest will not shift its relative position in the tree and // require reinsertion. // if (x !== nearest.mean) { nearest.mean += n * (x - nearest.mean) / (nearest.n + n); } nearest.cumn += n; nearest.mean_cumn += n / 2; nearest.n += n; this.n += n; }; TDige...
};
random_line_split
tdigest.js
.discrete) ? "exact " : "approximating "; var s = [approx + this.n + " samples using " + this.size() + " centroids", "min = "+this.percentile(0), "Q1 = "+this.percentile(0.25), "Q2 = "+this.percentile(0.5), "Q3 = "+this.percentile(0.75), "max = "+t...
(a, b) { // order two centroids by mean_cumn. // if (a === null) { // XXX super-narrow workaround for https://github.com/vadimg/js_bintrees/pull/14 return NaN; } return (a.mean_cumn - b.mean_cumn); } TDigest.prototype.push = function(x, n) { // incorporate value or array of val...
compare_centroid_mean_cumns
identifier_name
supersized.imgs.js
jQuery(function($){ $.supersized({ //Functionality slideshow : 1, //Slideshow on/off autoplay : 1, //Slideshow starts playing automatically start_slide : 1, //Start slide (0 is random) slide_interval ...
var ret = new Array(); for(var i in supersizedImgs){ ret.push({image: supersizedImgs[i]}); } return ret; })() }); });
thumbnail_navigation : 1, //Thumbnail navigation slide_counter : 1, //Display slide numbers slide_captions : 1, //Slide caption (Pull from "title" in slides array) slides : (function(){
random_line_split
run.py
#!/usr/bin/env python import json import sys import web from coloredcoinlib import BlockchainState, ColorDefinition blockchainstate = BlockchainState.from_url(None, True) urls = ( '/tx', 'Tx', '/prefetch', 'Prefetch', ) class ErrorThrowingRequestProcessor: def require(self, data, key, message): ...
(self): # data is sent in as json data = json.loads(web.input().keys()[0]) self.require(data, 'txhash', "TX requires txhash") txhash = data.get('txhash') return blockchainstate.get_raw(txhash) class Prefetch(ErrorThrowingRequestProcessor): def POST(self): # data is ...
POST
identifier_name
run.py
#!/usr/bin/env python import json import sys import web from coloredcoinlib import BlockchainState, ColorDefinition blockchainstate = BlockchainState.from_url(None, True) urls = ( '/tx', 'Tx', '/prefetch', 'Prefetch', ) class ErrorThrowingRequestProcessor: def require(self, data, key, message): ...
return tx_lookup if __name__ == "__main__": app = web.application(urls, globals()) app.run()
process(txhash, oi)
conditional_block
run.py
#!/usr/bin/env python import json import sys import web from coloredcoinlib import BlockchainState, ColorDefinition blockchainstate = BlockchainState.from_url(None, True) urls = ( '/tx', 'Tx', '/prefetch', 'Prefetch', ) class ErrorThrowingRequestProcessor: def require(self, data, key, message): ...
if __name__ == "__main__": app = web.application(urls, globals()) app.run()
process(txhash, oi) return tx_lookup
random_line_split
run.py
#!/usr/bin/env python import json import sys import web from coloredcoinlib import BlockchainState, ColorDefinition blockchainstate = BlockchainState.from_url(None, True) urls = ( '/tx', 'Tx', '/prefetch', 'Prefetch', ) class ErrorThrowingRequestProcessor: def require(self, data, key, message): ...
class Prefetch(ErrorThrowingRequestProcessor): def POST(self): # data is sent in as json data = json.loads(web.input().keys()[0]) self.require(data, 'txhash', "Prefetch requires txhash") self.require(data, 'output_set', "Prefetch requires output_set") self.require(data, 'c...
data = json.loads(web.input().keys()[0]) self.require(data, 'txhash', "TX requires txhash") txhash = data.get('txhash') return blockchainstate.get_raw(txhash)
identifier_body
Menu.js
'use strict'; var Menu = require('menu'); function setupMenu() { return; var template = [{ label: 'Bieber', submenu: [{ label: 'What do you do?' }, { label: 'Never say never' }] }, { label: 'Electron', submenu: [{ label: 'About Electron', selector: 'orderFrontStan...
accelerator: 'Shift+Command+Z', selector: 'redo:' }, { type: 'separator' }, { label: 'Cut', accelerator: 'Command+X', selector: 'cut:' }, { label: 'Copy', accelerator: 'Command+C', selector: 'copy:' }, { label: 'Paste', accelerator: 'Comm...
}, { label: 'Redo',
random_line_split
Menu.js
'use strict'; var Menu = require('menu'); function
() { return; var template = [{ label: 'Bieber', submenu: [{ label: 'What do you do?' }, { label: 'Never say never' }] }, { label: 'Electron', submenu: [{ label: 'About Electron', selector: 'orderFrontStandardAboutPanel:' }, { type: 'separator' }, { ...
setupMenu
identifier_name
Menu.js
'use strict'; var Menu = require('menu'); function setupMenu()
type: 'separator' }, { label: 'Hide Electron', accelerator: 'Command+H', selector: 'hide:' }, { label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' }, { label: 'Show All', selector: 'unhideAllApplications:' }, { ...
{ return; var template = [{ label: 'Bieber', submenu: [{ label: 'What do you do?' }, { label: 'Never say never' }] }, { label: 'Electron', submenu: [{ label: 'About Electron', selector: 'orderFrontStandardAboutPanel:' }, { type: 'separator' }, { ...
identifier_body
cancel_data_labeling_job_sample.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
( project: str, data_labeling_job_id: str, location: str = "us-central1", api_endpoint: str = "us-central1-aiplatform.googleapis.com", ): # The AI Platform services require regional API endpoints. client_options = {"api_endpoint": api_endpoint} # Initialize client that will be used to create...
cancel_data_labeling_job_sample
identifier_name
cancel_data_labeling_job_sample.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# [END aiplatform_cancel_data_labeling_job_sample]
client_options = {"api_endpoint": api_endpoint} # Initialize client that will be used to create and send requests. # This client only needs to be created once, and can be reused for multiple requests. client = aiplatform.gapic.JobServiceClient(client_options=client_options) name = client.data_labeling_j...
identifier_body
cancel_data_labeling_job_sample.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
def cancel_data_labeling_job_sample( project: str, data_labeling_job_id: str, location: str = "us-central1", api_endpoint: str = "us-central1-aiplatform.googleapis.com", ): # The AI Platform services require regional API endpoints. client_options = {"api_endpoint": api_endpoint} # Initiali...
# [START aiplatform_cancel_data_labeling_job_sample] from google.cloud import aiplatform
random_line_split
outlet.ts
import { Simple } from '@glimmer/interfaces'; import { DirtyableTag, Tag, TagWrapper, VersionedPathReference } from '@glimmer/reference'; import { Opaque, Option } from '@glimmer/util'; import { environment } from 'ember-environment'; import { run } from 'ember-metal'; import { assign, OWNER } from 'ember-utils'; impor...
} }; } static reopenClass(injections: any) { assign(this, injections); } static create(options: any) { let { _environment, renderer, template } = options; let owner = options[OWNER]; return new OutletView(_environment, renderer, owner, template); } constructor(_environment: Boo...
{ return super.create(injections); }
conditional_block
outlet.ts
import { Simple } from '@glimmer/interfaces'; import { DirtyableTag, Tag, TagWrapper, VersionedPathReference } from '@glimmer/reference'; import { Opaque, Option } from '@glimmer/util'; import { environment } from 'ember-environment'; import { run } from 'ember-metal'; import { assign, OWNER } from 'ember-utils'; impor...
static create(options: any) { let { _environment, renderer, template } = options; let owner = options[OWNER]; return new OutletView(_environment, renderer, owner, template); } constructor(_environment: BootEnvironment, renderer: Renderer, owner: Container, template: OwnedTemplate) { this._envir...
{ assign(this, injections); }
identifier_body
outlet.ts
import { Simple } from '@glimmer/interfaces'; import { DirtyableTag, Tag, TagWrapper, VersionedPathReference } from '@glimmer/reference'; import { Opaque, Option } from '@glimmer/util'; import { environment } from 'ember-environment'; import { run } from 'ember-metal'; import { assign, OWNER } from 'ember-utils'; impor...
(public outletView: OutletView) { this.tag = outletView._tag; } get(key: string): VersionedPathReference<any> { return new ChildOutletStateReference(this, key); } value(): Option<OutletState> { return this.outletView.outletState; } getOrphan(name: string): VersionedPathReference<Option<Outlet...
constructor
identifier_name
outlet.ts
import { Simple } from '@glimmer/interfaces'; import { DirtyableTag, Tag, TagWrapper, VersionedPathReference } from '@glimmer/reference'; import { Opaque, Option } from '@glimmer/util'; import { environment } from 'ember-environment'; import { run } from 'ember-metal'; import { assign, OWNER } from 'ember-utils'; impor...
} constructor(_environment: BootEnvironment, renderer: Renderer, owner: Container, template: OwnedTemplate) { this._environment = _environment; this.renderer = renderer; this.owner = owner; this.template = template; this.outletState = null; this._tag = DirtyableTag.create(); } appendTo...
let owner = options[OWNER]; return new OutletView(_environment, renderer, owner, template);
random_line_split
template.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli'; import * as ts ...
extends BaseTemplate { public readonly fileName: string; public readonly source: string; public readonly span: ng.Span; constructor( templateNode: ts.StringLiteralLike, classDeclNode: ts.ClassDeclaration, classSymbol: ng.StaticSymbol, host: TypeScriptServiceHost) { super(host, classDeclNode, c...
InlineTemplate
identifier_name
template.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli'; import * as ts ...
abstract get span(): ng.Span; abstract get fileName(): string; abstract get source(): string; /** * Return the Angular StaticSymbol for the class that contains this template. */ get type() { return this.classSymbol; } /** * Return a Map-like data structure that allows users to retrieve some or ...
{ this.program = host.program; }
identifier_body
template.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli'; import * as ts ...
this.span = { start: 0, end: source.length, }; } } /** * Returns a property assignment from the assignment value, or `undefined` if there is no * assignment. */ export function getPropertyAssignmentFromValue(value: ts.Node): ts.PropertyAssignment|undefined { if (!value.parent || !ts.isProper...
classDeclNode: ts.ClassDeclaration, classSymbol: ng.StaticSymbol, host: TypeScriptServiceHost) { super(host, classDeclNode, classSymbol);
random_line_split
template.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {getClassMembersFromDeclaration, getPipesTable, getSymbolQuery} from '@angular/compiler-cli'; import * as ts ...
return value.parent; } /** * Given a decorator property assignment, return the ClassDeclaration node that corresponds to the * directive class the property applies to. * If the property assignment is not on a class decorator, no declaration is returned. * * For example, * * @Component({ * template: '<div>...
{ return; }
conditional_block
normalized.rs
ModuleAccess, file_format::{ AbilitySet, CompiledModule, FieldDefinition, FunctionHandle, SignatureToken, StructDefinition, StructFieldInformation, TypeParameterIndex, Visibility, }, }; use move_core_types::{ account_address::AccountAddress, identifier::Identifier, language_storage::...
use Type::*; match self { TypeParameter(_) => false, Bool => true, U8 => true, U64 => true, U128 => true, Address => true, Signer => true, Struct { type_arguments, .. } => type_arguments.iter().all(|t| t.is_c...
} /// Return true if `self` is a closed type with no free type variables pub fn is_closed(&self) -> bool {
random_line_split
normalized.rs
Access, file_format::{ AbilitySet, CompiledModule, FieldDefinition, FunctionHandle, SignatureToken, StructDefinition, StructFieldInformation, TypeParameterIndex, Visibility, }, }; use move_core_types::{ account_address::AccountAddress, identifier::Identifier, language_storage::{Modul...
{ pub address: AccountAddress, pub name: Identifier, pub friends: Vec<ModuleId>, pub structs: Vec<Struct>, pub exposed_functions: BTreeMap<FunctionSignature, Visibility>, } impl Module { /// Extract a normalized module from a `CompiledModule`. The module `m` should be verified. /// Nothing...
Module
identifier_name
normalized.rs
Access, file_format::{ AbilitySet, CompiledModule, FieldDefinition, FunctionHandle, SignatureToken, StructDefinition, StructFieldInformation, TypeParameterIndex, Visibility, }, }; use move_core_types::{ account_address::AccountAddress, identifier::Identifier, language_storage::{Modul...
} impl Type { /// Create a normalized `Type` for `SignatureToken` `s` in module `m`. pub fn new(m: &CompiledModule, s: &SignatureToken) -> Self { use SignatureToken::*; match s { Struct(shi) => { let s_handle = m.struct_handle_at(*shi); assert!(s_han...
{ ModuleId::new(self.address, self.name.clone()) }
identifier_body
questionnaire-viewer.component.ts
import { Component, OnInit, Renderer, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { QuestionModel } from '../../models/question.model'; import { QuestionAnswerModel } from '../../models/questionAnswer.model'; import { QuestionnaireModel } from '../../models/questio...
}
// console.log("QuestionnaireViewerComponent - onPageChange called with offset = ", offset); // this.offset = offset; // this.router.navigate(['/questionnaire/page', (offset / this.limit) + 1]); // }
random_line_split
questionnaire-viewer.component.ts
import { Component, OnInit, Renderer, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { QuestionModel } from '../../models/question.model'; import { QuestionAnswerModel } from '../../models/questionAnswer.model'; import { QuestionnaireModel } from '../../models/questio...
} console.log("QuestionnaireViewerComponent - addQuestion, questionsAnswersArray = ", questionsAnswersArray); // POST the questions to the REST endpoint, then process the returned question this.insertAll(questionsAnswersArray); console.log("QuestionnaireViewerComponent - this.questionnaire = ", thi...
{ questionsAnswersArray.push(control.controls[i].value); }
conditional_block
questionnaire-viewer.component.ts
import { Component, OnInit, Renderer, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { QuestionModel } from '../../models/question.model'; import { QuestionAnswerModel } from '../../models/questionAnswer.model'; import { QuestionnaireModel } from '../../models/questio...
insertAll(questionsAnswersArray: Array<QuestionAnswerModel>) { console.log("QuestionnaireViewerComponent - insertAll, questionsAnswersArray = ", questionsAnswersArray); this.questionnairesService.insertAll(questionsAnswersArray).subscribe(result => { console.log("QuestionnaireViewerComponent - insertA...
{ this.loading = true; this.failed = false; this.questionnaireId = parseInt(this.route.params['id'],10); this.route.params.subscribe(params => { this.questionnaireId = parseInt(params['id'],10) this.questionnairesService.get(this.questionnaireId) .subscribe(questionnaire => { c...
identifier_body
questionnaire-viewer.component.ts
import { Component, OnInit, Renderer, ViewChild } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; import { QuestionModel } from '../../models/question.model'; import { QuestionAnswerModel } from '../../models/questionAnswer.model'; import { QuestionnaireModel } from '../../models/questio...
(control: FormArray) { console.log("QuestionnaireViewerComponent - addQuestion, control = ", control); let questionsAnswersArray: Array<QuestionAnswerModel> = []; for(let i=0; i < control.controls.length; i++) { // Check here for 'empty question, empty answer' control, and skip those console.log(...
addQuestion
identifier_name
shared_lock.rs
You can obtain one at http://mozilla.org/MPL/2.0/. */ //! Different objects protected by the same lock #[cfg(feature = "gecko")] use atomic_refcell::{AtomicRefCell, AtomicRef, AtomicRefMut}; #[cfg(feature = "servo")] use parking_lot::RwLock; use std::cell::UnsafeCell; use std::fmt; use std::sync::Arc; /// A shared ...
(&self) -> SharedRwLockWriteGuard { SharedRwLockWriteGuard(self.cell.borrow_mut()) } } /// Proof that a shared lock was obtained for reading (servo). #[cfg(feature = "servo")] pub struct SharedRwLockReadGuard<'a>(&'a SharedRwLock); /// Proof that a shared lock was obtained for writing (gecko). #[cfg(featur...
write
identifier_name
shared_lock.rs
You can obtain one at http://mozilla.org/MPL/2.0/. */ //! Different objects protected by the same lock #[cfg(feature = "gecko")] use atomic_refcell::{AtomicRefCell, AtomicRef, AtomicRefMut}; #[cfg(feature = "servo")] use parking_lot::RwLock; use std::cell::UnsafeCell; use std::fmt; use std::sync::Arc; /// A shared ...
unsafe impl<T: Send + Sync> Sync for Locked<T> {} impl<T: fmt::Debug> fmt::Debug for Locked<T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let guard = self.shared_lock.read(); self.read_with(&guard).fmt(f) } } impl<T> Locked<T> { #[cfg(feature = "servo")] fn same_lock_as(&...
unsafe impl<T: Send> Send for Locked<T> {}
random_line_split
setup.py
""" Setup script for the Gimbal package """ from setuptools import setup from setuptools import find_packages def readme():
header = '======\nGimbal\n======\n' with open('README.rst', 'r') as f: f.readline() return header + f.read() def requirements(): """Returns the requirement list.""" with open('requirements.txt', 'r') as f: return [line.strip() for line in f.readlines()] # read the current ver...
"""Returns the contents of the README without the header image."""
random_line_split
setup.py
""" Setup script for the Gimbal package """ from setuptools import setup from setuptools import find_packages def readme(): """Returns the contents of the README without the header image.""" header = '======\nGimbal\n======\n' with open('README.rst', 'r') as f: f.readline() return header +...
(): """Returns the requirement list.""" with open('requirements.txt', 'r') as f: return [line.strip() for line in f.readlines()] # read the current version number exec(open('gimbal/_version.py').read()) setup( name='gimbal', version=__version__, description=('Tools for importing, creatin...
requirements
identifier_name
setup.py
""" Setup script for the Gimbal package """ from setuptools import setup from setuptools import find_packages def readme(): """Returns the contents of the README without the header image.""" header = '======\nGimbal\n======\n' with open('README.rst', 'r') as f: f.readline() return header +...
# read the current version number exec(open('gimbal/_version.py').read()) setup( name='gimbal', version=__version__, description=('Tools for importing, creating, editing and querying ' + 'molecular geometries'), long_description=readme(), long_description_content_type='text/x-r...
"""Returns the requirement list.""" with open('requirements.txt', 'r') as f: return [line.strip() for line in f.readlines()]
identifier_body
commands.rs
/* * Copyright (c) 2016-2018 Boucher, Antoni <bouanto@zoho.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, ...
#[completion(hidden)] UrlIncrement, #[completion(hidden)] UrlDecrement, #[completion(hidden)] WinFollow, #[help(text="Open an URL in a new window")] WinOpen(String), #[completion(hidden)] WinPasteUrl, #[help(text="Zoom the current page in")] ZoomIn, #[help(text="Zoom ...
#[help(text="Stop loading the current page")] Stop,
random_line_split
commands.rs
/* * Copyright (c) 2016-2018 Boucher, Antoni <bouanto@zoho.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, ...
{ #[completion(hidden)] ActivateSelection, #[help(text="Update the host file used by the adblocker")] AdblockUpdate, #[help(text="Add a new user agent")] AddUserAgent(String), #[help(text="Go back in the history")] Back, #[special_command(incremental, identifier="?")] BackwardSe...
AppCommand
identifier_name
incremental_get.rs
use test::{black_box, Bencher}; use engine_rocks::RocksSnapshot; use kvproto::kvrpcpb::{Context, IsolationLevel}; use std::sync::Arc; use test_storage::SyncTestStorageBuilder; use tidb_query_datatype::codec::table; use tikv::storage::{Engine, SnapshotStore, Statistics, Store}; use txn_types::{Key, Mutation}; fn table...
let mutation = Mutation::Put((key.clone(), user_value)); mutations.push(mutation); keys.push(key); } let pk = table::encode_row_key(5, 0); store .prewrite(Context::default(), mutations, pk, 1) .unwrap(); store.commit(Context::default(), keys, 1, 2).unwrap(); ...
let user_value = vec![b'x'; 60]; let key = Key::from_raw(&user_key);
random_line_split
incremental_get.rs
use test::{black_box, Bencher}; use engine_rocks::RocksSnapshot; use kvproto::kvrpcpb::{Context, IsolationLevel}; use std::sync::Arc; use test_storage::SyncTestStorageBuilder; use tidb_query_datatype::codec::table; use tikv::storage::{Engine, SnapshotStore, Statistics, Store}; use txn_types::{Key, Mutation}; fn table...
#[bench] fn bench_table_lookup_mvcc_incremental_get(b: &mut Bencher) { let (mut store, keys) = table_lookup_gen_data(); b.iter(|| { for key in &keys { black_box(store.incremental_get(key).unwrap()); } }) }
{ let (store, keys) = table_lookup_gen_data(); b.iter(|| { let mut stats = Statistics::default(); for key in &keys { black_box(store.get(key, &mut stats).unwrap()); } }); }
identifier_body
incremental_get.rs
use test::{black_box, Bencher}; use engine_rocks::RocksSnapshot; use kvproto::kvrpcpb::{Context, IsolationLevel}; use std::sync::Arc; use test_storage::SyncTestStorageBuilder; use tidb_query_datatype::codec::table; use tikv::storage::{Engine, SnapshotStore, Statistics, Store}; use txn_types::{Key, Mutation}; fn table...
(b: &mut Bencher) { let (store, keys) = table_lookup_gen_data(); b.iter(|| { let mut stats = Statistics::default(); for key in &keys { black_box(store.get(key, &mut stats).unwrap()); } }); } #[bench] fn bench_table_lookup_mvcc_incremental_get(b: &mut Bencher) { let (...
bench_table_lookup_mvcc_get
identifier_name
tutorial_study.js
"본격적인 학습에 앞서 뉴로스터디의 뇌파 스터디 시스템에 대해 소개해드리겠습니다.\n\n뇌파 스터디는 뇌파 ", "본격적인 학습에 앞서 뉴로 워밍업 프로그램을 소개합니다.\n\n뉴로 워밍업은 학습에 앞서서 집중력과 관련이 높은 세타파를 학습에 적합한 형태로 유도하는 프로그램입니다.\n\n시각 효과와 시냇물 소리를 통하여 사용자의 세타파를 다량 발생하도록 유도하여 집중 상태로 학습에 임할 수 있도록 도와줍니다", ], index : 0, cur : 0, nextEnabled : false, clickMen...
var TutorialStudyLayer = cc.Layer.extend({ label : null, array : [ //"안녕하세요!\n뉴로스터디를 이용해주셔서 감사합니다!\n\n뉴로스터디는 뇌파를 이용한 영어 학습 도구입니다.\n\n뇌파 헤드셋을 통하여 집중력을 측정하고 이에 대한 피드백을 전달하여 사용자가 자연스럽게 집중 상태를 유지하도록 도와줍니다.\n\n이를 통하여 하루 30분 정도의 시간 투자만으로도 놀라울 정도의 학습 효과를 보장합니다.",
random_line_split
tutorial_study.js
var TutorialStudyLayer = cc.Layer.extend({ label : null, array : [ //"안녕하세요!\n뉴로스터디를 이용해주셔서 감사합니다!\n\n뉴로스터디는 뇌파를 이용한 영어 학습 도구입니다.\n\n뇌파 헤드셋을 통하여 집중력을 측정하고 이에 대한 피드백을 전달하여 사용자가 자연스럽게 집중 상태를 유지하도록 도와줍니다.\n\n이를 통하여 하루 30분 정도의 시간 투자만으로도 놀라울 정도의 학습 효과를 보장합니다.", "본격적인 학습에 앞서 뉴로스터디의 뇌파 스터디 시스템에 대해 소개해드...
conditional_block
asserts.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {browser} from 'protractor'; import {getElement, FinderResult, waitForElement, Point} from './query'; /** * ...
expect(Math.round(location.x)).toEqual(Math.round(x)); expect(Math.round(location.y)).toEqual(Math.round(y)); }); } /** * Asserts that one element is aligned with another. */ export async function expectAlignedWith(element: FinderResult, otherElement: FinderResult) { await getElement(otherElement).getLoc...
*/ export async function expectLocation(element: FinderResult, {x, y}: Point) { await getElement(element).getLocation().then((location: Point) => {
random_line_split
asserts.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {browser} from 'protractor'; import {getElement, FinderResult, waitForElement, Point} from './query'; /** * ...
(element: FinderResult, otherElement: FinderResult) { await getElement(otherElement).getLocation().then((location: Point) => { expectLocation(getElement(element), location); }); }
expectAlignedWith
identifier_name
asserts.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {browser} from 'protractor'; import {getElement, FinderResult, waitForElement, Point} from './query'; /** * ...
/** * Asserts that an element is focused. */ export async function expectFocusOn(element: FinderResult, expected = true) { expect(await browser.driver.switchTo().activeElement().getId()).toBe( await getElement(element).getId(), `Expected element${expected ? '' : ' not'} to be focused.`); } /** * Asserts tha...
{ await waitForElement(selector).then((isPresent: boolean) => { expect(isPresent).toBe(expected, `Expected "${selector}"${expected ? '' : ' not'} to exist`); }); }
identifier_body
utils.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbsoluteFsPath, getFileSystem, join, resolve} from '../../../src/ngtsc/file_system'; import {PathMappings} fr...
basePaths.push(basePath); })); } basePaths.sort(); // Get the paths in order with the shorter ones first. return basePaths.filter(removeDeeperPaths); } /** * Extract everything in the `path` up to the first `*`. * @param path The path to parse. * @returns The extracted prefix. */ function extract...
{ basePath = fs.dirname(basePath); }
conditional_block
utils.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbsoluteFsPath, getFileSystem, join, resolve} from '../../../src/ngtsc/file_system'; import {PathMappings} fr...
while (basePath !== baseUrl && (!fs.exists(basePath) || fs.stat(basePath).isFile())) { basePath = fs.dirname(basePath); } basePaths.push(basePath); })); } basePaths.sort(); // Get the paths in order with the shorter ones first. return basePaths.filter(removeDeeperPaths); } /** * E...
// We only want base paths that exist and are not files let basePath = join(baseUrl, extractPathPrefix(path));
random_line_split
utils.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbsoluteFsPath, getFileSystem, join, resolve} from '../../../src/ngtsc/file_system'; import {PathMappings} fr...
(path: string) { return path.split('*', 1)[0]; } /** * A filter function that removes paths that are already covered by higher paths. * * @param value The current path. * @param index The index of the current path. * @param array The array of paths (sorted alphabetically). * @returns true if this path is not a...
extractPathPrefix
identifier_name
utils.ts
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbsoluteFsPath, getFileSystem, join, resolve} from '../../../src/ngtsc/file_system'; import {PathMappings} fr...
/** * A filter function that removes paths that are already covered by higher paths. * * @param value The current path. * @param index The index of the current path. * @param array The array of paths (sorted alphabetically). * @returns true if this path is not already covered by a previous path. */ function re...
{ return path.split('*', 1)[0]; }
identifier_body
rare.py
#!/usr/bin/env python '''Tool to generate computationally-rarefied graphs kmer spectra''' import sys import os import scipy.stats from optparse import OptionParser import numpy as np import ksatools def fract(aa, epsilon, threshold): '''Evaluates the fraction of theoretically-subsampled spectra above a speci...
def calc_resampled_richness(aa, samplefracs, thresholds): '''calculate 2D array, like calc_resampled_richness, of calculated subsampled richness for each fraction in samplefracs and each threshold in thresholds. Returns 2d matrix sith shape = len(samplefracs), len(thresholds) aa must be 2d ndarray ...
matrix[i][j] = dummy return matrix
random_line_split
rare.py
#!/usr/bin/env python '''Tool to generate computationally-rarefied graphs kmer spectra''' import sys import os import scipy.stats from optparse import OptionParser import numpy as np import ksatools def fract(aa, epsilon, threshold):
scipy.stats.hypergeom.cdf( threshold + 0.5, NO, xr[i], epsilon * NO) interim = float(xn[i] * xr[i]) * (gt_thresh / nonzero) if (not np.isnan(interim)) and (interim > 0): p += interim return p / NO def rich(aa, epsilon, threshold): sy...
'''Evaluates the fraction of theoretically-subsampled spectra above a specified threshold. Dataset abundance is attenuated by the factor epsilon. Returns a float beween 0 and 1. aa is a two-column abudnance table, epsilon and threshold are floats. ''' sys.stderr.write("E %f T %f\n" % (epsilon, th...
identifier_body
rare.py
#!/usr/bin/env python '''Tool to generate computationally-rarefied graphs kmer spectra''' import sys import os import scipy.stats from optparse import OptionParser import numpy as np import ksatools def fract(aa, epsilon, threshold): '''Evaluates the fraction of theoretically-subsampled spectra above a speci...
(aa, samplefracs, thresholds): '''calculate 2D array of return value of fract by evaluating it for each fraction in samplefracs and each threshold in thresholds. Returns 2d matrix sith shape = len(samplefracs), len(thresholds) aa must be 2d ndarray ''' assert aa.shape[1] == 2 matrix = np.zer...
calc_resampled_fraction
identifier_name
rare.py
#!/usr/bin/env python '''Tool to generate computationally-rarefied graphs kmer spectra''' import sys import os import scipy.stats from optparse import OptionParser import numpy as np import ksatools def fract(aa, epsilon, threshold): '''Evaluates the fraction of theoretically-subsampled spectra above a speci...
# label=str(thresholdlist[i])) # plt.fill(pex, aug, "k", alpha=0.2) plt.ylim((0, 1)) plt.xlim((1E4, 1E11)) if SHADED == 0 or n + 1 == numplots: plt.xlabel("Sequencing effort (bp)") else: # suppress drawing of x-axis labels for all but last plot frame1 = plt.gca() ...
plt.semilogx(pex, aug, "-", label=lab) plt.fill(pex2, aug2, "k", alpha=0.2) plt.title(label) plt.ylabel("Fraction of data")
conditional_block
mail_compose_message.py
# Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import ast from odoo import api, exceptions, models, _ class MailComposeMessage(models.TransientModel): _inherit = 'mail.compose.message' @api.model def _get_priorities(self): """ Load priorities...
return super().send_mail(auto_commit=auto_commit)
prio = priorities.get(max(limits)) self = self.with_context(default_mail_job_priority=prio)
conditional_block
mail_compose_message.py
# Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import ast from odoo import api, exceptions, models, _ class MailComposeMessage(models.TransientModel): _inherit = 'mail.compose.message' @api.model def _get_priorities(self): """ Load priorities...
_("Error to load the system parameter (%s) of priorities.\n" "Invalid dictionary") % key) return priorities @api.multi def send_mail(self, auto_commit=False): """ Set a priority on subsequent generated mail.mail, using priorities set into the co...
# As literal_eval can transform str into any format, check if we # have a real dict if not isinstance(priorities, dict): raise exceptions.UserError(
random_line_split
mail_compose_message.py
# Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import ast from odoo import api, exceptions, models, _ class
(models.TransientModel): _inherit = 'mail.compose.message' @api.model def _get_priorities(self): """ Load priorities from parameters. :return: dict """ key = 'mail.sending.job.priorities' try: priorities = ast.literal_eval( self.en...
MailComposeMessage
identifier_name
mail_compose_message.py
# Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import ast from odoo import api, exceptions, models, _ class MailComposeMessage(models.TransientModel): _inherit = 'mail.compose.message' @api.model def _get_priorities(self): """ Load priorities...
""" Set a priority on subsequent generated mail.mail, using priorities set into the configuration. :return: dict/action """ active_ids = self.env.context.get('active_ids') default_priority = self.env.context.get('default_mail_job_priority') if active_ids and not d...
identifier_body
utils.js
import pidcrypt from 'pidcrypt' import { path, pipe, type, equals } from 'rambda' import { toByteArray, decodeBase64, encodeBase64, convertFromHex } from 'pidcrypt/pidcrypt_util' import 'pidcrypt/asn1' import 'pidcrypt/rsa' import createError from './error' const { RSA, ASN1 } = pidcrypt const CHARS =...
(response) { return path('data', response) } export function transformError(error) { throw createError(error) } export function uniqueId(length = 15, chars = CHARS) { let i, result = '' for (i = length; i > 0; --i) { result += chars[Math.floor(Math.random() * chars.length)] } return result }
transformResponse
identifier_name
utils.js
import pidcrypt from 'pidcrypt' import { path, pipe, type, equals } from 'rambda' import { toByteArray, decodeBase64, encodeBase64, convertFromHex } from 'pidcrypt/pidcrypt_util' import 'pidcrypt/asn1' import 'pidcrypt/rsa' import createError from './error' const { RSA, ASN1 } = pidcrypt const CHARS =...
return result }
{ result += chars[Math.floor(Math.random() * chars.length)] }
conditional_block
utils.js
import pidcrypt from 'pidcrypt' import { path, pipe, type, equals } from 'rambda' import { toByteArray, decodeBase64, encodeBase64, convertFromHex } from 'pidcrypt/pidcrypt_util' import 'pidcrypt/asn1' import 'pidcrypt/rsa' import createError from './error' const { RSA, ASN1 } = pidcrypt const CHARS =...
export function transformError(error) { throw createError(error) } export function uniqueId(length = 15, chars = CHARS) { let i, result = '' for (i = length; i > 0; --i) { result += chars[Math.floor(Math.random() * chars.length)] } return result }
{ return path('data', response) }
identifier_body