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
local_data.rs
// Copyright 2012 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-MIT or ...
/** * Modify a task-local data value. If the function returns 'None', the * data is removed (and its reference dropped). */ pub unsafe fn local_data_modify<T: 'static>( key: LocalDataKey<T>, modify_fn: &fn(Option<@T>) -> Option<@T>) { local_modify(Handle::new(), key, modify_fn) } #[test] fn test_tls_m...
{ local_set(Handle::new(), key, data) }
identifier_body
csssupportsrule.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 cssparser::{Parser, ParserInput}; use dom::bindings::codegen::Bindings::CSSSupportsRuleBinding; use dom::bindi...
(&self) -> DOMString { let guard = self.cssconditionrule.shared_lock().read(); self.supportsrule .read_with(&guard) .to_css_string(&guard) .into() } }
get_css
identifier_name
csssupportsrule.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 cssparser::{Parser, ParserInput}; use dom::bindings::codegen::Bindings::CSSSupportsRuleBinding; use dom::bindi...
} } impl SpecificCSSRule for CSSSupportsRule { fn ty(&self) -> u16 { use dom::bindings::codegen::Bindings::CSSRuleBinding::CSSRuleConstants; CSSRuleConstants::SUPPORTS_RULE } fn get_css(&self) -> DOMString { let guard = self.cssconditionrule.shared_lock().read(); self.s...
}
random_line_split
csssupportsrule.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 cssparser::{Parser, ParserInput}; use dom::bindings::codegen::Bindings::CSSSupportsRuleBinding; use dom::bindi...
.namespaces .read(); cond.eval(&context, &namespaces) }; let mut guard = self.cssconditionrule.shared_lock().write(); let rule = self.supportsrule.write_with(&mut guard); rule.condition = cond; ru...
{ let global = self.global(); let win = global.as_window(); let url = win.Document().url(); let quirks_mode = win.Document().quirks_mode(); let context = ParserContext::new_for_cssom( &url, Some(CssRuleType::Supports), ...
conditional_block
csssupportsrule.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 cssparser::{Parser, ParserInput}; use dom::bindings::codegen::Bindings::CSSSupportsRuleBinding; use dom::bindi...
}
{ let guard = self.cssconditionrule.shared_lock().read(); self.supportsrule .read_with(&guard) .to_css_string(&guard) .into() }
identifier_body
bmn-paraBlastKepler.py
#!/usr/bin/env python ### cut a fasta query (arg1) in "nbPart" (arg3) ### subFasta files and launches a blast programm (arg4) ### vs the bank (arg2) for each subfasta and then ### concatenates the tab delimited blast results in ### one file. You can add any additional blastall option in the ### arg5 with quotes like th...
#### concatenates the blast files results #### and removes the temp files used os.system("cat " + tmpDir+"/"+"*.blast > "+ wDir + '/' + str.split(fastafile,'/')[-1]+".vs."+str.split(bank,'/')[-1]+".blast") os.system("rm -rf "+ tmpDir)
#### waits for the end of all processes for i in myProcesses: i.wait()
random_line_split
bmn-paraBlastKepler.py
#!/usr/bin/env python ### cut a fasta query (arg1) in "nbPart" (arg3) ### subFasta files and launches a blast programm (arg4) ### vs the bank (arg2) for each subfasta and then ### concatenates the tab delimited blast results in ### one file. You can add any additional blastall option in the ### arg5 with quotes like th...
tmpFasta=tempfile.mkstemp(dir=tmpDir,suffix="."+str(nbPart)+".fasta") SeqIO.write(seqs[iteSeqs:nbSeqs], tmpFasta[1], "fasta") #### runs the blast my_blast_files = os.listdir(tmpDir) myProcesses=[] for blast_file in my_blast_files: cmd= "blastall -m 8"+" "+ " "+\ "-p"+" "+ my_blast_prog + " "+\ "-i"+" "+ tmpDir+...
tmpFasta=tempfile.mkstemp(dir=tmpDir,suffix="."+str(i)+".fasta") SeqIO.write(seqs[iteSeqs:iteSeqs+nbSeqsbyfile], tmpFasta[1], "fasta") iteSeqs+=nbSeqsbyfile
conditional_block
legend-polygon.ts
/* * Copyright (C) 2017 Atelier Cartographique <contact@atelier-cartographique.be> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is dis...
const item = (geomType: string, dataUrl: string, label: string) => { return DIV({ className: `legend-item ${geomType}` }, DIV({ className: 'item-style' }, IMG({ src: dataUrl })), DIV({ className: 'item-label' }, SPAN({}, label))); }; const renderSimple = (config: PolygonSty...
random_line_split
legend-polygon.ts
/* * Copyright (C) 2017 Atelier Cartographique <contact@atelier-cartographique.be> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is dis...
}); return items; }; const renderContinuous = (config: PolygonStyleConfigContinuous, _layerInfo: ILayerInfo, ctx: IOLContext) => { const { canvas, canvasContext, olContext } = ctx; const styleFn = polygonStyle(config); const items: React.DOMElement<{}, Element>[] = []; config.intervals.forEac...
{ canvasContext.clearRect(0, 0, 100, 100); const f = new Feature(polygonGeometry); f.set(config.propName, group.values[0]); const styles = styleFn(f); styles.forEach((style) => { olContext.drawFeature(f, style); }); item...
conditional_block
ruleAction.ts
// // Copyright (c) Microsoft Corporation. All rights reserved. // // 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 // http://www.apache.org/licenses/LICENSE-2.0 // // Unless requ...
module ts.formatting { export const enum RuleAction { Ignore = 0x00000001, Space = 0x00000002, NewLine = 0x00000004, Delete = 0x00000008 } }
// ///<reference path='references.ts' />
random_line_split
BeaconService.ts
sending the actual beacons. This service should not be accessed externally, instead * the sending shhould be managed through the methods provided with the EUMElements. * * This service is also responsible for the management of the sessionID and the tabID. If the corresponding IDs are not assigned, it * will reque...
if (!beaconApiSuccess) { const xhrPost = new XMLHttpRequest(); xhrPost.open("POST", BEACON_URL, true); xhrPost.setRequestHeader("Content-Type", "application/json"); let responseHandled = false; const responseHandler = Instrumen...
{ beaconApiSuccess = navigator.sendBeacon(BEACON_URL, JSON.stringify(beaconObj)); }
conditional_block
BeaconService.ts
sending the actual beacons. This service should not be accessed externally, instead * the sending shhould be managed through the methods provided with the EUMElements. * * This service is also responsible for the management of the sessionID and the tabID. If the corresponding IDs are not assigned, it * will reque...
/** * Adds an element to the send queue and updates the timing Binformation for the sending policy. * * @param element * the element to send */ export function send<T extends BeaconElement>(element: DTO<T>) { if (isDisabled) { return; } ...
{ if (!awaitingResponse && dataToSend.length > 0) { const time = Util.timestampMS(); if (time >= backoffTimestamp && ((time - firstDataInQueueTimestamp!) >= MAX_TIME_WINDOW || (time - lastDataInQueueTimestamp!) >= TIME_WINDOW)) { forceBeaconSend(false); } ...
identifier_body
BeaconService.ts
sending the actual beacons. This service should not be accessed externally, instead * the sending shhould be managed through the methods provided with the EUMElements. * * This service is also responsible for the management of the sessionID and the tabID. If the corresponding IDs are not assigned, it * will reque...
* The special value for sessionID and tabID to be sent in beacons for requesting a new ID. */ const REQUEST_NEW_ID_MARKER = "-1"; /** * After this amount of time of inactivity (no new data added to send), the beacon will be sent. */ const TIME_WINDOW: number = 2500; /** * A el...
* Constant holding whether navigator.sendBeacon is supported. */ const BEACON_API_SUPPORTED = (typeof navigator.sendBeacon !== "undefined"); /**
random_line_split
BeaconService.ts
sending the actual beacons. This service should not be accessed externally, instead * the sending shhould be managed through the methods provided with the EUMElements. * * This service is also responsible for the management of the sessionID and the tabID. If the corresponding IDs are not assigned, it * will reque...
() { isDisabled = true; if (sendTimer) { clearInterval(sendTimer); sendTimer = null; } dataToSend = []; } /** * A timer executed every second to check the conditions for sending a new beacon. If the conditions are met, a beacon is sent. */ f...
disableBeaconService
identifier_name
dli_powerswitch_logs.py
# Copyright 2022 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# limitations under the License. """Device logs for DLI powerswitch devices.""" RETURN_CODE = "200\n" ERROR_RETURN_CODE = "409\n" DEFAULT_BEHAVIOR = { "http://123.45.67.89/restapi/config/=version/": { "text": '["1.7.15.0"]', "status_code": "207" }, "http://123.45.67.89/restapi/config/=ser...
# See the License for the specific language governing permissions and
random_line_split
beneficiary-document.component.ts
import { Component,Input,ViewChild } from '@angular/core'; import { ActivatedRoute,Router } from '@angular/router'; import { FormGroup,FormControl } from '@angular/forms'; import { ModalDirective } from 'ng2-bootstrap/modal'; import { Beneficiary } from '../model/beneficiary.interface'; import { BeneficiaryServ...
public hideChildModal():void { this.childModal.hide(); } fileChangeEvent(fileInput: any){ this.docToUpload = <File> fileInput.target.files[0]; console.log(this.docToUpload.name); } uploadDoc():void{ this._service.postDocument(this.docToUpload) ...
}
random_line_split
beneficiary-document.component.ts
import { Component,Input,ViewChild } from '@angular/core'; import { ActivatedRoute,Router } from '@angular/router'; import { FormGroup,FormControl } from '@angular/forms'; import { ModalDirective } from 'ng2-bootstrap/modal'; import { Beneficiary } from '../model/beneficiary.interface'; import { BeneficiaryServ...
}
{ this._service.postDocument(this.docToUpload) .subscribe(error=>this.errorMessage=error); }
identifier_body
beneficiary-document.component.ts
import { Component,Input,ViewChild } from '@angular/core'; import { ActivatedRoute,Router } from '@angular/router'; import { FormGroup,FormControl } from '@angular/forms'; import { ModalDirective } from 'ng2-bootstrap/modal'; import { Beneficiary } from '../model/beneficiary.interface'; import { BeneficiaryServ...
():void{ this._service.postDocument(this.docToUpload) .subscribe(error=>this.errorMessage=error); } }
uploadDoc
identifier_name
__init__.py
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information
# with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or im...
# regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance
random_line_split
test-generator.py
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
(self): self.assertEqual(self.data, TemplateData(baz = 42).extend(foo = 'bar'))
test_equals
identifier_name
test-generator.py
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
self.assertEqual(self.data.extend(jake = 0.3), TemplateData(baz = 42, foo = 'bar', jake = 0.3)) def test_equals(self): self.assertEqual(self.data, TemplateData(baz = 42).extend(foo = 'bar'))
def setUp(self): self.data = TemplateData(foo = 'bar', baz = 42) def test_member_access(self): try: self.data.bip self.fail("Access to undefined template data slots should raise") except AttributeError: # expected pass def test_member_mutation(self): try: self.data.ba...
identifier_body
test-generator.py
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
# See the License for the specific language governing permissions and # limitations under the License. # ================================================================================================== __author__ = 'John Sirios' from twitter.pants.base.generator import TemplateData import unittest class TemplateD...
# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
random_line_split
ko.withfirst.js
define([ 'knockout' ],function( ko ){ ko.bindingHandlers.withfirst = { 'init' : function(element, valueAccessor, allBindings, viewModel, bindingContext) { var savedNodes; ko.computed(function() { var dataValue = ko.utils.unwrapObservable(valueAccessor()); var shouldDisplay = typeof...
}, null).extend({ rateLimit: 50 }); return { 'controlsDescendantBindings': true }; } } });
{ ko.virtualElements.emptyNode(element); }
conditional_block
ko.withfirst.js
define([ 'knockout' ],function( ko ){ ko.bindingHandlers.withfirst = {
var shouldDisplay = typeof dataValue.length == "number" && dataValue.length; var isFirstRender = !savedNodes; // Save a copy of the inner nodes on the initial update, // but only if we have dependencies. if (isFirstRender && ko.computedContext.getDependenciesCount()) { ...
'init' : function(element, valueAccessor, allBindings, viewModel, bindingContext) { var savedNodes; ko.computed(function() { var dataValue = ko.utils.unwrapObservable(valueAccessor());
random_line_split
storage_file.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage file CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_file from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class StorageFileArgumentsHelperTe...
if __name__ == '__main__': unittest.main()
"""Tests the ParseOptions function.""" test_tool = tools.CLITool() options = cli_test_lib.TestOptions() options.storage_file = self._GetTestFilePath(['test.plaso']) storage_file.StorageFileArgumentsHelper.ParseOptions(options, test_tool) self.assertEqual(test_tool._storage_file_path, options.stora...
identifier_body
storage_file.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage file CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_file from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class
(cli_test_lib.CLIToolTestCase): """Tests for the storage file CLI arguments helper.""" # pylint: disable=no-member,protected-access _EXPECTED_OUTPUT = """\ usage: cli_helper.py [STORAGE_FILE] Test argument parser. positional arguments: STORAGE_FILE Path to a storage file. """ def testAddArguments(self):...
StorageFileArgumentsHelperTest
identifier_name
storage_file.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage file CLI arguments helper.""" import argparse import unittest
from tests.cli import test_lib as cli_test_lib class StorageFileArgumentsHelperTest(cli_test_lib.CLIToolTestCase): """Tests for the storage file CLI arguments helper.""" # pylint: disable=no-member,protected-access _EXPECTED_OUTPUT = """\ usage: cli_helper.py [STORAGE_FILE] Test argument parser. positional ...
from plaso.cli import tools from plaso.cli.helpers import storage_file from plaso.lib import errors
random_line_split
storage_file.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Tests for the storage file CLI arguments helper.""" import argparse import unittest from plaso.cli import tools from plaso.cli.helpers import storage_file from plaso.lib import errors from tests.cli import test_lib as cli_test_lib class StorageFileArgumentsHelperTe...
unittest.main()
conditional_block
payment_form.js
odoo.define('payment_stripe.payment_form', function (require) { "use strict"; var ajax = require('web.ajax'); var core = require('web.core'); var Dialog = require('web.Dialog'); var PaymentForm = require('payment.payment_form'); var qweb = core.qweb; var _t = core._t; ajax.loadXML('/payment_stripe/static/src/xml/str...
ev.preventDefault(); var $checkedRadio = this.$('input[type="radio"]:checked'); // first we check that the user has selected a stripe as add payment method if ($checkedRadio.length === 1 && this.isNewPaymentRadio($checkedRadio) && $checkedRadio.data('provider') === 'stripe') { ...
/** * @override */ addPmEvent: function (ev) { ev.stopPropagation();
random_line_split
payment_form.js
odoo.define('payment_stripe.payment_form', function (require) { "use strict"; var ajax = require('web.ajax'); var core = require('web.core'); var Dialog = require('web.Dialog'); var PaymentForm = require('payment.payment_form'); var qweb = core.qweb; var _t = core._t; ajax.loadXML('/payment_stripe/static/src/xml/str...
else { $checkedRadio.val(result.id); self.el.submit(); } }).guardedCatch(function (error) { // We don't want to open the Error dialog since // we already have a container displaying the error if (error.event) { erro...
{ if (formData.return_url) { window.location = formData.return_url; } else { window.location.reload(); } }
conditional_block
borrowck-borrow-overloaded-auto-deref.rs
// Copyright 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-MIT or ...
(x: Rc<Point>) { x.set(0, 0); //~ ERROR cannot borrow } fn deref_mut_method2(mut x: Rc<Point>) { x.set(0, 0); //~ ERROR cannot borrow } fn deref_extend_method(x: &Rc<Point>) -> &isize { x.x_ref() } fn deref_extend_mut_method1(x: &Rc<Point>) -> &mut isize { x.y_mut() //~ ERROR cannot borrow } fn dere...
deref_mut_method1
identifier_name
borrowck-borrow-overloaded-auto-deref.rs
// Copyright 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-MIT or ...
fn deref(&self) -> &T { unsafe { &*self.value } } } struct Point { x: isize, y: isize } impl Point { fn get(&self) -> (isize, isize) { (self.x, self.y) } fn set(&mut self, x: isize, y: isize) { self.x = x; self.y = y; } fn x_ref(&self) -> &isize { ...
impl<T> Deref for Rc<T> { type Target = T;
random_line_split
borrowck-borrow-overloaded-auto-deref.rs
// Copyright 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-MIT or ...
fn deref_extend_mut_method1(x: &Rc<Point>) -> &mut isize { x.y_mut() //~ ERROR cannot borrow } fn deref_extend_mut_method2(x: &mut Rc<Point>) -> &mut isize { x.y_mut() //~ ERROR cannot borrow } fn assign_method1<'a>(x: Rc<Point>) { *x.y_mut() = 3; //~ ERROR cannot borrow } fn assign_method2<'a>(x: &'a ...
{ x.x_ref() }
identifier_body
path.js
/* * Path * @author Caro.Huang */ (function () { var self = caro; /* * get dir-path * @param {string} path * @return {string} */ self.getDirPath = function (path) { var filename = caro.getFileName(path); return caro.replaceLast(path, filename, ''); }; /* * get file name in path * ...
var extendName = caro.getExtendName(path); return path.replace(extendName, ''); }; /* * get extend name of file * @param {string} path * @param {boolean} [withDot] if return extend-name with '.' * @return {string} */ self.getExtendName = function (path, withDot) { withDot = withDot !=...
{ return path; }
conditional_block
path.js
/* * Path * @author Caro.Huang */ (function () { var self = caro; /* * get dir-path * @param {string} path * @return {string} */ self.getDirPath = function (path) { var filename = caro.getFileName(path); return caro.replaceLast(path, filename, ''); }; /* * get file name in path * ...
* @return {string} */ self.getExtendName = function (path, withDot) { withDot = withDot !== false; var fileName = caro.getFileName(path); var aFileName = caro.splitStr(fileName, '.'); if (aFileName.length === 1) { return ''; } var extendName = aFileName[aFileName.length - 1]; ...
}; /* * get extend name of file * @param {string} path * @param {boolean} [withDot] if return extend-name with '.'
random_line_split
Loading.spec.tsx
/* MIT License Copyright (c) 2021 Looker Data Sciences, Inc. 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, copy, modi...
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER ...
random_line_split
bytes.rs
// These are tests specifically crafted for regexes that can match arbitrary // bytes. // A silly wrapper to make it possible to write and match raw bytes. struct R<'a>(&'a [u8]); impl<'a> R<'a> { fn as_bytes(&self) -> &'a [u8] { self.0 } } mat!(word_boundary, r"(?-u) \b", " δ", None); #[cfg(feature =...
mat!(perl_d_unicode, r"\d+", "1२३9", Some((0, 8))); mat!(perl_s_ascii, r"(?-u)\s+", " \u{1680}", Some((0, 1))); #[cfg(feature = "unicode-perl")] mat!(perl_s_unicode, r"\s+", " \u{1680}", Some((0, 4))); // The first `(.+)` matches two Unicode codepoints, but can't match the 5th // byte, which isn't valid UTF-8. The sec...
mat!(perl_w_unicode, r"\w+", "aδ", Some((0, 3))); mat!(perl_d_ascii, r"(?-u)\d+", "1२३9", Some((0, 1))); #[cfg(feature = "unicode-perl")]
random_line_split
bytes.rs
// These are tests specifically crafted for regexes that can match arbitrary // bytes. // A silly wrapper to make it possible to write and match raw bytes. struct R<'a>(&'a [u8]); impl<'a> R<'a> { fn as_bytes(&self) -> &'a [u8]
} mat!(word_boundary, r"(?-u) \b", " δ", None); #[cfg(feature = "unicode-perl")] mat!(word_boundary_unicode, r" \b", " δ", Some((0, 1))); mat!(word_not_boundary, r"(?-u) \B", " δ", Some((0, 1))); #[cfg(feature = "unicode-perl")] mat!(word_not_boundary_unicode, r" \B", " δ", None); mat!(perl_w_ascii, r"(?-u)\w+", "aδ...
{ self.0 }
identifier_body
bytes.rs
// These are tests specifically crafted for regexes that can match arbitrary // bytes. // A silly wrapper to make it possible to write and match raw bytes. struct
<'a>(&'a [u8]); impl<'a> R<'a> { fn as_bytes(&self) -> &'a [u8] { self.0 } } mat!(word_boundary, r"(?-u) \b", " δ", None); #[cfg(feature = "unicode-perl")] mat!(word_boundary_unicode, r" \b", " δ", Some((0, 1))); mat!(word_not_boundary, r"(?-u) \B", " δ", Some((0, 1))); #[cfg(feature = "unicode-perl")]...
R
identifier_name
client.rs
//! Defines functionality for a minimalistic synchronous client. use hyper::{Client as HttpClient, Decoder, Encoder, Next}; use hyper::client::{Handler, Request as ClientRequest, Response as ClientResponse}; use hyper::net::HttpStream; use std::thread::{self, Thread}; use buffer::Buffer; pub struct Client { res...
} pub fn status(&self) -> ::hyper::status::StatusCode { *self.result.response.as_ref().unwrap().status() } } struct ClientHandler { thread: Thread, buffer: Buffer, result: *mut RequestResult } unsafe impl Send for ClientHandler {} impl ClientHandler { fn new(result: &mut Request...
{ Vec::new() }
conditional_block
client.rs
//! Defines functionality for a minimalistic synchronous client. use hyper::{Client as HttpClient, Decoder, Encoder, Next}; use hyper::client::{Handler, Request as ClientRequest, Response as ClientResponse}; use hyper::net::HttpStream; use std::thread::{self, Thread}; use buffer::Buffer; pub struct Client { res...
fn on_request(&mut self, _req: &mut ClientRequest) -> Next { Next::read() } fn on_request_writable(&mut self, _encoder: &mut Encoder<HttpStream>) -> Next { Next::read() } fn on_response(&mut self, res: ClientResponse) -> Next { use hyper::header::ContentLength; if ...
} } impl Handler<HttpStream> for ClientHandler {
random_line_split
client.rs
//! Defines functionality for a minimalistic synchronous client. use hyper::{Client as HttpClient, Decoder, Encoder, Next}; use hyper::client::{Handler, Request as ClientRequest, Response as ClientResponse}; use hyper::net::HttpStream; use std::thread::{self, Thread}; use buffer::Buffer; pub struct Client { res...
} impl Handler<HttpStream> for ClientHandler { fn on_request(&mut self, _req: &mut ClientRequest) -> Next { Next::read() } fn on_request_writable(&mut self, _encoder: &mut Encoder<HttpStream>) -> Next { Next::read() } fn on_response(&mut self, res: ClientResponse) -> Next { ...
{ unsafe { (*self.result).body = Some(self.buffer.take()); } // unlocks waiting thread self.thread.unpark(); }
identifier_body
client.rs
//! Defines functionality for a minimalistic synchronous client. use hyper::{Client as HttpClient, Decoder, Encoder, Next}; use hyper::client::{Handler, Request as ClientRequest, Response as ClientResponse}; use hyper::net::HttpStream; use std::thread::{self, Thread}; use buffer::Buffer; pub struct Client { res...
(&mut self, err: ::hyper::Error) -> Next { println!("ERROR: {}", err); Next::remove() } }
on_error
identifier_name
test-suite-tree.component.ts
/* * Copyright 2015 - 2021 TU Dortmund * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
(testSuite: any): void { this.selected.emit(testSuite); } }
selectTestSuite
identifier_name
test-suite-tree.component.ts
/* * Copyright 2015 - 2021 TU Dortmund * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
}) export class TestSuiteTreeComponent implements OnInit { @Output() selected = new EventEmitter<any>(); @Input() selectedTestSuite: any; @Input() testSuite: any; @Input() level: any; /** If the children are collapsed. */ collapse = false; ngOnInit(): void { this.level = this.level == nu...
styleUrls: ['./test-suite-tree.component.scss']
random_line_split
test-suite-tree.component.ts
/* * Copyright 2015 - 2021 TU Dortmund * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
}
{ this.selected.emit(testSuite); }
identifier_body
test-suite-tree.component.ts
/* * Copyright 2015 - 2021 TU Dortmund * * 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 * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
} /** * Get the test suites in the test. * * @return The test suites. */ getTestSuites(): any[] { return this.testSuite.tests.filter(t => t.type === 'suite'); } /** * Select the test suite where the tests should be moved to. * * @param testSuite The target test suite. */ selec...
{ this.collapse = true; }
conditional_block
githubissuetracker.py
""" file: gitissuetracker.py author: Christoffer Rosen <cbr4830@rit.edu> date: December, 2013 description: Represents a Github Issue tracker object used for getting the dates issues were opened. 12/12/13: Doesn't currently support private repos """ import requests, json, dateutil.parser, time from caslogging impor...
(self, owner, repo): """ Constructor """ self.owner = owner self.repo = repo self.auth_token = None self.authenticate() # Authenticate our app def authenticate(self): """ authenticate() Authenticates this application to github using the cas-user git user credentials. This is temporary! """ ...
__init__
identifier_name
githubissuetracker.py
""" file: gitissuetracker.py author: Christoffer Rosen <cbr4830@rit.edu> date: December, 2013 description: Represents a Github Issue tracker object used for getting the dates issues were opened. 12/12/13: Doesn't currently support private repos """ import requests, json, dateutil.parser, time from caslogging impor...
data = r.json()[0] if r.status_code >= 400: msg = data.get('message') logging.error("Failed to authenticate issue tracker: \n" +msg) return # Exit else: self.auth_token = data.get("token") requests_left = r.headers.get('x-ratelimit-remaining') logging.info("Analyzer has " + requests_left + " is...
""" authenticate() Authenticates this application to github using the cas-user git user credentials. This is temporary! """ s = requests.Session() s.auth = ("cas-user", "riskykiwi1") payload = {"scopes": ["repo"]} r = s.get(self.request_auth, params=payload) if r.headers.get('x-ratelimit-remaining')...
identifier_body
githubissuetracker.py
""" file: gitissuetracker.py author: Christoffer Rosen <cbr4830@rit.edu> date: December, 2013 description: Represents a Github Issue tracker object used for getting the dates issues were opened. 12/12/13: Doesn't currently support private repos
class GithubIssueTracker: """ GitIssueTracker() Represents a Github Issue Tracker Object """ owner = None # Owner of the github repo repo = None # The repo name request_repos = "https://api.github.com/repos" # Request url to get issue info request_auth = "https://api.github.com/authori...
""" import requests, json, dateutil.parser, time from caslogging import logging
random_line_split
githubissuetracker.py
""" file: gitissuetracker.py author: Christoffer Rosen <cbr4830@rit.edu> date: December, 2013 description: Represents a Github Issue tracker object used for getting the dates issues were opened. 12/12/13: Doesn't currently support private repos """ import requests, json, dateutil.parser, time from caslogging impor...
# Check for other error codes elif r.status_code >= 400: msg = data.get('message') logging.error("ISSUE TRACKER FAILURE: \n" + msg) return None else: try: date = (dateutil.parser.parse(data.get('created_at'))).timestamp() return date except: logging.error("ISSUE TRACKER FAILURE: Could...
if r.headers.get('x-ratelimit-remaining') == '0': logging.info("Github quota limit hit -- waiting") # Wait up to a hour until we can continue.. while r.headers.get('x-ratelimit-remaining') == '0': time.sleep(600) # Wait 10 minutes and try again r = requests.get(self.request_repos + "/" + self.own...
conditional_block
lib.rs
#![allow(dead_code)] extern crate oscillator; extern crate stopwatch; use oscillator::Oscillator; use stopwatch::Stopwatch; fn assert_near(a : f32, b : f32)
#[test] fn test_new() { let mut osc = Oscillator::new(); assert_eq!(osc.get_value(), 1.0); } #[test] fn test_null_freq() { let mut osc = Oscillator::start_new(); osc.set_frequency(0.0); assert_eq!(osc.get_value(), 1.0); } #[test] fn test_cycle() { let mut timer = Stopwatch::start_new(); ...
{ assert!((a-b).abs() < 0.05) }
identifier_body
lib.rs
#![allow(dead_code)] extern crate oscillator; extern crate stopwatch; use oscillator::Oscillator; use stopwatch::Stopwatch; fn assert_near(a : f32, b : f32) { assert!((a-b).abs() < 0.05) } #[test] fn test_new() { let mut osc = Oscillator::new(); assert_eq!(osc.get_value(), 1.0); } #[test] fn test_null_...
#[test] fn test_cycle() { let mut timer = Stopwatch::start_new(); let mut osc = Oscillator::start_new(); assert_near(osc.get_value(), 1.0); while timer.elapsed_ms() < 500 { } assert_near(osc.get_value(), 0.0); while timer.elapsed_ms() < 1000 { } assert_near(osc.get_value(), 1.0); } #[t...
random_line_split
lib.rs
#![allow(dead_code)] extern crate oscillator; extern crate stopwatch; use oscillator::Oscillator; use stopwatch::Stopwatch; fn assert_near(a : f32, b : f32) { assert!((a-b).abs() < 0.05) } #[test] fn test_new() { let mut osc = Oscillator::new(); assert_eq!(osc.get_value(), 1.0); } #[test] fn test_null_...
() { let mut timer = Stopwatch::start_new(); let mut osc = Oscillator::start_new(); assert_near(osc.get_value(), 1.0); while timer.elapsed_ms() < 500 { } assert_near(osc.get_value(), 0.0); while timer.elapsed_ms() < 1000 { } assert_near(osc.get_value(), 1.0); } #[test] fn test_freq() {...
test_cycle
identifier_name
build.rs
use std::env; fn main() { println!("cargo:rerun-if-changed=build.rs"); let target = env::var("TARGET").expect("TARGET was not set");
if env::var("RUST_STD_FREEBSD_12_ABI").is_ok() { println!("cargo:rustc-cfg=freebsd12"); } } else if target.contains("linux") || target.contains("netbsd") || target.contains("dragonfly") || target.contains("openbsd") || target.contains("solaris") ||...
if target.contains("freebsd") {
random_line_split
build.rs
use std::env; fn main() { println!("cargo:rerun-if-changed=build.rs"); let target = env::var("TARGET").expect("TARGET was not set"); if target.contains("freebsd") { if env::var("RUST_STD_FREEBSD_12_ABI").is_ok() { println!("cargo:rustc-cfg=freebsd12"); } } else if target.con...
else { // This is for Cargo's build-std support, to mark std as unstable for // typically no_std platforms. // This covers: // - os=none ("bare metal" targets) // - mipsel-sony-psp // - nvptx64-nvidia-cuda // - arch=avr // - tvos (aarch64-apple-tvos, x86_...
{ // These platforms don't have any special requirements. }
conditional_block
build.rs
use std::env; fn
() { println!("cargo:rerun-if-changed=build.rs"); let target = env::var("TARGET").expect("TARGET was not set"); if target.contains("freebsd") { if env::var("RUST_STD_FREEBSD_12_ABI").is_ok() { println!("cargo:rustc-cfg=freebsd12"); } } else if target.contains("linux") ...
main
identifier_name
build.rs
use std::env; fn main()
|| target.contains("l4re") || target.contains("redox") || target.contains("haiku") || target.contains("vxworks") || target.contains("wasm32") || target.contains("wasm64") || target.contains("asmjs") || target.contains("espidf") || target.contains("...
{ println!("cargo:rerun-if-changed=build.rs"); let target = env::var("TARGET").expect("TARGET was not set"); if target.contains("freebsd") { if env::var("RUST_STD_FREEBSD_12_ABI").is_ok() { println!("cargo:rustc-cfg=freebsd12"); } } else if target.contains("linux") ||...
identifier_body
_process_win32.py
"""Windows-specific implementation of process utilities. This file is only meant to be imported by process.py, not by end-users. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD Licen...
else: return path def _system_body(p): """Callback for _system.""" enc = DEFAULT_ENCODING for line in read_no_interrupt(p.stdout).splitlines(): line = line.decode(enc, 'replace') print(line, file=sys.stdout) for line in read_no_interrupt(p.stderr).splitlines(): ...
raise OSError("command %r not found" % cmd)
conditional_block
_process_win32.py
"""Windows-specific implementation of process utilities. This file is only meant to be imported by process.py, not by end-users. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD Licen...
#----------------------------------------------------------------------------- class AvoidUNCPath(object): """A context manager to protect command execution from UNC paths. In the Win32 API, commands can't be invoked with the cwd being a UNC path. This context manager temporarily changes directory to the ...
from .encoding import DEFAULT_ENCODING #----------------------------------------------------------------------------- # Function definitions
random_line_split
_process_win32.py
"""Windows-specific implementation of process utilities. This file is only meant to be imported by process.py, not by end-users. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD Licen...
self.path = os.getcwdu() self.is_unc_path = self.path.startswith(r"\\") if self.is_unc_path: # change to c drive (as cmd.exe cannot handle UNC addresses) os.chdir("C:") return self.path else: # We return None to signal that there was no cha...
"""A context manager to protect command execution from UNC paths. In the Win32 API, commands can't be invoked with the cwd being a UNC path. This context manager temporarily changes directory to the 'C:' drive on entering, and restores the original working directory on exit. The context manager return...
identifier_body
_process_win32.py
"""Windows-specific implementation of process utilities. This file is only meant to be imported by process.py, not by end-users. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD Licen...
(cmd): """Find the full path to a .bat or .exe using the win32api module.""" try: from win32api import SearchPath except ImportError: raise ImportError('you need to have pywin32 installed for this to work') else: PATH = os.environ['PATH'] extensions = ['.exe', '.com', '.b...
_find_cmd
identifier_name
logistic_company.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
res = super(logistic_company, self)._get_company_code(cr, user, context=context) res.append(('fedex', 'FedEx')) return list(set(res)) _columns = { 'ship_company_code': fields.selection(_get_company_code, 'Logistic Company', method=True, required=True, size=64), 'fedex_accou...
class logistic_company(osv.osv): _inherit="logistic.company" def _get_company_code(self, cr, user, context=None):
random_line_split
logistic_company.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
return{'value': ret} logistic_company() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
b = url[url.rindex('/'): len(url)] b = b.strip('/') if re.match("^[0-9]*$", b): url = url[0:url.rindex('/')] url += ('/' + shipping_no) ret['url'] = url
conditional_block
logistic_company.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
_columns = { 'ship_company_code': fields.selection(_get_company_code, 'Logistic Company', method=True, required=True, size=64), 'fedex_account_shipping_id': fields.many2one('fedex.account.shipping', 'FedEx Shipping Account'), } def onchange_shipping_number(self, cr, uid, ids, shipping_no,...
res = super(logistic_company, self)._get_company_code(cr, user, context=context) res.append(('fedex', 'FedEx')) return list(set(res))
identifier_body
logistic_company.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 NovaPoint Group LLC (<http://www.novapointgroup.com>) # Copyright (C) 2004-2010 OpenERP SA (<http://www.openerp.com>) # # This program is f...
(osv.osv): _inherit="logistic.company" def _get_company_code(self, cr, user, context=None): res = super(logistic_company, self)._get_company_code(cr, user, context=context) res.append(('fedex', 'FedEx')) return list(set(res)) _columns = { 'ship_company_code': fields.select...
logistic_company
identifier_name
racelib.py
#!/usr/bin/python # coding:utf-8 # Author: ASU --<andrei.suiu@gmail.com> # Purpose: Concurrent utility classes (name coming from RACEconditionLIBrary) # Created: 11/26/2015 import time __author__ = 'ASU' class ContextLock(): def __init__(self, lock): """ :param lock: :type lock: thread.Lo...
return True
return False
conditional_block
racelib.py
#!/usr/bin/python # coding:utf-8 # Author: ASU --<andrei.suiu@gmail.com> # Purpose: Concurrent utility classes (name coming from RACEconditionLIBrary) # Created: 11/26/2015 import time __author__ = 'ASU' class ContextLock(): def __init__(self, lock): """ :param lock: :type lock: thread.Lo...
def __init__(self, logger): """ :param logger: logger function tha would get argument number of seconds :type logger: (basestring) -> None """ self._logger = logger def __enter__(self): self._t1 = time.time() def __exit__(self, exc_type, exc_value, traceback...
"""
random_line_split
racelib.py
#!/usr/bin/python # coding:utf-8 # Author: ASU --<andrei.suiu@gmail.com> # Purpose: Concurrent utility classes (name coming from RACEconditionLIBrary) # Created: 11/26/2015 import time __author__ = 'ASU' class ContextLock(): def __init__(self, lock): """ :param lock: :type lock: thread.Lo...
def __exit__(self, exc_type, exc_value, traceback): self._logger(time.time() - self._t1) if exc_type: return False return True
self._t1 = time.time()
identifier_body
racelib.py
#!/usr/bin/python # coding:utf-8 # Author: ASU --<andrei.suiu@gmail.com> # Purpose: Concurrent utility classes (name coming from RACEconditionLIBrary) # Created: 11/26/2015 import time __author__ = 'ASU' class ContextLock(): def __init__(self, lock): """ :param lock: :type lock: thread.Lo...
(self): self._t1 = time.time() def __exit__(self, exc_type, exc_value, traceback): self._logger(time.time() - self._t1) if exc_type: return False return True
__enter__
identifier_name
__init__.py
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
} if is_tokenizers_available(): _import_structure["tokenization_squeezebert_fast"] = ["SqueezeBertTokenizerFast"] if is_torch_available(): _import_structure["modeling_squeezebert"] = [ "SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST", "SqueezeBertForMaskedLM", "SqueezeBertForMultipleChoice"...
_import_structure = { "configuration_squeezebert": ["SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "SqueezeBertConfig"], "tokenization_squeezebert": ["SqueezeBertTokenizer"],
random_line_split
__init__.py
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
else: import sys sys.modules[__name__] = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
from .modeling_squeezebert import ( SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST, SqueezeBertForMaskedLM, SqueezeBertForMultipleChoice, SqueezeBertForQuestionAnswering, SqueezeBertForSequenceClassification, SqueezeBertForTokenClassification, ...
conditional_block
renderer.js
/** * This file is required by the index.html file * and will be executed in the renderer process * for that window. * * All of the Node.js APIs are available in this * process. * * @author André Barata */ require('angular'); global.CodeMirror = require('codemirror/lib/codemirror'); const Highland = require('highla...
require('./highlightedBlock/highlightedBlock.js'); require('./historyService/historyService.js'); require('./inputHighlight/inputHighlight.dir.js'); require('./streamDisplay/streamDisplay.dir.js'); require('./mainComponent/mainComponent.js'); global.scrollDown = () => { window.scrollTo(0, document.body.scrollHeight);...
require('./assets/languages/eelscript'); require('./app.js'); require('./localRef/localRef.js'); require('./pathLink/pathLink.js'); require('./commandService/commandService.js');
random_line_split
Stage.js
Stage.prototype = Object.create(MovieClip.prototype); function
(canvas_id, args) { // private vars args = args || {}; args._name = 'stage'; var self = this, _frameRate = args.frameRate || 0, _interval = null, _canvas = document.getElementById(canvas_id), _context = _canvas.getContext('2d'), _displayState = args.d...
Stage
identifier_name
Stage.js
Stage.prototype = Object.create(MovieClip.prototype); function Stage(canvas_id, args) { // private vars args = args || {}; args._name = 'stage'; var self = this, _frameRate = args.frameRate || 0, _interval = null, _canvas = document.getElementById(canvas_id), ...
} else if (_displayState == 'dynamic') { // experimental self._width = _canvas.offsetWidth; self._height = _canvas.offsetHeight; self._x = 0; self._y = 0; self._scaleX = 1; self._scaleY = 1; } }; // public functions this.onResize = null; this.onBlur = null; this.onFocus ...
{ self._scaleY = self._scaleX; self._y = (_canvas.height - self._height*self._scaleY)/2; }
conditional_block
Stage.js
Stage.prototype = Object.create(MovieClip.prototype); function Stage(canvas_id, args)
set: function(fps) { if (fps !== _frameRate) { _frameRate = fps; } } }); Object.defineProperty(this, 'displayState', { get: function() { return _displayState; }, set: function(displayState) { _displayState = displayState; _updateDisplay(); } }); _resize = function() { // updating d...
{ // private vars args = args || {}; args._name = 'stage'; var self = this, _frameRate = args.frameRate || 0, _interval = null, _canvas = document.getElementById(canvas_id), _context = _canvas.getContext('2d'), _displayState = args.displayState || 'dy...
identifier_body
Stage.js
Stage.prototype = Object.create(MovieClip.prototype); function Stage(canvas_id, args) { // private vars args = args || {}; args._name = 'stage'; var self = this, _frameRate = args.frameRate || 0, _interval = null, _canvas = document.getElementById(canvas_id), ...
} }; this.isPlaying = function() { return _interval !== null; }; this.stop = function() { if (self.isPlaying()) { window.cancelAnimationFrame(_interval); //clearInterval(_interval); _interval = null; // render new graphics self.tickGraphics(_context, Mouse.event); } }; // in...
this.play = function() { if (!self.isPlaying()) { _interval = window.requestAnimationFrame(_render);
random_line_split
tempus_winter.js
black = '#202427'; red = '#EB6A58'; // red green = '#49A61D'; // green yellow = '#959721'; // yellow blue = '#798FB7'; // blue magenta = '#CD7B7E'; // pink cyan = '#4FA090'; // cyan white = '#909294'; // light gray lightBlack = '#292B35'; // medium gray
lightMagenta= '#C874C2'; // pink lightCyan = '#1BA2A0'; // cyan lightWhite = '#8DA3B8'; // white t.prefs_.set('color-palette-overrides', [ black , red , green , yellow, blue , magenta , cyan , white, lightBlack , lightRed , lightGreen , lightYellow,...
lightRed = '#DB7824'; // red lightGreen = '#09A854'; // green lightYellow = '#AD8E4B'; // yellow lightBlue = '#309DC1'; // blue
random_line_split
issue-9906.rs
// Copyright 2013 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-MIT or ...
(){ 1+1; } }
foo
identifier_name
issue-9906.rs
// Copyright 2013 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
// except according to those terms. // xfail-fast windows doesn't like extern mod // aux-build:issue-9906.rs pub use other::FooBar; pub use other::foo; mod other { pub struct FooBar{value: int} impl FooBar{ pub fn new(val: int) -> FooBar { FooBar{value: val} } } pub fn fo...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
random_line_split
sub_base.py
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
def bool_from_env(key, strict=False, default=False): value = os.environ.get(key) return strutils.bool_from_string(value, strict=strict, default=default) class SubBaseTestCase(testtools.TestCase): def setUp(self): super(SubBaseTestCase, self).setUp() # Configure this first to ensure pm de...
random_line_split
sub_base.py
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
self.assertIn(k, actual_superset) self.assertEqual(v, actual_superset[k], "Key %(key)s expected: %(exp)r, actual %(act)r" % {'key': k, 'exp': v, 'act': actual_superset[k]})
conditional_block
sub_base.py
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
def assertOrderedEqual(self, expected, actual): expect_val = self.sort_dict_lists(expected) actual_val = self.sort_dict_lists(actual) self.assertEqual(expect_val, actual_val) def sort_dict_lists(self, dic): for key, value in dic.iteritems(): if isinstance(value, li...
with eventlet.timeout.Timeout(max_execution_time, False): yield return self.fail('Execution of this test timed out')
identifier_body
sub_base.py
# Copyright 2014 OpenStack Foundation # All Rights Reserved. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
(testtools.TestCase): def setUp(self): super(SubBaseTestCase, self).setUp() # Configure this first to ensure pm debugging support for setUp() debugger = os.environ.get('OS_POST_MORTEM_DEBUGGER') if debugger: self.addOnException(post_mortem_debug.get_exception_handler( ...
SubBaseTestCase
identifier_name
ve.ui.LinkInspector.js
/*! * VisualEditor UserInterface LinkInspector class. * * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Link inspector. * * @class * @extends ve.ui.AnnotationInspector * * @constructor * @param {ve.ui.WindowSet} windowSet Windo...
this.targetInput.$input.select(); this.surface.enable(); }; /* Registration */ ve.ui.inspectorFactory.register( ve.ui.LinkInspector );
{ // If an initial annotation couldn't be created (e.g. the text was invalid), // just populate the text we tried to create the annotation from this.targetInput.setValue( this.initialText ); }
conditional_block
ve.ui.LinkInspector.js
/*! * VisualEditor UserInterface LinkInspector class. * * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Link inspector. * * @class * @extends ve.ui.AnnotationInspector * * @constructor * @param {ve.ui.WindowSet} windowSet Windo...
this.targetInput.setAnnotation( this.initialAnnotation ); } else { // If an initial annotation couldn't be created (e.g. the text was invalid), // just populate the text we tried to create the annotation from this.targetInput.setValue( this.initialText ); } this.targetInput.$input.select(); this.surface.ena...
// Note: Focus input prior to setting target annotation this.targetInput.$input.focus(); // Setup annotation if ( this.initialAnnotation ) {
random_line_split
shaha.py
import os import dj_database_url from .base_settings import * ALLOWED_HOSTS = ['shaha-halaqat.herokuapp.com', '0.0.0.0'] db_from_env = dj_database_url.config(conn_max_age=500) DATABASES['default'].update(db_from_env) PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) STATI...
LANGUAGE_CODE = 'ar' LOCALE_PATHS = ( os.path.join(PROJECT_ROOT, 'locale'), )
}, }, ]
random_line_split
trusts.py
# Copyright (c) 2013 Mirantis Inc. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
(cluster): client = keystone.client() ctx = context.current() trustee_id = keystone.client_for_admin().user_id trust = client.trusts.create(trustor_user=client.user_id, trustee_user=trustee_id, impersonation=True, ...
create_trust
identifier_name
trusts.py
# Copyright (c) 2013 Mirantis Inc. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
from sahara import conductor as c from sahara import context from sahara.utils.openstack import keystone conductor = c.API CONF = cfg.CONF def create_trust(cluster): client = keystone.client() ctx = context.current() trustee_id = keystone.client_for_admin().user_id trust = client.trusts.create(tr...
random_line_split
trusts.py
# Copyright (c) 2013 Mirantis Inc. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
def delete_trust(cluster): if cluster.trust_id: keystone_client = keystone.client_for_trusts(cluster.trust_id) keystone_client.trusts.delete(cluster.trust_id)
if cluster.trust_id: ctx = context.current() ctx.username = CONF.keystone_authtoken.admin_user ctx.tenant_id = cluster.tenant_id client = keystone.client_for_trusts(cluster.trust_id) ctx.token = client.auth_token ctx.service_catalog = json.dumps( client.servic...
identifier_body
trusts.py
# Copyright (c) 2013 Mirantis Inc. # # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
keystone_client = keystone.client_for_trusts(cluster.trust_id) keystone_client.trusts.delete(cluster.trust_id)
conditional_block
fonctions.py
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
"""Convertit une chaîne en sa liste de caractères""" return list(chaine) def liste_vers_chaine(liste): """Convertit une lsite de caractères en une chaîne""" return "".join(liste) def lstrip(liste): """Retire les espaces à gauche de la chaîne-liste""" while liste and liste[0] == " ": de...
random_line_split
fonctions.py
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
ef liste_vers_chaine(liste): """Convertit une lsite de caractères en une chaîne""" return "".join(liste) def lstrip(liste): """Retire les espaces à gauche de la chaîne-liste""" while liste and liste[0] == " ": del liste[0] return liste
""Convertit une chaîne en sa liste de caractères""" return list(chaine) d
identifier_body
fonctions.py
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
ste): """Convertit une lsite de caractères en une chaîne""" return "".join(liste) def lstrip(liste): """Retire les espaces à gauche de la chaîne-liste""" while liste and liste[0] == " ": del liste[0] return liste
te_vers_chaine(li
identifier_name
fonctions.py
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # l...
return liste
te[0]
conditional_block
index.tmpl.py
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1440369075.543512 _enable_loop = True _template_filename = u'themes/monospace/templates/index.tmpl' _template_uri = u'index.tmpl' _source_...
(context): ns = runtime.TemplateNamespace(u'comments', context._clean_inheritance_tokens(), templateuri=u'comments_helper.tmpl', callables=None, calling_uri=_template_uri) context.namespaces[(__name__, u'comments')] = ns ns = runtime.TemplateNamespace(u'helper', context._clean_inheritance_tokens(), templa...
_mako_generate_namespaces
identifier_name
index.tmpl.py
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1440369075.543512 _enable_loop = True _template_filename = u'themes/monospace/templates/index.tmpl' _template_uri = u'index.tmpl' _source_...
__M_writer(u'\n') return '' finally: context.caller_stack._pop_frame() def render_content(context,**pageargs): __M_caller = context.caller_stack._push_frame() try: date_format = context.get('date_format', UNDEFINED) helper = _mako_get_namespace(context, 'helper') ...
__M_caller = context.caller_stack._push_frame() try: __M_locals = __M_dict_builtin(pageargs=pageargs) date_format = context.get('date_format', UNDEFINED) helper = _mako_get_namespace(context, 'helper') messages = context.get('messages', UNDEFINED) posts = context.get('posts',...
identifier_body
index.tmpl.py
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1440369075.543512 _enable_loop = True _template_filename = u'themes/monospace/templates/index.tmpl' _template_uri = u'index.tmpl' _source_...
__M_writer(u' </span>\n </div>\n ') __M_writer(unicode(post.text(teaser_only=index_teasers))) __M_writer(u'\n') if not post.meta('nocomments'): __M_writer(u' ') __M_writer(unicode(comments.commen...
__M_writer(u' <a class="tag" href="') __M_writer(unicode(_link('tag', tag))) __M_writer(u'"><span>') __M_writer(unicode(tag)) __M_writer(u'</span></a>\n')
conditional_block
index.tmpl.py
# -*- coding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 10 _modified_time = 1440369075.543512 _enable_loop = True _template_filename = u'themes/monospace/templates/index.tmpl' _template_uri = u'index.tmpl' _source_...
def render_body(context,**pageargs): __M_caller = context.caller_stack._push_frame() try: __M_locals = __M_dict_builtin(pageargs=pageargs) date_format = context.get('date_format', UNDEFINED) helper = _mako_get_namespace(context, 'helper') messages = context.get('messages', UNDEFI...
context.namespaces[(__name__, u'helper')] = ns def _mako_inherit(template, context): _mako_generate_namespaces(context) return runtime._inherit_from(context, u'base.tmpl', _template_uri)
random_line_split
result.rs
use std::error::Error; use std::fmt; use std::fmt::Display; use std::ptr; use env::NapiEnv; use sys::{napi_create_error, napi_create_range_error, napi_create_type_error, napi_status, napi_value}; use value::{NapiString, NapiValue}; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum
{ InvalidArg, ObjectExpected, StringExpected, NameExpected, FunctionExpected, NumberExpected, BooleanExpected, ArrayExpected, GenericFailure, PendingException, Cancelled, EscapeCalledTwice, ApplicationError, } #[derive(Clone, Debug)] pub struct NapiError { pub k...
NapiErrorKind
identifier_name