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
android_calls.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # 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 L...
# limitations under the License. """Formatter for Android contacts2.db database events.""" from plaso.lib import eventdata class AndroidCallFormatter(eventdata.ConditionalEventFormatter): """Formatter for Android call history events.""" DATA_TYPE = 'android:event:call' FORMAT_STRING_PIECES = [ u'{call_...
random_line_split
android_calls.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # 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 L...
(eventdata.ConditionalEventFormatter): """Formatter for Android call history events.""" DATA_TYPE = 'android:event:call' FORMAT_STRING_PIECES = [ u'{call_type}', u'Number: {number}', u'Name: {name}', u'Duration: {duration} seconds'] FORMAT_STRING_SHORT_PIECES = [u'{call_type} Call'] ...
AndroidCallFormatter
identifier_name
atmega16hvb.js
module.exports = { "name": "ATmega16HVB", "timeout": 200, "stabDelay": 100, "cmdexeDelay": 25, "syncLoops": 32, "byteDelay": 0, "pollIndex": 3, "pollValue": 83, "preDelay": 1, "postDelay": 1, "pgmEnable": [172, 83, 0, 0], "erase": { "cmd": [172, 128, 0, 0], "delay": 45, "pollMethod":...
"write": [193, 194, 0], "read": [160, 0, 0], "mode": 65, "blockSize": 4, "delay": 10, "poll2": 0, "poll1": 0, "size": 512, "pageSize": 4, "pages": 128, "addressOffset": 0 }, "sig": [30, 148, 13], "signature": { "size": 3, "startAddress": 0, "read": [48, 0, 0...
"pages": 128, "addressOffset": null }, "eeprom": {
random_line_split
text_expression_methods.rs
use crate::dsl; use crate::expression::grouped::Grouped; use crate::expression::operators::{Concat, Like, NotLike}; use crate::expression::{AsExpression, Expression}; use crate::sql_types::{Nullable, SqlType, Text}; /// Methods present on text expressions pub trait TextExpressionMethods: Expression + Sized { /// C...
/// Returns a SQL `NOT LIKE` expression /// /// This method is case insensitive for SQLite and MySQL. /// On PostgreSQL `NOT LIKE` is case sensitive. You may use /// [`not_ilike()`](../expression_methods/trait.PgTextExpressionMethods.html#method.not_ilike) /// for case insensitive comparison o...
{ Grouped(Like::new(self, other.as_expression())) }
identifier_body
text_expression_methods.rs
use crate::dsl; use crate::expression::grouped::Grouped; use crate::expression::operators::{Concat, Like, NotLike}; use crate::expression::{AsExpression, Expression}; use crate::sql_types::{Nullable, SqlType, Text}; /// Methods present on text expressions pub trait TextExpressionMethods: Expression + Sized { /// C...
/// # /// # insert_into(users) /// # .values(&vec![ /// # (id.eq(1), name.eq("Sean"), hair_color.eq(Some("Green"))), /// # (id.eq(2), name.eq("Tess"), hair_color.eq(None)), /// # ]) /// # .execute(&connection) /// # .unwrap(); ...
/// # )").unwrap();
random_line_split
text_expression_methods.rs
use crate::dsl; use crate::expression::grouped::Grouped; use crate::expression::operators::{Concat, Like, NotLike}; use crate::expression::{AsExpression, Expression}; use crate::sql_types::{Nullable, SqlType, Text}; /// Methods present on text expressions pub trait TextExpressionMethods: Expression + Sized { /// C...
<T>(self, other: T) -> dsl::Like<Self, T> where Self::SqlType: SqlType, T: AsExpression<Self::SqlType>, { Grouped(Like::new(self, other.as_expression())) } /// Returns a SQL `NOT LIKE` expression /// /// This method is case insensitive for SQLite and MySQL. /// On Po...
like
identifier_name
response.rs
: HyperResponse<'a, T>, templates: &'a TemplateCache } impl<'a> Response<'a, Fresh> { pub fn from_internal<'c, 'd>(response: HyperResponse<'c, Fresh>, templates: &'c TemplateCache) -> Response<'c, Fresh> { Response { origin: r...
File::open(path).map_err(|e| format!("Failed to send file '{:?}': {}", path, e)) }); let mut stream = try!(self.start()); match copy(&mut file, &mut stream) { Ok(_) => Ok(Halt(stream)), Err(e) => stream.bail(fo...
let mut file = try_with!(self, {
random_line_split
response.rs
<'a, T: 'static + Any = Fresh> { ///the original `hyper::server::Response` origin: HyperResponse<'a, T>, templates: &'a TemplateCache } impl<'a> Response<'a, Fresh> { pub fn from_internal<'c, 'd>(response: HyperResponse<'c, Fresh>, templates: &'c TemplateCache) ...
Response
identifier_name
response.rs
HyperResponse<'a, T>, templates: &'a TemplateCache } impl<'a> Response<'a, Fresh> { pub fn from_internal<'c, 'd>(response: HyperResponse<'c, Fresh>, templates: &'c TemplateCache) -> Response<'c, Fresh> { Response { origin: re...
} impl <'a, T: 'static + Any> Response<'a, T> { /// The status of this response. pub fn status(&self)
{ self.origin.end() }
identifier_body
response.rs
HyperResponse<'a, T>, templates: &'a TemplateCache } impl<'a> Response<'a, Fresh> { pub fn from_internal<'c, 'd>(response: HyperResponse<'c, Fresh>, templates: &'c TemplateCache) -> Response<'c, Fresh> { Response { origin: re...
} /// Renders the given template bound with the given data. /// /// # Examples /// ```{rust} /// use std::collections::HashMap; /// use nickel::{Request, Response, MiddlewareResult}; /// /// # #[allow(dead_code)] /// fn handler<'a>(_: &mut Request, res: Response<'a>) -> Middlew...
{ headers.set(f()) }
conditional_block
indicadoranaliticahl7.js
(function(module){ 'use strict'; var Pojo = require('../pojo'); function indicadoranaliticahl7()
insert: '', select: '', delete: '', get: '' }, tablename: 'indicadoranaliticahl7' }; Pojo.call(this); } indicadoranaliticahl7.prototype = Object.create(Pojo.prototype); indicadoranaliticahl7.prototype.constructor = indicadoranaliticahl7; module.exports = indicadoranaliticahl7; })(module);
{ this.indicadoranaliticahl7id = ''; this.nombrehl7 = ''; this.nombre = ''; this.idindicador = ''; this.coste = ''; this.categoriahl7 = ''; this.orden = ''; this._metadata = { attrs: { 'indicadoranaliticahl7id' : {type: 'int', PK: 1}, 'nombrehl7' : {type: 'varchar'}, 'nombre' : {type: 'va...
identifier_body
indicadoranaliticahl7.js
(function(module){ 'use strict'; var Pojo = require('../pojo'); function
(){ this.indicadoranaliticahl7id = ''; this.nombrehl7 = ''; this.nombre = ''; this.idindicador = ''; this.coste = ''; this.categoriahl7 = ''; this.orden = ''; this._metadata = { attrs: { 'indicadoranaliticahl7id' : {type: 'int', PK: 1}, 'nombrehl7' : {type: 'varchar'}, 'nombre' : {type: '...
indicadoranaliticahl7
identifier_name
indicadoranaliticahl7.js
(function(module){ 'use strict'; var Pojo = require('../pojo'); function indicadoranaliticahl7(){ this.indicadoranaliticahl7id = ''; this.nombrehl7 = ''; this.nombre = ''; this.idindicador = '';
attrs: { 'indicadoranaliticahl7id' : {type: 'int', PK: 1}, 'nombrehl7' : {type: 'varchar'}, 'nombre' : {type: 'varchar'}, 'idindicador' : {type: 'varchar'}, 'coste' : {type: 'float'}, 'categoriahl7' : {type: 'varchar'}, 'orden' : {type: 'int', nullable: true} }, attrsid: [], sqls...
this.coste = ''; this.categoriahl7 = ''; this.orden = ''; this._metadata = {
random_line_split
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring import os import codecs from setuptools import setup def read(fname):
setup( name='pytest-typehints', version='0.1.0', author='Edward Dunn Ekelund', author_email='edward.ekelund@gmail.com', maintainer='Edward Dunn Ekelund', maintainer_email='edward.ekelund@gmail.com', license='BSD-3', url='https://github.com/eddie-dunn/pytest-typehints', description...
file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read()
identifier_body
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring import os import codecs from setuptools import setup def
(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='pytest-typehints', version='0.1.0', author='Edward Dunn Ekelund', author_email='edward.ekelund@gmail.com', maintainer='Edward Dunn Ekelund', maintaine...
read
identifier_name
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=missing-docstring import os import codecs from setuptools import setup def read(fname): file_path = os.path.join(os.path.dirname(__file__), fname) return codecs.open(file_path, encoding='utf-8').read() setup( name='pytest-typehints', v...
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Operating System :: OS Independent', 'License :: OSI Approved :: BSD License', ], entry_points={ 'p...
random_line_split
strings.js
define({ "_widgetLabel": "Tra cứu Địa lý", "description": "Duyệt đến hoặc Kéo <a href='./widgets/GeoLookup/data/sample.csv' tooltip='Download an example sheet' target='_blank'> trang tính </a> tại đây để mô phỏng và thêm các dữ liệu bản đồ vào trang tính đó.", "selectCSV": "Chọn một CSV", "loadingCSV": "Đang tả...
"CSVNoRecords": "Tệp không chứa bất kỳ hồ sơ nào.", "CSVEmptyFile": "Không có nội dung trong tệp." }, "results": { "csvLoaded": "Đã tải ${0} bản ghi từ tệp CSV", "recordsPlotted": "Đã định vị ${0}/${1} bản ghi trên bản đồ", "recordsEnriched": "Đã xử lý ${0}/${1}, đã bổ sung ${2} so với ${3}", ...
"tooManyRecords": "Rất tiếc, hiện không được có quá ${0} bản ghi.",
random_line_split
xset.js
'use strict'; const fs = require('fs'); const Q = require('q'); const exec = require('child_process').exec; const searchpaths = ["/bin/xset"]; class XSetDriver { constructor(props) { this.name = "Backlight Control"; this.devicePath = "xset"; this.description = "Screensaver control via Xwi...
} XSetDriver.Channel = XSetChannel; module.exports = XSetDriver; /* Treadmill.prototype.init_screensaver = function(action) { this.screensaver = { // config/settings enabled: !simulate, display: ":0.0", error: 0, // internal variables lastReset: new Date(), ...
}.bind(this)); }
random_line_split
xset.js
'use strict'; const fs = require('fs'); const Q = require('q'); const exec = require('child_process').exec; const searchpaths = ["/bin/xset"]; class XSetDriver { constructor(props) { this.name = "Backlight Control"; this.devicePath = "xset"; this.description = "Screensaver control via Xwi...
{ constructor(driver, path, props) { this.value = 1; this.setCommand = path; this.enabled = true; this.display = ":0.0"; this.error = 0; // internal variables this.lastReset = new Date(); } enable() { this.set("on"); } disable()...
XSetChannel
identifier_name
xset.js
'use strict'; const fs = require('fs'); const Q = require('q'); const exec = require('child_process').exec; const searchpaths = ["/bin/xset"]; class XSetDriver { constructor(props) { this.name = "Backlight Control"; this.devicePath = "xset"; this.description = "Screensaver control via Xwi...
}.bind(this)); return this.devices.length>0; } } class XSetChannel { constructor(driver, path, props) { this.value = 1; this.setCommand = path; this.enabled = true; this.display = ":0.0"; this.error = 0; // internal variables this.l...
{ let stat = fs.lstatSync(p); if (stat.isFile()) { console.log("found xset control at "+p); this.devices.push(new XSetDriver.Channel(this, p, props)); } }
conditional_block
hid_usb_test.py
# # DAPLink Interface Firmware # Copyright (c) 2016-2017, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
def hid_main(thread_index, board_id): global should_exit count = 0 try: device = pyocd.probe.pydapaccess.DAPAccess.get_device(board_id) while not should_exit: device.open() info = device.vendor(0) info = str(bytearray(info[1:1 + info[0]])) a...
with print_mut: print(msg)
identifier_body
hid_usb_test.py
# # DAPLink Interface Firmware # Copyright (c) 2016-2017, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
while not should_exit: device.open() info = device.vendor(0) info = str(bytearray(info[1:1 + info[0]])) assert info == board_id device.close() if count % 100 == 0: sync_print("Thread %i on loop %10i at %.6f - %s - board %s" ...
try: device = pyocd.probe.pydapaccess.DAPAccess.get_device(board_id)
random_line_split
hid_usb_test.py
# # DAPLink Interface Firmware # Copyright (c) 2016-2017, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
(thread_index, board_id): global should_exit count = 0 try: device = pyocd.probe.pydapaccess.DAPAccess.get_device(board_id) while not should_exit: device.open() info = device.vendor(0) info = str(bytearray(info[1:1 + info[0]])) assert info == b...
hid_main
identifier_name
hid_usb_test.py
# # DAPLink Interface Firmware # Copyright (c) 2016-2017, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
try: with exit_cond: while not should_exit: exit_cond.wait(1) except KeyboardInterrupt: pass should_exit = True sync_print("Exiting") if __name__ == "__main__": main()
msd_thread = threading.Thread(target=hid_main, args=(thread_index, mbed['target_id'])) msd_thread.start()
conditional_block
index.ts
import formatDistance from '../en-US/_lib/formatDistance/index' import formatRelative from '../en-US/_lib/formatRelative/index' import localize from '../en-US/_lib/localize/index' import match from '../en-US/_lib/match/index' import type { Locale } from '../types' import formatLong from './_lib/formatLong/index' /** ...
} export default locale
weekStartsOn: 1 /* Monday */, firstWeekContainsDate: 4, },
random_line_split
typeclasses-eq-example-static.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 ...
{ leaf(Color), branch(@ColorTree, @ColorTree) } impl Equal for ColorTree { fn isEq(a: ColorTree, b: ColorTree) -> bool { match (a, b) { (leaf(x), leaf(y)) => { Equal::isEq(x, y) } (branch(l1, r1), branch(l2, r2)) => { Equal::isEq(*l1, *l2) && Equal::isEq(*r1, *r2) ...
ColorTree
identifier_name
typeclasses-eq-example-static.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 ...
branch(@ColorTree, @ColorTree) } impl Equal for ColorTree { fn isEq(a: ColorTree, b: ColorTree) -> bool { match (a, b) { (leaf(x), leaf(y)) => { Equal::isEq(x, y) } (branch(l1, r1), branch(l2, r2)) => { Equal::isEq(*l1, *l2) && Equal::isEq(*r1, *r2) } ...
enum ColorTree { leaf(Color),
random_line_split
typeclasses-eq-example-static.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 ...
(yellow, yellow) => { true } (black, black) => { true } _ => { false } } } } enum ColorTree { leaf(Color), branch(@ColorTree, @ColorTree) } impl Equal for ColorTree { fn isEq(a: ColorTree, b: ColorTree) -> bool { match (a, b) { ...
{ true }
conditional_block
home.component.ts
import { Component } from '@angular/core'; import {ROUTER_DIRECTIVES} from "@angular/router" import { AppState } from '../app.service'; @Component({ // The selector is what angular internally uses // for `document.querySelectorAll(selector)` in our index.html // where, in this case, selector is the string 'ho...
}
random_line_split
home.component.ts
import { Component } from '@angular/core'; import {ROUTER_DIRECTIVES} from "@angular/router" import { AppState } from '../app.service'; @Component({ // The selector is what angular internally uses // for `document.querySelectorAll(selector)` in our index.html // where, in this case, selector is the string 'ho...
() { } }
ngOnInit
identifier_name
backend.rs
use crate::codec::{FramedIo, Message, ZmqFramedRead, ZmqFramedWrite}; use crate::fair_queue::QueueInner; use crate::util::PeerIdentity; use crate::{ MultiPeerBackend, SocketBackend, SocketEvent, SocketOptions, SocketType, ZmqError, ZmqResult, }; use async_trait::async_trait; use crossbeam::queue::SegQueue; use dash...
self.peer_disconnected(&next_peer_id); Err(e.into()) } }; } } } impl SocketBackend for GenericSocketBackend { fn socket_type(&self) -> SocketType { self.socket_type } fn socket_options(&self) -> &SocketOptions { ...
} Err(e) => {
random_line_split
backend.rs
use crate::codec::{FramedIo, Message, ZmqFramedRead, ZmqFramedWrite}; use crate::fair_queue::QueueInner; use crate::util::PeerIdentity; use crate::{ MultiPeerBackend, SocketBackend, SocketEvent, SocketOptions, SocketType, ZmqError, ZmqResult, }; use async_trait::async_trait; use crossbeam::queue::SegQueue; use dash...
(&self, peer_id: &PeerIdentity) { self.peers.remove(peer_id); match &self.fair_queue_inner { None => {} Some(inner) => { inner.lock().remove(peer_id); } }; } }
peer_disconnected
identifier_name
backend.rs
use crate::codec::{FramedIo, Message, ZmqFramedRead, ZmqFramedWrite}; use crate::fair_queue::QueueInner; use crate::util::PeerIdentity; use crate::{ MultiPeerBackend, SocketBackend, SocketEvent, SocketOptions, SocketType, ZmqError, ZmqResult, }; use async_trait::async_trait; use crossbeam::queue::SegQueue; use dash...
} #[async_trait] impl MultiPeerBackend for GenericSocketBackend { async fn peer_connected(self: Arc<Self>, peer_id: &PeerIdentity, io: FramedIo) { let (recv_queue, send_queue) = io.into_parts(); self.peers.insert(peer_id.clone(), Peer { send_queue }); self.round_robin.push(peer_id.clone())...
{ &self.socket_monitor }
identifier_body
semester.component.ts
import { Component, OnInit } from '@angular/core' import { URLSearchParams } from '@angular/http' import { MdDialog } from '@angular/material' import { DataService } from '../_core/data' import { AuthenticationService } from '../_core/security' import { SemesterDialog } from './dialogs/semester.dialog' import { Course...
() { var dialogRef = this.dialog.open(SemesterDialog) dialogRef.afterClosed() .subscribe(result => { if (result) { this.semester = result } }) } openCourseDialog() { var dialogRef = this.dialog.open(CourseDialog) dialogRef.componentInstance.semesterId = this.se...
openSemesterDialog
identifier_name
semester.component.ts
import { Component, OnInit } from '@angular/core' import { URLSearchParams } from '@angular/http' import { MdDialog } from '@angular/material' import { DataService } from '../_core/data' import { AuthenticationService } from '../_core/security' import { SemesterDialog } from './dialogs/semester.dialog' import { Course...
}) } openCourseDialog() { var dialogRef = this.dialog.open(CourseDialog) dialogRef.componentInstance.semesterId = this.semester._id dialogRef.afterClosed() .subscribe(result => { if (result) { this.semester.courses.push(result) } }) } }
{ this.semester = result }
conditional_block
semester.component.ts
import { Component, OnInit } from '@angular/core' import { URLSearchParams } from '@angular/http' import { MdDialog } from '@angular/material' import { DataService } from '../_core/data' import { AuthenticationService } from '../_core/security' import { SemesterDialog } from './dialogs/semester.dialog' import { Course...
}
{ var dialogRef = this.dialog.open(CourseDialog) dialogRef.componentInstance.semesterId = this.semester._id dialogRef.afterClosed() .subscribe(result => { if (result) { this.semester.courses.push(result) } }) }
identifier_body
semester.component.ts
import { Component, OnInit } from '@angular/core' import { URLSearchParams } from '@angular/http' import { MdDialog } from '@angular/material' import { DataService } from '../_core/data' import { AuthenticationService } from '../_core/security' import { SemesterDialog } from './dialogs/semester.dialog' import { Course...
}) } }
}
random_line_split
color.js
': [176,224,230,1], 'purple': [128,0,128,1], 'red': [255,0,0,1], 'rosybrown': [188,143,143,1], 'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1], 'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1], 'seagreen': [46,139,87,1], 'seashell': [255,245,238,1], 'sienna': [16...
rgba2hsla
identifier_name
color.js
[216,191,216,1], 'tomato': [255,99,71,1], 'turquoise': [64,224,208,1], 'violet': [238,130,238,1], 'wheat': [245,222,179,1], 'white': [255,255,255,1], 'whitesmoke': [245,245,245,1], 'yellow': [255,255,0,1], 'yellowgreen': [154,205,50,1] }; function clampCssByte(i) { // Clamp to...
if (H < 0) { H += 1;
random_line_split
color.js
[255,192,203,1], 'plum': [221,160,221,1], 'powderblue': [176,224,230,1], 'purple': [128,0,128,1], 'red': [255,0,0,1], 'rosybrown': [188,143,143,1], 'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1], 'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1], 'seagreen': [46...
{ rgba[3] = hsla[3]; }
conditional_block
color.js
78,170,1], 'lightskyblue': [135,206,250,1], 'lightslategray': [119,136,153,1], 'lightslategrey': [119,136,153,1], 'lightsteelblue': [176,196,222,1], 'lightyellow': [255,255,224,1], 'lime': [0,255,0,1], 'limegreen': [50,205,50,1], 'linen': [250,240,230,1], 'magenta': [255,0,255,1]...
{ if (!colorStr) { return; } // colorStr may be not string colorStr = colorStr + ''; // Remove all whitespace, not compliant, but should just be more accepting. var str = colorStr.replace(/ /g, '').toLowerCase(); // Color keywords (and transparent) lo...
identifier_body
builder.rs
// Copyright 2013-2015, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> #![cfg_attr(not(feature = "v3_10"), allow(unused_imports))] use libc::{c_char, ssize_t}; us...
} } pub fn add_from_string(&self, string: &str) -> Result<(), Error> { unsafe { let mut error = ::std::ptr::null_mut(); ffi::gtk_builder_add_from_string(self.to_glib_none().0, string.as_ptr() as *const c_char, ...
{ Err(from_glib_full(error)) }
conditional_block
builder.rs
// Copyright 2013-2015, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> #![cfg_attr(not(feature = "v3_10"), allow(unused_imports))] use libc::{c_char, ssize_t}; us...
#[cfg(feature = "v3_10")] pub fn new_from_file<T: AsRef<Path>>(file_path: T) -> Builder { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_builder_new_from_file(file_path.as_ref().to_glib_none().0)) } } #[cfg(feature = "v3_10")] pub fn new_from_resource(resource...
{ assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_builder_new()) } }
identifier_body
builder.rs
// Copyright 2013-2015, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> #![cfg_attr(not(feature = "v3_10"), allow(unused_imports))] use libc::{c_char, ssize_t}; us...
<T: IsA<Object>>(&self, name: &str) -> Option<T> { unsafe { Option::<Object>::from_glib_none( ffi::gtk_builder_get_object(self.to_glib_none().0, name.to_glib_none().0)) .and_then(|obj| obj.downcast().ok()) } } pub fn add_from_file<T: AsRef<Path>>(&sel...
get_object
identifier_name
builder.rs
// Copyright 2013-2015, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> #![cfg_attr(not(feature = "v3_10"), allow(unused_imports))] use libc::{c_char, ssize_t}; us...
from_glib_full( ffi::gtk_builder_new_from_string(string.as_ptr() as *const c_char, string.len() as ssize_t)) } } pub fn get_object<T: IsA<Object>>(&self, name: &str) -> Option<T> { unsafe { Option::<Object>::from_glib_none( ...
#[cfg(feature = "v3_10")] pub fn new_from_string(string: &str) -> Builder { assert_initialized_main_thread!(); unsafe { // Don't need a null-terminated string here
random_line_split
test_image.py
def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default): state['settings']['images_data_storage'] = 'REFERENCE' gltf_image_default['uri'] = '../filepath.png' output = exporters.ImageExporter.export(state, bpy_image_default) assert output == gltf_image_default def test_...
bpy_image_default.type = 'NOT_IMAGE' assert exporters.ImageExporter.check(state, bpy_image_default) is not True
identifier_body
test_image.py
def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default): state['settings']['images_data_storage'] = 'REFERENCE' gltf_image_default['uri'] = '../filepath.png' output = exporters.ImageExporter.export(state, bpy_image_default) assert output == gltf_image_default def test_...
assert output == gltf_image_default def test_image_to_data_uri(exporters, bpy_image_default): image_data = ( b'\x89PNG\r\n\x1a\n\x00\x00\x00\r' b'IHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x06\x00\x00\x00\x1f\x15\xc4\x89\x00\x00\x00\x08' b'IDATx\xda\x03\x00\x00\x00\x00\x01o\xdd\xc9\x91...
ref.source[ref.prop] = ref.blender_name
conditional_block
test_image.py
def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default): state['settings']['images_data_storage'] = 'REFERENCE' gltf_image_default['uri'] = '../filepath.png' output = exporters.ImageExporter.export(state, bpy_image_default) assert output == gltf_image_default def test_...
assert exporters.ImageExporter.check(state, bpy_image_default) is not True def test_image_check_0_y(exporters, state, bpy_image_default): bpy_image_default.size = [1, 0] assert exporters.ImageExporter.check(state, bpy_image_default) is not True def test_image_check_type(exporters, state, bpy_image_defau...
def test_image_check_0_x(exporters, state, bpy_image_default): bpy_image_default.size = [0, 1]
random_line_split
test_image.py
def test_image_export_reference(exporters, state, bpy_image_default, gltf_image_default): state['settings']['images_data_storage'] = 'REFERENCE' gltf_image_default['uri'] = '../filepath.png' output = exporters.ImageExporter.export(state, bpy_image_default) assert output == gltf_image_default def
(exporters, state, bpy_image_default, gltf_image_default): state['settings']['images_data_storage'] = 'EMBED' gltf_image_default['uri'] = ( 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACElEQVR42gMAAAAAAW' '/dyZEAAAAASUVORK5CYII=' ) gltf_image_default['mimeType']...
test_image_export_embed
identifier_name
hello.rs
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it wi...
println!("Domain info:"); println!(" State: {}", dinfo.state); println!(" Max Memory: {}", dinfo.max_mem); println!(" Memory: {}", dinfo.memory); println!(" CPUs: {}", dinfo.nr_virt_cpu); ...
{ let flags = virt::connect::VIR_CONNECT_LIST_DOMAINS_ACTIVE | virt::connect::VIR_CONNECT_LIST_DOMAINS_INACTIVE; if let Ok(num_active_domains) = conn.num_of_domains() { if let Ok(num_inactive_domains) = conn.num_of_defined_domains() { println!("There are {} active and {} ina...
identifier_body
hello.rs
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it wi...
(conn: &Connect) -> Result<(), Error> { let flags = virt::connect::VIR_CONNECT_LIST_DOMAINS_ACTIVE | virt::connect::VIR_CONNECT_LIST_DOMAINS_INACTIVE; if let Ok(num_active_domains) = conn.num_of_domains() { if let Ok(num_inactive_domains) = conn.num_of_defined_domains() { pr...
show_domains
identifier_name
hello.rs
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it wi...
return Ok(()); } } Err(Error::new()) } fn main() { let uri = match env::args().nth(1) { Some(u) => u, None => String::from(""), }; println!("Attempting to connect to hypervisor: '{}'", uri); let conn = match Connect::open(&uri) { Ok(c) => c, ...
} } }
random_line_split
hello.rs
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it wi...
if let Err(e) = show_domains(&conn) { disconnect(conn); panic!("Failed to show domains info: code {}, message: {}", e.code, e.message); } fn disconnect(mut conn: Connect) { if let Err(e) = conn.close() { panic!("Failed to disconnect from h...
{ disconnect(conn); panic!("Failed to show hypervisor info: code {}, message: {}", e.code, e.message); }
conditional_block
invalid__missing-present.js
/*
* the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See t...
* Copyright (C) 2015 Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under
random_line_split
client.py
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
desired_class=gdata.blogger.data.BlogPageFeed, query=None, **kwargs): return self.get_feed(BLOG_PAGE_URL % blog_id, auth_token=auth_token, desired_class=desired_class, query=query, **kwargs) GetPages = get_pages def get_post_comments(self, blog_id, post...
api_version = '2' auth_service = 'blogger' auth_scopes = gdata.gauth.AUTH_SCOPES['blogger'] def get_blogs(self, user_id='default', auth_token=None, desired_class=gdata.blogger.data.BlogFeed, **kwargs): return self.get_feed(BLOGS_URL % user_id, auth_token=auth_token, d...
identifier_body
client.py
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
import gdata.blogger.data import atom.data import atom.http_core # List user's blogs, takes a user ID, or 'default'. BLOGS_URL = 'http://www.blogger.com/feeds/%s/blogs' # Takes a blog ID. BLOG_POST_URL = 'http://www.blogger.com/feeds/%s/posts/default' # Takes a blog ID. BLOG_PAGE_URL = 'http://www.blogger.com/feeds/%...
random_line_split
client.py
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
if draft: new_entry.control = atom.data.Control(draft=atom.data.Draft(text='yes')) return self.post(new_entry, BLOG_POST_URL % blog_id, auth_token=auth_token, **kwargs) AddPost = add_post def add_page(self, blog_id, title, body, draft=False, auth_token=None, title_type='text', body_t...
new_entry.add_label(label)
conditional_block
client.py
#!/usr/bin/env python # # Copyright (C) 2009 Google 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 ...
(self, blog_id, auth_token=None, **kwargs): return self.get_feed(BLOG_ARCHIVE_URL % blog_id, auth_token=auth_token, **kwargs) GetBlogArchive = get_blog_archive def add_post(self, blog_id, title, body, labels=None, draft=False, auth_token=None, title_type='text', body_ty...
get_blog_archive
identifier_name
Tiled.js
m < length; m++) { _id = self.tilesetsIndexed[m] ? m : _id; self.tilesetsIndexed[m] = self.tilesetsIndexed[_id]; } if (typeof exports == "undefined") { self._draw(); } else { if (self._ready) self._ready.call(self, clone_data); } } if (typeof url === 'string') { (Ca...
{ var _layers = []; for (var i=0 ; i < self.layers.length ; i++) { if (self.layers[i].data) _layers.push(tileset.tileproperties[self.layers[i].data[tile]]); } return _layers; }
identifier_body
Tiled.js
"); } }); Client : canvas.Scene.New({ name: "Scene_Map", events: ["load"], materials: { images: { tileset: "my_tileset.png" } }, load: function(data) { var tiled = canvas.Tiled.New(); tiled.ready(function() { var tile_w = this.getTileWidth(), tile_h = this.getTileHei...
(data) { var clone_data = CE.Core.extend({}, data); self.tile_h = data.tileheight; self.tile_w = data.tilewidth; self.width = data.width; self.height = data.height; self.tilesets = data.tilesets; self.layers = data.layers; self.tilesetsIndexed = []; for (var i=0 ; i < self.tilesets.length...
ready
identifier_name
Tiled.js
"); } }); Client : canvas.Scene.New({ name: "Scene_Map", events: ["load"], materials: { images: { tileset: "my_tileset.png" } }, load: function(data) { var tiled = canvas.Tiled.New(); tiled.ready(function() { var tile_w = this.getTileWidth(), tile_h = this.getTileHei...
} } else if (layer.type == "objectgroup") { for (var j=0 ; j < layer.objects.length ; j++) { obj = layer.objects[j]; if (!el_objs[obj.name]) el_objs[obj.name] = []; if (obj.gid) { el_objs[obj.name].push(this._drawTile(obj.gid, layer.name, CE.extend(obj, { y: obj.y - this...
{ _id = layer.data[id]; if (_id != 0) { this._drawTile(_id, layer.name, { x: j, y: k }); } id++; }
conditional_block
Tiled.js
of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, s...
Permission is hereby granted, free of charge, to any person obtaining a copy
random_line_split
tab-header.ts
moduleId: module.id, selector: 'md-tab-header, mat-tab-header', templateUrl: 'tab-header.html', styleUrls: ['tab-header.css'], inputs: ['disableRipple'], encapsulation: ViewEncapsulation.None, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, host: { 'class': 'mat-tab-he...
{ this._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), v)); // Mark that the scroll distance has changed so that after the view is checked, the CSS // transformation can move the header. this._scrollDistanceChanged = true; this._checkScrollingControls(); }
identifier_body
tab-header.ts
will be displayed to allow the user to scroll * left and right across the header. * @docs-private */ @Component({ moduleId: module.id, selector: 'md-tab-header, mat-tab-header', templateUrl: 'tab-header.html', styleUrls: ['tab-header.css'], inputs: ['disableRipple'], encapsulation: ViewEncapsulation.Non...
if (this._labelWrappers && this._labelWrappers.length) { this._labelWrappers.toArray()[tabIndex].focus(); // Do not let the browser manage scrolling to focus the element, this will be handled // by using translation. In LTR, the scroll left should be 0. In RTL, the scroll width // should b...
if (this._showPaginationControls) { this._scrollToLabel(tabIndex); }
random_line_split
tab-header.ts
arrows will be displayed to allow the user to scroll * left and right across the header. * @docs-private */ @Component({ moduleId: module.id, selector: 'md-tab-header, mat-tab-header', templateUrl: 'tab-header.html', styleUrls: ['tab-header.css'], inputs: ['disableRipple'], encapsulation: ViewEncapsulat...
(): void { this._moveFocus(this._getLayoutDirection() == 'ltr' ? -1 : 1); } /** The layout direction of the containing app. */ _getLayoutDirection(): Direction { return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr'; } /** Performs the CSS transformation on the tab list that will cause the l...
_focusPreviousTab
identifier_name
tab-header.ts
will be displayed to allow the user to scroll * left and right across the header. * @docs-private */ @Component({ moduleId: module.id, selector: 'md-tab-header, mat-tab-header', templateUrl: 'tab-header.html', styleUrls: ['tab-header.css'], inputs: ['disableRipple'], encapsulation: ViewEncapsulation.Non...
} } /** * Moves the focus towards the beginning or the end of the list depending on the offset provided. * Valid offsets are 1 and -1. */ _moveFocus(offset: number) { if (this._labelWrappers) { const tabs: MdTabLabelWrapper[] = this._labelWrappers.toArray(); for (let i = this.focus...
{ containerEl.scrollLeft = containerEl.scrollWidth - containerEl.offsetWidth; }
conditional_block
kay_auto.rs
//! This is all auto-generated. Do not touch. #![rustfmt::skip] #[allow(unused_imports)] use kay::{ActorSystem, TypedID, RawID, Fate, Actor, TraitIDFrom, ActorOrActorTrait}; #[allow(unused_imports)] use super::*; #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct TimeUIID { _raw_id: RawID } impl C...
pub fn register_trait(system: &mut ActorSystem) { system.register_trait::<TimeUIRepresentative>(); system.register_trait_message::<MSG_TimeUI_on_time_info>(); } pub fn register_implementor<Act: Actor + TimeUI>(system: &mut ActorSystem) { system.register_implementor::<Act, TimeUIRe...
{ world.send(self.as_raw(), MSG_TimeUI_on_time_info(current_instant, speed)); }
identifier_body
kay_auto.rs
//! This is all auto-generated. Do not touch. #![rustfmt::skip] #[allow(unused_imports)] use kay::{ActorSystem, TypedID, RawID, Fate, Actor, TraitIDFrom, ActorOrActorTrait}; #[allow(unused_imports)] use super::*; #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct TimeUIID { _raw_id: RawID } impl C...
(self, current_instant: :: units :: Instant, speed: u16, world: &mut World) { world.send(self.as_raw(), MSG_TimeUI_on_time_info(current_instant, speed)); } pub fn register_trait(system: &mut ActorSystem) { system.register_trait::<TimeUIRepresentative>(); system.register_trait_message::<...
on_time_info
identifier_name
kay_auto.rs
//! This is all auto-generated. Do not touch. #![rustfmt::skip] #[allow(unused_imports)] use kay::{ActorSystem, TypedID, RawID, Fate, Actor, TraitIDFrom, ActorOrActorTrait}; #[allow(unused_imports)] use super::*; #[derive(Serialize, Deserialize)] #[serde(transparent)] pub struct TimeUIID { _raw_id: RawID }
} } impl ::std::hash::Hash for TimeUIID { fn hash<H: ::std::hash::Hasher>(&self, state: &mut H) { self._raw_id.hash(state); } } impl PartialEq for TimeUIID { fn eq(&self, other: &TimeUIID) -> bool { self._raw_id == other._raw_id } } impl Eq for TimeUIID {} pub struct TimeUIRepresent...
impl Copy for TimeUIID {} impl Clone for TimeUIID { fn clone(&self) -> Self { *self } } impl ::std::fmt::Debug for TimeUIID { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write!(f, "TimeUIID({:?})", self._raw_id)
random_line_split
ComponentsGridItem.tsx
import React, { memo, useCallback, MouseEvent } from 'react' import { Link } from 'gatsby' import styled, { useTheme } from 'styled-components' import media from '../../../theming/mediaQueries' import { ChartNavData } from '../../../types' export const ComponentsGridItem = memo(({ name, id, flavors }: ChartNavData) =>...
<Flavor onClick={handleVariantClick} to={`/${id}/canvas/`}> Canvas </Flavor> )} {flavors.api && ( <Flavor onClick={handleVariantClick} to={`/${id}/api/`}> ...
random_line_split
bookmark.js
/* * This file is part of the Exposure package. *
$("a[data-op='bookmark-remove']").click(function(e) { e.preventDefault() ; var listItem = $(this).closest('li') ; var postData = "token=" + $(this).closest('ul').data('token') + "&project_id=" + $(this).data("project-id") + "&action=project_bookmark_remove" ; $.post("/", postData, function(result) { if...
* Copyright 2013 by Sébastien Pujadas * * For the full copyright and licence information, please view the LICENCE * file that was distributed with this source code. */
random_line_split
bookmark.js
/* * This file is part of the Exposure package. * * Copyright 2013 by Sébastien Pujadas * * For the full copyright and licence information, please view the LICENCE * file that was distributed with this source code. */ $("a[data-op='bookmark-remove']").click(function(e) { e.preventDefault() ; var listItem = $(...
}); }) ;
$('#sponsor-bookmark').text(link.data('success')) ; }
conditional_block
lexer.ts
enum TokenType { NONE, IDENTIFIER, NUMBER, BOOLEAN, STRING, SYMBOL, DELIMITER } class Token { index:number; text:string; type:TokenType; constructor(index:number, text:string, type:TokenType) { this.index = index; this.text = text; this.type = type;...
return tokens; } } /** * Lexer for Racket. */ class RacketLexer extends Lexer { public lex ():Array<[RegExp|Function,TokenType]> { return [ [ /[0-9]+/, TokenType.NUMBER ], [ /\#true|\#false|\#t|\#f/, TokenType.BOOLEAN ], // Boolean is also symbol, but so ...
{ let token:Token = this.fetch(code, index); if (token.type != TokenType.NONE) { tokens.push(token); } index += token.text.length; if (code.length <= index) { break; } }
conditional_block
lexer.ts
enum TokenType { NONE, IDENTIFIER, NUMBER, BOOLEAN, STRING, SYMBOL, DELIMITER } class Token { index:number; text:string; type:TokenType; constructor(index:number, text:string, type:TokenType) { this.index = index; this.text = text; this.type = type;...
(code:string): Array<Token> { return new RacketLexer().parse(code); } }
parse
identifier_name
lexer.ts
enum TokenType { NONE, IDENTIFIER, NUMBER, BOOLEAN, STRING, SYMBOL, DELIMITER } class Token { index:number; text:string; type:TokenType; constructor(index:number, text:string, type:TokenType) { this.index = index; this.text = text; this.type = type;...
return new RacketLexer().parse(code); } }
random_line_split
reciprocals.py
""" An integer that is not co-prime to 10 but has a prime factor other than 2 or 5 has a reciprocal that is eventually periodic, but with a non-repeating sequence of digits that precede the repeating part. The reciprocal can be expressed as: \frac{1}{2^a 5^b p^k q^\ell \cdots}\, , where a and b are not both zero...
while d % f == 0 : m += 1 d //= f if m > n : n = m return n , d > 1 def repetend ( n , d , b ) : """ Computes the length of the repetend of 1 divided by d in base b with non repeating part of size n. """ a = 1 for i in range( n ) : a *= b a %= d x = a a *= b a %= d l = 1 while ...
m = 0
random_line_split
reciprocals.py
""" An integer that is not co-prime to 10 but has a prime factor other than 2 or 5 has a reciprocal that is eventually periodic, but with a non-repeating sequence of digits that precede the repeating part. The reciprocal can be expressed as: \frac{1}{2^a 5^b p^k q^\ell \cdots}\, , where a and b are not both zero...
def repetend ( n , d , b ) : """ Computes the length of the repetend of 1 divided by d in base b with non repeating part of size n. """ a = 1 for i in range( n ) : a *= b a %= d x = a a *= b a %= d l = 1 while a != x : a *= b a %= d l += 1 return l
" Computes the length of the non repeating part in 1 / d decimals in base b. Returns tuple ( n , hasrepetend ) where n is the length of the non repeating part and hasrepetend determines if 1 / d repeats or not. """ n = 0 for f in bfactor : m = 0 while d % f == 0 : m += 1 d //= f if m > n : n ...
identifier_body
reciprocals.py
""" An integer that is not co-prime to 10 but has a prime factor other than 2 or 5 has a reciprocal that is eventually periodic, but with a non-repeating sequence of digits that precede the repeating part. The reciprocal can be expressed as: \frac{1}{2^a 5^b p^k q^\ell \cdots}\, , where a and b are not both zero...
x = a a *= b a %= d l = 1 while a != x : a *= b a %= d l += 1 return l
*= b a %= d
conditional_block
reciprocals.py
""" An integer that is not co-prime to 10 but has a prime factor other than 2 or 5 has a reciprocal that is eventually periodic, but with a non-repeating sequence of digits that precede the repeating part. The reciprocal can be expressed as: \frac{1}{2^a 5^b p^k q^\ell \cdots}\, , where a and b are not both zero...
d , bfactor ) : """ Computes the length of the non repeating part in 1 / d decimals in base b. Returns tuple ( n , hasrepetend ) where n is the length of the non repeating part and hasrepetend determines if 1 / d repeats or not. """ n = 0 for f in bfactor : m = 0 while d % f == 0 : m += 1 d /...
ansient (
identifier_name
create-image2.py
import cv2 import numpy as np import sys def reshapeImg(img, l, w, p): # reshape image to (l, w) and add/remove pixels as needed while len(img) % p != 0: img = np.append(img, 255) olds = img.size / p news = l*w if news < olds: img = img[:p*news] elif news > olds:
return img.reshape(l, w, p) if __name__ == "__main__": # Usage: python create-image2.py <height> <width> <array> # for random image do <array> = random # array format string = xyz... l = int(sys.argv[1]) w = int(sys.argv[2]) s = sys.argv[3] # create random image if no array given if s == "random": arr = ...
img = np.concatenate( (img, np.zeros(p*(news-olds))) )
conditional_block
create-image2.py
import cv2 import numpy as np import sys def reshapeImg(img, l, w, p): # reshape image to (l, w) and add/remove pixels as needed
if __name__ == "__main__": # Usage: python create-image2.py <height> <width> <array> # for random image do <array> = random # array format string = xyz... l = int(sys.argv[1]) w = int(sys.argv[2]) s = sys.argv[3] # create random image if no array given if s == "random": arr = np.random.randint(256, size=l*...
while len(img) % p != 0: img = np.append(img, 255) olds = img.size / p news = l*w if news < olds: img = img[:p*news] elif news > olds: img = np.concatenate( (img, np.zeros(p*(news-olds))) ) return img.reshape(l, w, p)
identifier_body
create-image2.py
import cv2 import numpy as np import sys def reshapeImg(img, l, w, p): # reshape image to (l, w) and add/remove pixels as needed while len(img) % p != 0: img = np.append(img, 255) olds = img.size / p news = l*w if news < olds: img = img[:p*news] elif news > olds: img = np.concatenate( (img, np.zeros(p*(ne...
cv2.imwrite("img.png", reshapeImg(arr, l, w, 3))
random_line_split
create-image2.py
import cv2 import numpy as np import sys def
(img, l, w, p): # reshape image to (l, w) and add/remove pixels as needed while len(img) % p != 0: img = np.append(img, 255) olds = img.size / p news = l*w if news < olds: img = img[:p*news] elif news > olds: img = np.concatenate( (img, np.zeros(p*(news-olds))) ) return img.reshape(l, w, p) if __name__ ...
reshapeImg
identifier_name
ng_for.ts
import {DoCheck} from 'angular2/lifecycle_hooks'; import {Directive} from 'angular2/src/core/metadata'; import { ChangeDetectorRef, IterableDiffer, IterableDiffers } from 'angular2/src/core/change_detection'; import {ViewContainerRef, TemplateRef, ViewRef} from 'angular2/src/core/linker'; import {isPresent, isBla...
private _applyChanges(changes) { // TODO(rado): check if change detection can produce a change record that is // easier to consume than current. var recordViewTuples = []; changes.forEachRemovedItem((removedRecord) => recordViewTuples.push(new RecordViewTuple(remov...
{ if (isPresent(this._differ)) { var changes = this._differ.diff(this._ngForOf); if (isPresent(changes)) this._applyChanges(changes); } }
identifier_body
ng_for.ts
import {DoCheck} from 'angular2/lifecycle_hooks'; import {Directive} from 'angular2/src/core/metadata'; import { ChangeDetectorRef, IterableDiffer, IterableDiffers } from 'angular2/src/core/change_detection'; import {ViewContainerRef, TemplateRef, ViewRef} from 'angular2/src/core/linker'; import {isPresent, isBla...
return movedTuples; } private _bulkInsert(tuples: RecordViewTuple[]): RecordViewTuple[] { tuples.sort((a, b) => a.record.currentIndex - b.record.currentIndex); for (var i = 0; i < tuples.length; i++) { var tuple = tuples[i]; if (isPresent(tuple.view)) { this._viewContainer.insert(t...
{ var tuple = tuples[i]; // separate moved views from removed views. if (isPresent(tuple.record.currentIndex)) { tuple.view = this._viewContainer.detach(tuple.record.previousIndex); movedTuples.push(tuple); } else { this._viewContainer.remove(tuple.record.previousIndex); ...
conditional_block
ng_for.ts
import {DoCheck} from 'angular2/lifecycle_hooks'; import {Directive} from 'angular2/src/core/metadata'; import { ChangeDetectorRef, IterableDiffer, IterableDiffers } from 'angular2/src/core/change_detection'; import {ViewContainerRef, TemplateRef, ViewRef} from 'angular2/src/core/linker'; import {isPresent, isBla...
(value: any) { this._ngForOf = value; if (isBlank(this._differ) && isPresent(value)) { this._differ = this._iterableDiffers.find(value).create(this._cdr); } } set ngForTemplate(value: TemplateRef) { this._templateRef = value; } doCheck() { if (isPresent(this._differ)) { var changes =...
ngForOf
identifier_name
ng_for.ts
import {DoCheck} from 'angular2/lifecycle_hooks'; import {Directive} from 'angular2/src/core/metadata'; import { ChangeDetectorRef, IterableDiffer, IterableDiffers } from 'angular2/src/core/change_detection'; import {ViewContainerRef, TemplateRef, ViewRef} from 'angular2/src/core/linker'; import {isPresent, isBla...
for (var i = 0; i < insertTuples.length; i++) { this._perViewChange(insertTuples[i].view, insertTuples[i].record); } for (var i = 0, ilen = this._viewContainer.length; i < ilen; i++) { this._viewContainer.get(i).setLocal('last', i === ilen - 1); } } private _perViewChange(view, record...
changes.forEachAddedItem((addedRecord) => insertTuples.push(new RecordViewTuple(addedRecord, null))); this._bulkInsert(insertTuples);
random_line_split
CodeEditor.d.ts
/// <reference path="../../includes.d.ts" /> /** * Module that contains several helper functions related to hawtio's code editor * * @module CodeEditor * @main CodeEditor */ declare module CodeEditor { /** * Options for the CodeMirror text editor * * @class CodeMirrorOptions */ interfac...
* @property indentWithTabs * @type boolean */ indentWithTabs: boolean; /** * @property lineWrapping * @type boolean */ lineWrapping: boolean; /** * @property autoClosetags * @type boolean */ autoClos...
* @type boolean */ lineNumbers: boolean; /**
random_line_split
ec2_vpc_subnet.py
either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more de...
'changed': changed, 'subnet': subnet_info } def ensure_subnet_absent(vpc_conn, vpc_id, cidr, check_mode): subnet = get_matching_subnet(vpc_conn, vpc_id, cidr) if subnet is None: return {'changed': False} try: vpc_conn.delete_subnet(subnet.id, dry_run=check_mode) ...
subnet = get_matching_subnet(vpc_conn, vpc_id, cidr) changed = False if subnet is None: subnet = create_subnet(vpc_conn, vpc_id, cidr, az, check_mode) changed = True # Subnet will be None when check_mode is true if subnet is None: return { 'changed': c...
identifier_body
ec2_vpc_subnet.py
either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more de...
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.ec2 import AnsibleAWSError, connect_to_aws, ec2_argument_spec, get_aws_connection_info class AnsibleVPCSubnetException(Exception): pass class AnsibleVPCSubnetCreationException(AnsibleVPCSubnetException): pass class AnsibleVPCS...
HAS_BOTO = False if __name__ != '__main__': raise
random_line_split
ec2_vpc_subnet.py
either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more de...
(AnsibleVPCSubnetException): pass class AnsibleVPCSubnetDeletionException(AnsibleVPCSubnetException): pass class AnsibleTagCreationException(AnsibleVPCSubnetException): pass def get_subnet_info(subnet): subnet_info = {'id': subnet.id, 'availability_zone': subnet.availability_zo...
AnsibleVPCSubnetCreationException
identifier_name
ec2_vpc_subnet.py
either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more de...
region, ec2_url, aws_connect_params = get_aws_connection_info(module) if region: try: connection = connect_to_aws(boto.vpc, region, **aws_connect_params) except (boto.exception.NoAuthHandlerFound, AnsibleAWSError) as e: module.fail_json(msg=str(e)) else: mo...
module.fail_json(msg='boto is required for this module')
conditional_block
ConfluxOfElementsResto.tsx
import SPELLS from 'common/SPELLS'; import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer'; import calculateEffectiveHealing from 'parser/core/calculateEffectiveHealing'; import Events, { HealEvent } from 'parser/core/Events'; import BoringSpellValueText from 'parser/ui/BoringSpellValueText'; import ...
statistic(): React.ReactNode { return ( <Statistic size="flexible" position={STATISTIC_ORDER.OPTIONAL(0)} category={STATISTIC_CATEGORY.COVENANTS} tooltip={ <> This is the healing attributable specifically to Conflux of Elements's boost to healing ...
{ if (this.selectedCombatant.hasBuff(SPELLS.CONVOKE_SPIRITS.id)) { this.healing += calculateEffectiveHealing(event, this._confluxOfElementsBoost); } }
identifier_body
ConfluxOfElementsResto.tsx
import SPELLS from 'common/SPELLS'; import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer'; import calculateEffectiveHealing from 'parser/core/calculateEffectiveHealing'; import Events, { HealEvent } from 'parser/core/Events'; import BoringSpellValueText from 'parser/ui/BoringSpellValueText'; import ...
} statistic(): React.ReactNode { return ( <Statistic size="flexible" position={STATISTIC_ORDER.OPTIONAL(0)} category={STATISTIC_CATEGORY.COVENANTS} tooltip={ <> This is the healing attributable specifically to Conflux of Elements's boost to healing ...
{ this.healing += calculateEffectiveHealing(event, this._confluxOfElementsBoost); }
conditional_block
ConfluxOfElementsResto.tsx
import SPELLS from 'common/SPELLS'; import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer'; import calculateEffectiveHealing from 'parser/core/calculateEffectiveHealing'; import Events, { HealEvent } from 'parser/core/Events'; import BoringSpellValueText from 'parser/ui/BoringSpellValueText'; import ...
(options: Options) { super(options); this.active = this.selectedCombatant.hasConduitBySpellID(SPELLS.CONFLUX_OF_ELEMENTS.id); this._confluxOfElementsBoost = CONFLUX_OF_ELEMENTS_EFFECT_BY_RANK[ this.selectedCombatant.conduitRankBySpellID(SPELLS.CONFLUX_OF_ELEMENTS.id) ]; this.addEven...
constructor
identifier_name
ConfluxOfElementsResto.tsx
import SPELLS from 'common/SPELLS'; import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer'; import calculateEffectiveHealing from 'parser/core/calculateEffectiveHealing'; import Events, { HealEvent } from 'parser/core/Events'; import BoringSpellValueText from 'parser/ui/BoringSpellValueText'; import ...
} } export default ConfluxOfElementsResto;
random_line_split
numberFormatter.py
import math def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False): """ Add suffix to value, transform value to match new suffix and round it. Keyword arguments: val -- value to process prec -- precision of final number (number of significant positions to show) lo...
(val, prec): if int(val) == val: return int(val) return round(val, prec)
roundDec
identifier_name
numberFormatter.py
import math def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False): """ Add suffix to value, transform value to match new suffix and round it. Keyword arguments: val -- value to process prec -- precision of final number (number of significant positions to show) lo...
if int(val) == val: return int(val) return round(val, prec)
identifier_body
numberFormatter.py
import math def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False): """ Add suffix to value, transform value to match new suffix and round it. Keyword arguments: val -- value to process prec -- precision of final number (number of significant positions to show) lo...
# Positive suffixes if abs(val) > 1 and highest >= posLowest: # Start from highest possible suffix for key in posOrders: # Find first suitable suffix and check if it's not above highest order if abs(val) >= 10 ** key and key <= highest: mantissa, suffix = ...
# Find the least abs(key) posLowest = min(posOrders) negHighest = max(negOrders) # By default, mantissa takes just value and no suffix mantissa, suffix = val, ""
random_line_split
numberFormatter.py
import math def formatAmount(val, prec=3, lowest=0, highest=0, currency=False, forceSign=False): """ Add suffix to value, transform value to match new suffix and round it. Keyword arguments: val -- value to process prec -- precision of final number (number of significant positions to show) lo...
return val def roundDec(val, prec): if int(val) == val: return int(val) return round(val, prec)
val = int(val)
conditional_block