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 |
|---|---|---|---|---|
51_N-Queens.py | class Solution(object):
def solveNQueens(self, n):
| if rows[pre_row] == rows[cur_row] or \
pre_row - rows[pre_row] == cur_row - rows[cur_row] or \
pre_row + rows[pre_row] == cur_row + rows[cur_row]:
return False
else:
return True
def add_answer():
ans = [... | """
:type n: int
:rtype: List[List[str]]
"""
def search(cur):
if cur == n:
add_answer()
else:
for i in range(n):
ok = True
rows[cur] = i
for j in range(cur):
... | identifier_body |
issue-3038.rs | impl HTMLTableElement {
fn func() | last_tbody
.upcast::<Node>()
.AppendChild(new_row.upcast::<Node>())
.expect("InsertRow failed to append first row.");
}
}
}
}
| {
if number_of_row_elements == 0 {
if let Some(last_tbody) = node
.rev_children()
.filter_map(DomRoot::downcast::<Element>)
.find(|n| {
n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")
})
... | identifier_body |
issue-3038.rs | impl HTMLTableElement {
fn func() {
if number_of_row_elements == 0 {
if let Some(last_tbody) = node
.rev_children()
.filter_map(DomRoot::downcast::<Element>)
.find(|n| {
n.is::<HTMLTableSectionElement>() && n.local_name() == &lo... | .expect("InsertRow failed to append first row.");
}
}
}
} | n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")
}) {
last_tbody
.upcast::<Node>()
.AppendChild(new_row.upcast::<Node>()) | random_line_split |
issue-3038.rs | impl HTMLTableElement {
fn | () {
if number_of_row_elements == 0 {
if let Some(last_tbody) = node
.rev_children()
.filter_map(DomRoot::downcast::<Element>)
.find(|n| {
n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")
... | func | identifier_name |
issue-3038.rs | impl HTMLTableElement {
fn func() {
if number_of_row_elements == 0 {
if let Some(last_tbody) = node
.rev_children()
.filter_map(DomRoot::downcast::<Element>)
.find(|n| {
n.is::<HTMLTableSectionElement>() && n.local_name() == &lo... |
}
}
| {
if let Some(last_tbody) = node.find(|n| {
n.is::<HTMLTableSectionElement>() && n.local_name() == &local_name!("tbody")
}) {
last_tbody
.upcast::<Node>()
.AppendChild(new_row.upcast::<Node>())
.expect("I... | conditional_block |
optimize_grid.py | elif event.key == 'p':
self.show_bad_cells()
return True
last_axis = None
def on_buttonrelease(self,event):
if event.inaxes is not None:
if plt.axis() != self.last_axis:
print("Viewport has changed")
self.last_axis ... |
valid = (p.cells[cell_ids,0]>=0)
vc = p.vcenters()[cell_ids]
local_scale = np.zeros( len(cell_ids), np.float64)
if use_original_density:
local_scale[valid] = self.original_density( vc[valid,:] )
else:
local_scale[valid] = p.density( vc[valid,:] )
... | cell_ids = np.arange(p.Ncells()) | conditional_block |
optimize_grid.py | elif event.key == 'p':
self.show_bad_cells()
return True
last_axis = None
def on_buttonrelease(self,event):
if event.inaxes is not None:
if plt.axis() != self.last_axis:
print("Viewport has changed")
self.last_axis ... |
class GridOptimizer(object):
def __init__(self,p):
self.p = p
self.original_density = p.density
# These are the values that, as needed, are used to construct a reduced scale
# apollonius field. since right now ApolloniusField doesn't support insertion
# and updates, we ke... | random_line_split | |
optimize_grid.py | (self,pnt):
c = self.p.closest_cell(pnt)
nbr = self.og.cell_neighborhood(c,2)
self.og.relax_neighborhood(nbr)
self.p.plot()
last_node_relaxed = None
def relax_node_at_point(self,pnt):
v = self.p.closest_point(pnt)
if v == self.last_node_relaxed:
pri... | optimize_at_point | identifier_name | |
optimize_grid.py | elif event.key == 'p':
self.show_bad_cells()
return True
last_axis = None
def on_buttonrelease(self,event):
|
class GridOptimizer(object):
def __init__(self,p):
self.p = p
self.original_density = p.density
# These are the values that, as needed, are used to construct a reduced scale
# apollonius field. since right now ApolloniusField doesn't support insertion
# and updates, we k... | if event.inaxes is not None:
if plt.axis() != self.last_axis:
print("Viewport has changed")
self.last_axis = plt.axis()
self.p.default_clip = self.last_axis
# simple resolution-dependent plotting:
if self.last_axis[1] - self.la... | identifier_body |
file.rs | // "Tifflin" Kernel
// - By John Hodge (thePowersGang)
//
// Modules/fs_fat/dir.rs
use kernel::prelude::*;
use kernel::lib::mem::aref::ArefBorrow;
use kernel::vfs::node;
const ERROR_SHORTCHAIN: node::IoError = node::IoError::Unknown("Cluster chain terminated early");
pub type FilesystemInner = super::FilesystemInner;... | impl node::NodeBase for FileNode {
fn get_id(&self) -> node::InodeId {
todo!("FileNode::get_id")
}
}
impl node::File for FileNode {
fn size(&self) -> u64 {
self.size as u64
}
fn truncate(&self, newsize: u64) -> node::Result<u64> {
todo!("FileNode::truncate({:#x})", newsize);
}
fn clear(&self, ofs: u64, siz... | random_line_split | |
file.rs | // "Tifflin" Kernel
// - By John Hodge (thePowersGang)
//
// Modules/fs_fat/dir.rs
use kernel::prelude::*;
use kernel::lib::mem::aref::ArefBorrow;
use kernel::vfs::node;
const ERROR_SHORTCHAIN: node::IoError = node::IoError::Unknown("Cluster chain terminated early");
pub type FilesystemInner = super::FilesystemInner;... |
{
fs: ArefBorrow<FilesystemInner>,
//parent_dir: u32,
first_cluster: u32,
size: u32,
}
impl FileNode
{
pub fn new_boxed(fs: ArefBorrow<FilesystemInner>, _parent: u32, first_cluster: u32, size: u32) -> Box<FileNode> {
Box::new(FileNode {
fs: fs,
//parent_dir: parent,
first_cluster: first_cluster,
s... | FileNode | identifier_name |
file.rs | // "Tifflin" Kernel
// - By John Hodge (thePowersGang)
//
// Modules/fs_fat/dir.rs
use kernel::prelude::*;
use kernel::lib::mem::aref::ArefBorrow;
use kernel::vfs::node;
const ERROR_SHORTCHAIN: node::IoError = node::IoError::Unknown("Cluster chain terminated early");
pub type FilesystemInner = super::FilesystemInner;... |
}
impl node::File for FileNode {
fn size(&self) -> u64 {
self.size as u64
}
fn truncate(&self, newsize: u64) -> node::Result<u64> {
todo!("FileNode::truncate({:#x})", newsize);
}
fn clear(&self, ofs: u64, size: u64) -> node::Result<()> {
todo!("FileNode::clear({:#x}+{:#x}", ofs, size);
}
fn read(&self, of... | {
todo!("FileNode::get_id")
} | identifier_body |
chrome.ts | import { RawConfig } from './config.js'
import { ProxyHook, Storage, WebHook } from './switchyd.js'
/* eslint-disable no-unused-vars */
declare type saveConfig = {
'switchyd.config':RawConfig
}
declare const chrome:{
webRequest :WebHook
proxy : ProxyHook
storage : {
local : {
set:(items:saveCo... | listen: [
'net::ERR_CONNECTION_RESET',
'net::ERR_CONNECTION_TIMED_OUT',
'net::ERR_SSL_PROTOCOL_ERROR',
'net::ERR_TIMED_OUT'
],
server: 'SOCKS5 127.0.0.1:10086'
}]
}
await chrome.storage.local.set({ 'swi... | version: 3,
servers: [{
accepts: [],
denys: [], | random_line_split |
chrome.ts | import { RawConfig } from './config.js'
import { ProxyHook, Storage, WebHook } from './switchyd.js'
/* eslint-disable no-unused-vars */
declare type saveConfig = {
'switchyd.config':RawConfig
}
declare const chrome:{
webRequest :WebHook
proxy : ProxyHook
storage : {
local : {
set:(items:saveCo... | server: 'SOCKS5 127.0.0.1:10086'
}]
}
await chrome.storage.local.set({ 'switchyd.config': defaultConfig })
const config = await chrome.storage.local.get('switchyd.config')
return config['switchyd.config']
},
set: (config:RawConfig):Promise<void> => {
... | {
if (chrome && chrome.storage) {
return {
get: async ():Promise<RawConfig> => {
const save = await chrome.storage.local.get('switchyd.config')
if (save['switchyd.config']) {
return save['switchyd.config']
}
// try local storage
const defaultConfig = {
... | identifier_body |
chrome.ts | import { RawConfig } from './config.js'
import { ProxyHook, Storage, WebHook } from './switchyd.js'
/* eslint-disable no-unused-vars */
declare type saveConfig = {
'switchyd.config':RawConfig
}
declare const chrome:{
webRequest :WebHook
proxy : ProxyHook
storage : {
local : {
set:(items:saveCo... | ():Storage {
if (chrome && chrome.storage) {
return {
get: async ():Promise<RawConfig> => {
const save = await chrome.storage.local.get('switchyd.config')
if (save['switchyd.config']) {
return save['switchyd.config']
}
// try local storage
const defaultConf... | resolveStorage | identifier_name |
chrome.ts | import { RawConfig } from './config.js'
import { ProxyHook, Storage, WebHook } from './switchyd.js'
/* eslint-disable no-unused-vars */
declare type saveConfig = {
'switchyd.config':RawConfig
}
declare const chrome:{
webRequest :WebHook
proxy : ProxyHook
storage : {
local : {
set:(items:saveCo... |
// try local storage
const defaultConfig = {
version: 3,
servers: [{
accepts: [],
denys: [],
listen: [
'net::ERR_CONNECTION_RESET',
'net::ERR_CONNECTION_TIMED_OUT',
'net::ERR_SSL_PROTOCOL_ERROR',
... | {
return save['switchyd.config']
} | conditional_block |
test_cew.py | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | pass
gf.delete_file(handler, output_file_path)
def test_cew_synthesize_multiple_lang(self):
handler, output_file_path = gf.tmp_file(suffix=".wav")
try:
c_quit_after = 0.0
c_backwards = 0
c_text = [
(u"en", u"Dummy 1"), ... | handler, output_file_path = gf.tmp_file(suffix=".wav")
try:
c_quit_after = 0.0
c_backwards = 0
c_text = [
(u"en", u"Dummy 1"), # NOTE cew requires the actual eSpeak voice code
(u"en", u"Dummy 2"), # NOTE cew requires the actual eS... | identifier_body |
test_cew.py | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | unittest.main() | conditional_block | |
test_cew.py | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | c_backwards,
c_text
)
self.assertEqual(sr, 22050)
self.assertEqual(sf, 3)
self.assertEqual(len(intervals), 3)
except ImportError:
pass
gf.delete_file(handler, output_file_path)
def test_cew_synthesize_multip... | import aeneas.cew.cew
sr, sf, intervals = aeneas.cew.cew.synthesize_multiple(
output_file_path,
c_quit_after, | random_line_split |
test_cew.py | #!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... | (self):
handler, output_file_path = gf.tmp_file(suffix=".wav")
try:
c_quit_after = 0.0
c_backwards = 0
c_text = [
(u"en", u"Dummy 1"), # NOTE cew requires the actual eSpeak voice code
(u"en", u"Dummy 2"), # NOTE cew requir... | test_cew_synthesize_multiple | identifier_name |
cli.js | #!/usr/bin/env node
'use strict'
const localWebServer = require('../')
const cliOptions = require('../lib/cli-options')
const commandLineArgs = require('command-line-args')
const ansi = require('ansi-escape-sequences')
const loadConfig = require('config-master')
const path = require('path')
const os = require('os')
con... | () {
let options = {}
/* parse command line args */
options = cli.parse()
const builtIn = {
port: 8000,
directory: process.cwd(),
forbid: [],
rewrite: []
}
if (options.server.rewrite) {
options.server.rewrite = parseRewriteRules(options.server.rewrite)
}
/* override built-in def... | collectOptions | identifier_name |
cli.js | #!/usr/bin/env node
'use strict'
const localWebServer = require('../')
const cliOptions = require('../lib/cli-options')
const commandLineArgs = require('command-line-args')
const ansi = require('ansi-escape-sequences')
const loadConfig = require('config-master')
const path = require('path')
const os = require('os')
con... | }
function parseRewriteRules (rules) {
return rules && rules.map(rule => {
const matches = rule.match(/(\S*)\s*->\s*(\S*)/)
return {
from: matches[1],
to: matches[2]
}
})
}
function validateOptions (options) {
let valid = true
function invalid (msg) {
return `[red underline]{Inval... | {
let options = {}
/* parse command line args */
options = cli.parse()
const builtIn = {
port: 8000,
directory: process.cwd(),
forbid: [],
rewrite: []
}
if (options.server.rewrite) {
options.server.rewrite = parseRewriteRules(options.server.rewrite)
}
/* override built-in default... | identifier_body |
cli.js | #!/usr/bin/env node
'use strict'
const localWebServer = require('../')
const cliOptions = require('../lib/cli-options')
const commandLineArgs = require('command-line-args')
const ansi = require('ansi-escape-sequences')
const loadConfig = require('config-master')
const path = require('path')
const os = require('os')
con... |
}
function stop (msgs, exitCode) {
arrayify(msgs).forEach(msg => console.error(ansi.format(msg)))
process.exitCode = exitCode
}
function onServerUp () {
let ipList = Object.keys(os.networkInterfaces())
.map(key => os.networkInterfaces()[key])
.reduce(flatten, [])
.filter(iface => iface.family === '... | {
app.listen(options.server.port, onServerUp)
} | conditional_block |
cli.js | #!/usr/bin/env node
'use strict'
const localWebServer = require('../')
const cliOptions = require('../lib/cli-options')
const commandLineArgs = require('command-line-args')
const ansi = require('ansi-escape-sequences')
const loadConfig = require('config-master')
const path = require('path')
const os = require('os')
con... | if (options.server.rewrite) {
options.server.rewrite = parseRewriteRules(options.server.rewrite)
}
/* override built-in defaults with stored config and then command line args */
options.server = Object.assign(builtIn, stored, options.server)
return options
}
function parseRewriteRules (rules) {
return... | }
| random_line_split |
acct_stop_process.py | #!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import logging
import datetime
def process(req=None,user=None,radiusd=None,**kwargs):
if not req.get_acct_status_type() == STATUS_TYPE_STOP:
return
runstat=radiusd.runstat
store = ra... |
_datetime = datetime.datetime.now()
online = store.get_online(ticket.nas_addr,ticket.acct_session_id)
if not online:
session_time = ticket.acct_session_time
stop_time = _datetime.strftime( "%Y-%m-%d %H:%M:%S")
start_time = (_datetime - datetime.timedelta(seconds=int(session_t... | ticket.nas_addr = req.source[0] | conditional_block |
acct_stop_process.py | #!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import logging
import datetime
def process(req=None,user=None,radiusd=None,**kwargs):
if not req.get_acct_status_type() == STATUS_TYPE_STOP:
return
runstat=radiusd.runstat
store = ra... | store.add_ticket(ticket)
radiusd.syslog.info('[username:%s] Accounting stop request, remove online'%req.get_user_name(),level=logging.INFO) | random_line_split | |
acct_stop_process.py | #!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import logging
import datetime
def process(req=None,user=None,radiusd=None,**kwargs):
| ticket.stop_source = STATUS_TYPE_STOP
store.add_ticket(ticket)
else:
store.del_online(ticket.nas_addr,ticket.acct_session_id)
ticket.acct_start_time = online['acct_start_time']
ticket.acct_stop_time= _datetime.strftime( "%Y-%m-%d %H:%M:%S")
ticket.start_source = onlin... | if not req.get_acct_status_type() == STATUS_TYPE_STOP:
return
runstat=radiusd.runstat
store = radiusd.store
runstat.acct_stop += 1
ticket = req.get_ticket()
if not ticket.nas_addr:
ticket.nas_addr = req.source[0]
_datetime = datetime.datetime.now()
online = s... | identifier_body |
acct_stop_process.py | #!/usr/bin/env python
#coding=utf-8
from twisted.python import log
from toughradius.radiusd.settings import *
import logging
import datetime
def | (req=None,user=None,radiusd=None,**kwargs):
if not req.get_acct_status_type() == STATUS_TYPE_STOP:
return
runstat=radiusd.runstat
store = radiusd.store
runstat.acct_stop += 1
ticket = req.get_ticket()
if not ticket.nas_addr:
ticket.nas_addr = req.source[0]
_da... | process | identifier_name |
webpack.config.js | const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const PATHS = {
SRC: path.join(__dirname, 'src')
};
const webpackConfig = {
entry: ['./src/index.jsx'],
plugins: [new ExtractTextPlugin('style.css')],
devtool: 'source-map',
node: {
fs: 'empty'
},
output:... | },
resolve: {
extensions: ['.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './'
}
};
module.exports = webpackConfig; | loader: 'file-loader?name=[name].[hash].[ext]'
}
}
] | random_line_split |
radio.class.js | const MnCheckbox = require('../checkbox/checkbox.class.js')
const evaluate = require('evaluate-string')
module.exports = class MnRadio extends MnCheckbox {
constructor(self) {
self = super(self)
return self
}
connectedCallback() {
this.innerHTML = ''
this._setStyle()
super._setLabel()
th... |
}
}
| {
option.checked = true
} | conditional_block |
radio.class.js | const MnCheckbox = require('../checkbox/checkbox.class.js')
const evaluate = require('evaluate-string')
module.exports = class MnRadio extends MnCheckbox {
constructor(self) {
self = super(self)
return self
}
connectedCallback() {
this.innerHTML = ''
this._setStyle()
super._setLabel()
th... | () {
this.classList.add('mn-radio')
this.classList.add('mn-option')
}
_setInput() {
this.input = document.createElement('input')
this.input.setAttribute('type', 'radio')
this.label.appendChild(this.input)
this.input.addEventListener('change', (event) => {
this.checked
? this.... | _setStyle | identifier_name |
radio.class.js | const MnCheckbox = require('../checkbox/checkbox.class.js')
const evaluate = require('evaluate-string')
module.exports = class MnRadio extends MnCheckbox {
constructor(self) { | return self
}
connectedCallback() {
this.innerHTML = ''
this._setStyle()
super._setLabel()
this._setInput()
this._setCustomInput()
this._setForm()
// this.checked = this.hasAttribute('checked')
this.disabled = this.hasAttribute('disabled')
this.readonly = this.hasAttribute('... | self = super(self) | random_line_split |
radio.class.js | const MnCheckbox = require('../checkbox/checkbox.class.js')
const evaluate = require('evaluate-string')
module.exports = class MnRadio extends MnCheckbox {
constructor(self) {
self = super(self)
return self
}
connectedCallback() {
this.innerHTML = ''
this._setStyle()
super._setLabel()
th... |
}
| {
this.options.forEach(option => {
option.checked = false
})
const option = this.options.find(option => evaluate(option.getAttribute('value')) === value)
if (option) {
option.checked = true
}
} | identifier_body |
consumer_tracking_pipeline_visitor_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | (self):
self.pipeline = Pipeline(DirectRunner())
self.visitor = ConsumerTrackingPipelineVisitor()
try: # Python 2
self.assertCountEqual = self.assertItemsEqual
except AttributeError: # Python 3
pass
def test_root_transforms(self):
root_read = beam.Impulse()
root_flatten = Flatte... | setUp | identifier_name |
consumer_tracking_pipeline_visitor_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
def test_root_transforms(self):
root_read = beam.Impulse()
root_flatten = Flatten(pipeline=self.pipeline)
pbegin = pvalue.PBegin(self.pipeline)
pcoll_read = pbegin | 'read' >> root_read
pcoll_read | FlatMap(lambda x: x)
[] | 'flatten' >> root_flatten
self.pipeline.visit(self.visitor)
... | random_line_split | |
consumer_tracking_pipeline_visitor_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
class ProcessNumbersFn(DoFn):
def process(self, element, negatives):
yield element
def _process_numbers(pcoll, negatives):
first_output = (
pcoll
| 'process numbers step 1' >> ParDo(ProcessNumbersFn(), negatives))
second_output = (
first_output
... | def process(self, element):
if element < 0:
yield pvalue.TaggedOutput('tag_negative', element)
else:
yield element | identifier_body |
consumer_tracking_pipeline_visitor_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
else:
yield element
class ProcessNumbersFn(DoFn):
def process(self, element, negatives):
yield element
def _process_numbers(pcoll, negatives):
first_output = (
pcoll
| 'process numbers step 1' >> ParDo(ProcessNumbersFn(), negatives))
second_out... | yield pvalue.TaggedOutput('tag_negative', element) | conditional_block |
km.js | /*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'liststyle', 'km', {
armenian: 'លេខអារមេនី',
bulletedTitle: 'លក្ខណៈសម្បត្តិបញ្ជីជាចំណុច',
circle: 'រង្វង់មូល',
decimal: 'លេខទសភាគ (... | validateStartNumber: 'លេខចាប់ផ្ដើមបញ្ជី ត្រូវតែជាតួលេខពិតប្រាកដ។'
} ); | start: 'ចាប់ផ្ដើម',
type: 'ប្រភេទ',
upperAlpha: 'អក្សរធំ (A, B, C, D, E, ...)',
upperRoman: 'លេខរ៉ូម៉ាំងធំ (I, II, III, IV, V, ...)',
| random_line_split |
open_unit_async.py | """
This example opens the connection in async mode (does not work properly in Python 2.7).
"""
import os
import time
from msl.equipment import (
EquipmentRecord,
ConnectionRecord,
Backend,
)
record = EquipmentRecord(
manufacturer='Pico Technology',
model='5244B', # update for your PicoScope
... |
time.sleep(0.02)
print('Took {:.2f} seconds to establish a connection to the PicoScope'.format(time.time()-t0))
# flash the LED light for 5 seconds
scope.flash_led(-1)
time.sleep(5)
| break | conditional_block |
open_unit_async.py | """
This example opens the connection in async mode (does not work properly in Python 2.7).
"""
import os
import time
from msl.equipment import (
EquipmentRecord,
ConnectionRecord,
Backend, | serial='DY135/055', # update for your PicoScope
connection=ConnectionRecord(
backend=Backend.MSL,
address='SDK::ps5000a.dll', # update for your PicoScope
properties={'open_async': True}, # opening in async mode is done in the properties
)
)
# optional: ensure that the PicoTech DL... | )
record = EquipmentRecord(
manufacturer='Pico Technology',
model='5244B', # update for your PicoScope | random_line_split |
function.rs | //! Defines the `FunctionProto` type, which is a garbage-collected version of core's `FnData`, as
//! well as the `Function` type, which is an instantiated, runnable function inside the VM.
use lea_core::fndata::{UpvalDesc, FnData};
use lea_core::opcode::*;
use mem::*;
use Value;
use std::rc::Rc;
use std::cell::Cell... | else {
Rc::new(Cell::new(Upval::Closed(Value::Nil)))
})
}
/// Sets an upvalue to the given value.
pub fn set_upvalue(&mut self, id: usize, val: Upval) {
self.upvalues[id].set(val);
}
}
impl Traceable for Function {
fn trace<T: Tracer>(&self, t: &mut T) {
t.mark... | {
first = false;
Rc::new(Cell::new(Upval::Closed(env)))
} | conditional_block |
function.rs | //! Defines the `FunctionProto` type, which is a garbage-collected version of core's `FnData`, as
//! well as the `Function` type, which is an instantiated, runnable function inside the VM.
use lea_core::fndata::{UpvalDesc, FnData};
use lea_core::opcode::*;
use mem::*;
use Value;
use std::rc::Rc;
use std::cell::Cell... | (&mut self, id: usize, val: Upval) {
self.upvalues[id].set(val);
}
}
impl Traceable for Function {
fn trace<T: Tracer>(&self, t: &mut T) {
t.mark_traceable(self.proto);
for uv in &self.upvalues {
if let Upval::Closed(val) = uv.get() {
val.trace(t);
... | set_upvalue | identifier_name |
function.rs | //! Defines the `FunctionProto` type, which is a garbage-collected version of core's `FnData`, as
//! well as the `Function` type, which is an instantiated, runnable function inside the VM.
use lea_core::fndata::{UpvalDesc, FnData};
use lea_core::opcode::*;
use mem::*;
use Value;
use std::rc::Rc;
use std::cell::Cell... | Open(usize),
/// Closed upvalue, storing its value inline
Closed(Value),
}
/// Instantiated function
#[derive(Debug)]
pub struct Function {
/// The prototype from which this function was instantiated
pub proto: TracedRef<FunctionProto>,
/// Upvalue references, indexed by upvalue ID
pub upva... | random_line_split | |
function.rs | //! Defines the `FunctionProto` type, which is a garbage-collected version of core's `FnData`, as
//! well as the `Function` type, which is an instantiated, runnable function inside the VM.
use lea_core::fndata::{UpvalDesc, FnData};
use lea_core::opcode::*;
use mem::*;
use Value;
use std::rc::Rc;
use std::cell::Cell... |
}
/// An active Upvalue
#[derive(Debug, Clone, Copy)]
pub enum Upval {
/// Upvalue is stored in a stack slot
Open(usize),
/// Closed upvalue, storing its value inline
Closed(Value),
}
/// Instantiated function
#[derive(Debug)]
pub struct Function {
/// The prototype from which this function was i... | {
for ch in &self.child_protos {
t.mark_traceable(*ch);
}
} | identifier_body |
manager.py | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
Args:
alias: Alias of source to remove.
"""
logger.info('removing source with alias "{}"'.format(alias))
try:
del cls._sources[alias]
except KeyError:
raise UnknownSourceError(alias)
@classmethod
def list(cls):
return list(cls... | raise UnknownSourceError(alias)
@classmethod
def remove(cls, alias):
"""Remove source by alias. | random_line_split |
manager.py | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
# Generate eve objects and cache them, as generation takes
# significant amount of time
eve_objects = EveObjBuilder.run(data_handler)
cache_handler.update_cache(eve_objects, current_fp)
# Finally, add record to list of sources
source = Source(alias=alia... | msg = (
'fingerprint mismatch: cache "{}", data "{}", '
'updating cache'
).format(cache_fp, current_fp)
logger.info(msg) | conditional_block |
manager.py | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... |
@staticmethod
def __format_fingerprint(data_version):
return '{}_{}'.format(data_version, eos_version)
@classmethod
def __repr__(cls):
spec = [['sources', '_sources']]
return make_repr_str(cls, spec)
| return list(cls._sources.keys()) | identifier_body |
manager.py | # ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | (data_version):
return '{}_{}'.format(data_version, eos_version)
@classmethod
def __repr__(cls):
spec = [['sources', '_sources']]
return make_repr_str(cls, spec)
| __format_fingerprint | identifier_name |
CalendarEventStatusRoute.ts | /* globals module */
/**
* @module calendarEventStatusRoute
* @description BaasicCalendarEventStatusRoute Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use BaasicCalendarEventStatusRoute Definition to obtain needed routes while other routes will be obtained... |
return super.baseFind(this.findRoute, opt);
}
/**
* Parses get route which must be expanded with the id of the previously created CalendarEventStatus resource. The route can be expanded using additional options. Supported items are:
* - `embed` - Comma separated list of resources to be conta... | {
opt = {};
} | conditional_block |
CalendarEventStatusRoute.ts | /* globals module */
/**
* @module calendarEventStatusRoute
* @description BaasicCalendarEventStatusRoute Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use BaasicCalendarEventStatusRoute Definition to obtain needed routes while other routes will be obtained... |
/**
* Parses purge route. This URI template does not expose any additional options.
* @method
* @example calendarEventStatusRoute.purge();
*/
purge(): any {
return super.parse(this.purgeRoute);
}
protected getToDate(options: any) {
if (!this.utility.isUndefined(opt... | {
return super.baseDelete(this.deleteRoute, data);
} | identifier_body |
CalendarEventStatusRoute.ts | /* globals module */
/**
* @module calendarEventStatusRoute
* @description BaasicCalendarEventStatusRoute Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use BaasicCalendarEventStatusRoute Definition to obtain needed routes while other routes will be obtained... | (options: any) {
if (!this.utility.isUndefined(options.from) && options.from !== null) {
return options.from.toISOString();
}
return undefined;
}
}
/**
* @overview
***Notes:**
- Refer to the [REST API documentation](https://github.com/Baasic/baasic-rest-api/wiki) for detailed... | getFromDate | identifier_name |
CalendarEventStatusRoute.ts | /* globals module */ | /**
* @module calendarEventStatusRoute
* @description BaasicCalendarEventStatusRoute Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use BaasicCalendarEventStatusRoute Definition to obtain needed routes while other routes will be obtained through HAL. By conv... | random_line_split | |
connection-basics.component.ts | import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TourService } from 'ngx-tour-ngx-bootstrap';
import { CurrentConnectionService } from '../current-connection';
import... |
onSelected(connector: Connector) {
const connection = TypeFactory.createConnection();
const plain = connector['plain'];
if (plain && typeof plain === 'function') {
connection.connector = plain();
} else {
connection.connector = connector;
}
connection.icon = connector.icon;
c... | {
this.connectorStore.loadAll();
/**
* If guided tour state is set to be shown (i.e. true), then show it for this page, otherwise don't.
*/
if (this.userService.getTourState() === true) {
this.tourService.initialize([ {
anchorId: 'connections.type',
title: 'Connection',
... | identifier_body |
connection-basics.component.ts | import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TourService } from 'ngx-tour-ngx-bootstrap';
import { CurrentConnectionService } from '../current-connection';
import... | implements OnInit {
loading: Observable<boolean>;
connectors: Observable<Connectors>;
filteredConnectors: Subject<Connectors> = new BehaviorSubject(<Connectors>{});
constructor(
private current: CurrentConnectionService,
private connectorStore: ConnectorStore,
public tourService: TourService,
... | ConnectionsConnectionBasicsComponent | identifier_name |
connection-basics.component.ts | import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TourService } from 'ngx-tour-ngx-bootstrap';
import { CurrentConnectionService } from '../current-connection';
import... |
connection.icon = connector.icon;
connection.connectorId = connector.id;
this.current.connection = connection;
}
}
| {
connection.connector = connector;
} | conditional_block |
connection-basics.component.ts | import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { TourService } from 'ngx-tour-ngx-bootstrap';
import { CurrentConnectionService } from '../current-connection';
import... | @Component({
selector: 'syndesis-connections-connection-basics',
templateUrl: 'connection-basics.component.html'
})
export class ConnectionsConnectionBasicsComponent implements OnInit {
loading: Observable<boolean>;
connectors: Observable<Connectors>;
filteredConnectors: Subject<Connectors> = new BehaviorSubj... | random_line_split | |
ping_working_public.py | #! /usr/bin/python
# @author: wtie
import subprocess
import sys
import time
import argparse
DIFF = False
FIRST = []
def get_floating_ips():
sql = """SELECT fip.floating_ip_address
FROM neutron.floatingips AS fip
JOIN neutron.ports AS p
JOIN neutron.securitygroupportbinding... |
else:
print "\n[%s] %s: %s" % (total, len(fail_list), fail_list)
return fail_list
def print_report(failed_map, least_interval):
report = {}
for ip in failed_map:
if failed_map[ip] == 1:
pass
if failed_map[ip] in report:
report[failed_map[ip]].append(ip)... | if FIRST:
diff_list = [ip for ip in fail_list if ip not in FIRST]
print "\n@DIFF: [%s] %s/%s: %s" % (total, len(diff_list),
len(fail_list), diff_list)
else:
FIRST = fail_list
print "\nFIRST: [%s] %s/%s: %s" % (total, ... | conditional_block |
ping_working_public.py | #! /usr/bin/python
# @author: wtie
import subprocess
import sys
import time
import argparse
DIFF = False
FIRST = []
def get_floating_ips():
sql = """SELECT fip.floating_ip_address
FROM neutron.floatingips AS fip
JOIN neutron.ports AS p
JOIN neutron.securitygroupportbinding... | diff_list = [ip for ip in fail_list if ip not in FIRST]
print "\n@DIFF: [%s] %s/%s: %s" % (total, len(diff_list),
len(fail_list), diff_list)
else:
FIRST = fail_list
print "\nFIRST: [%s] %s/%s: %s" % (total, len(fail_l... | pingable_ips = get_public_ips(net_uuid) if net_uuid else []
pingable_ips += get_floating_ips()
total = len(pingable_ips)
fail_list = []
global DIFF
global FIRST
for ip in pingable_ips:
if DIFF and FIRST and ip in FIRST:
result = "?"
else:
result = ping(ip)... | identifier_body |
ping_working_public.py | #! /usr/bin/python
# @author: wtie
import subprocess
import sys
import time
import argparse
DIFF = False
FIRST = []
def | ():
sql = """SELECT fip.floating_ip_address
FROM neutron.floatingips AS fip
JOIN neutron.ports AS p
JOIN neutron.securitygroupportbindings AS sgb
JOIN neutron.securitygrouprules AS sgr
JOIN
(
SELECT ins.uuid ,
Count(p... | get_floating_ips | identifier_name |
ping_working_public.py | #! /usr/bin/python
# @author: wtie
import subprocess
import sys
import time
import argparse
DIFF = False
FIRST = []
def get_floating_ips():
sql = """SELECT fip.floating_ip_address
FROM neutron.floatingips AS fip
JOIN neutron.ports AS p
JOIN neutron.securitygroupportbinding... |
def ping_loop(net_uuid=None):
pingable_ips = get_public_ips(net_uuid) if net_uuid else []
pingable_ips += get_floating_ips()
total = len(pingable_ips)
fail_list = []
global DIFF
global FIRST
for ip in pingable_ips:
if DIFF and FIRST and ip in FIRST:
result = "?"
... | return subprocess.call(["ping", "-c", "1", "-w", "1", ip],
stdout=subprocess.PIPE, stderr=subprocess.PIPE) | random_line_split |
PaginationBar.js.uncompressed.js | define(
"gridx/nls/kk/PaginationBar", ({
pagerWai: 'Пейджер',
pageIndex: '${0}',
pageIndexTitle: '${0}-бет',
firstPageTitle: 'Бірінші бет',
prevPageTitle: 'Алдыңғы бет',
nextPageTitle: 'Келесі бет',
lastPageTitle: 'Соңғы бет',
pageSize: '${0}', | descriptionEmpty: 'Тор – бос.',
// OneUI blueprint
summary: 'Барлығы: ${0}',
summaryWithSelection: 'Барлығы: ${0} Таңдалды: ${1}',
gotoBtnTitle: 'Белгілі бір бетке өту',
gotoDialogTitle: 'Бетке өту',
gotoDialogMainMsg: 'Бет санын көрсетіңіз:',
gotoDialogPageCount: ' (${0} бет)',
gotoDialogOKBtn: 'Өту',
gotoDi... | pageSizeTitle: 'Бетіне ${0} элемент',
pageSizeAll: 'Барлығы',
pageSizeAllTitle: 'Барлық элементтер',
description: '${0} - ${2} элементтің ${1} элементі.', | random_line_split |
setup.py | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
| libraries = ['odrpack'] + blas_info.pop('libraries', [])
include_dirs = ['.'] + blas_info.pop('include_dirs', [])
config.add_extension('__odrpack',
sources=sources,
libraries=libraries,
include_dirs=include_dirs,
... | import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
config = Configuration('odr', parent_package, top_path)
libodr_files = ['d_odr.f',
'd_mprec.f',
'dlunoc.f']
blas_info = ge... | identifier_body |
setup.py |
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
config = Configuration('odr', parent_package, top_path)
libodr_files = ['d_odr.f',
'd_mp... | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join | random_line_split | |
setup.py | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def | (parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
config = Configuration('odr', parent_package, top_path)
libodr_files = ['d_odr.f',
'd_mprec.f',
... | configuration | identifier_name |
setup.py | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
from os.path import join
def configuration(parent_package='', top_path=None):
import warnings
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info, BlasNotFoundError
... | from numpy.distutils.core import setup
setup(**configuration(top_path='').todict()) | conditional_block | |
test_notification.py | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. 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 require... | self.assertIn('identifier: %s' % identifier, stderr)
@unittest.skipUnless(NOTIFICATION_URL,
'Test requires notification URL configuration.')
def test_stop_channel(self):
"""Tests stopping a notification channel on a bucket."""
bucket_uri = self.CreateBucket()
stderr = self.Ru... | """Integration tests for notification command."""
@unittest.skipUnless(NOTIFICATION_URL,
'Test requires notification URL configuration.')
def test_watch_bucket(self):
"""Tests creating a notification channel on a bucket."""
bucket_uri = self.CreateBucket()
self.RunGsUtil(
... | identifier_body |
test_notification.py | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. 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 require... | (self):
"""Tests creating a notification channel on a bucket."""
bucket_uri = self.CreateBucket()
self.RunGsUtil(
['notification', 'watchbucket', NOTIFICATION_URL,
suri(bucket_uri)])
identifier = str(uuid.uuid4())
token = str(uuid.uuid4())
stderr = self.RunGsUtil([
'not... | test_watch_bucket | identifier_name |
test_notification.py | # -*- coding: utf-8 -*-
# Copyright 2013 Google Inc. 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 require... |
identifier = str(uuid.uuid4())
token = str(uuid.uuid4())
stderr = self.RunGsUtil([
'notification', 'watchbucket', '-i', identifier, '-t', token,
NOTIFICATION_URL,
suri(bucket_uri)
],
return_stderr=True)
self.assertIn('token: %s' % token, stderr)
... | suri(bucket_uri)]) | random_line_split |
dependent_pairs.rs | use iterators::adaptors::Concat;
use iterators::general::CachedIterator;
use iterators::tuples::{LogPairIndices, ZOrderTupleIndices};
use malachite_base::num::conversion::traits::ExactFrom;
use std::collections::HashMap;
use std::hash::Hash;
pub fn dependent_pairs<'a, I: Iterator + 'a, J: Iterator, F: 'a>(
xs: I,
... | return Some((x, ys.next().unwrap()));
}
let mut ys = (self.f)(&self.data, &x);
let y = ys.next().unwrap();
self.x_to_ys.insert(x.clone(), ys);
Some((x, y))
}
}
pub fn $fn_name<I: Iterator, J:... | let x = self.xs.get(xi).unwrap();
self.i.increment();
if let Some(ys) = self.x_to_ys.get_mut(&x) { | random_line_split |
dependent_pairs.rs | use iterators::adaptors::Concat;
use iterators::general::CachedIterator;
use iterators::tuples::{LogPairIndices, ZOrderTupleIndices};
use malachite_base::num::conversion::traits::ExactFrom;
use std::collections::HashMap;
use std::hash::Hash;
pub fn dependent_pairs<'a, I: Iterator + 'a, J: Iterator, F: 'a>(
xs: I,
... | <I: Iterator, J: Iterator, F, T>
where
F: Fn(&T, &I::Item) -> J,
{
xs: I,
f: F,
data: T,
x_to_ys: HashMap<I::Item, J>,
}
impl<I: Iterator, J: Iterator, F, T> Iterator for RandomDependentPairs<I, J, F, T>
where
F: Fn(&T, &I::Item) -> J,
I::Item: Clone + Eq + Hash,
{
type Item = (I::Item,... | RandomDependentPairs | identifier_name |
main.rs | // Benchmark testing primitives
#![feature(test)]
extern crate test;
#[macro_use]
extern crate maplit;
extern crate bufstream;
extern crate docopt;
extern crate linked_hash_map;
extern crate libc;
extern crate net2;
extern crate rand;
extern crate rustc_serialize;
extern crate time;
mod common;
mod metrics;
mod optio... | opts.get_bind_string(),
opts.get_mem_limit());
let mut listener_task = ListenerTask::new(opts.clone());
listener_task.run();
} | random_line_split | |
main.rs | // Benchmark testing primitives
#![feature(test)]
extern crate test;
#[macro_use]
extern crate maplit;
extern crate bufstream;
extern crate docopt;
extern crate linked_hash_map;
extern crate libc;
extern crate net2;
extern crate rand;
extern crate rustc_serialize;
extern crate time;
mod common;
mod metrics;
mod optio... |
println!("Running tcp server on {} with {}mb capacity...",
opts.get_bind_string(),
opts.get_mem_limit());
let mut listener_task = ListenerTask::new(opts.clone());
listener_task.run();
}
| {
// We're done here :)
return;
} | conditional_block |
main.rs | // Benchmark testing primitives
#![feature(test)]
extern crate test;
#[macro_use]
extern crate maplit;
extern crate bufstream;
extern crate docopt;
extern crate linked_hash_map;
extern crate libc;
extern crate net2;
extern crate rand;
extern crate rustc_serialize;
extern crate time;
mod common;
mod metrics;
mod optio... | () {
println!("{} {}", consts::APP_NAME, consts::APP_VERSION);
}
fn main() {
print_version();
let opts = parse_args();
if opts.flag_version {
// We're done here :)
return;
}
println!("Running tcp server on {} with {}mb capacity...",
opts.get_bind_string(),
... | print_version | identifier_name |
main.rs | // Benchmark testing primitives
#![feature(test)]
extern crate test;
#[macro_use]
extern crate maplit;
extern crate bufstream;
extern crate docopt;
extern crate linked_hash_map;
extern crate libc;
extern crate net2;
extern crate rand;
extern crate rustc_serialize;
extern crate time;
mod common;
mod metrics;
mod optio... | {
print_version();
let opts = parse_args();
if opts.flag_version {
// We're done here :)
return;
}
println!("Running tcp server on {} with {}mb capacity...",
opts.get_bind_string(),
opts.get_mem_limit());
let mut listener_task = ListenerTask::new(opts.... | identifier_body | |
jquery.mobile.js | //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>group: exclude
define([
"require",
"./widgets/loader",
"./events/navigate",
"./navigation/path",
"./navigation/history",
"./navigation/navigator",
"./navigation/method",
"./transitions/handlers",
"./transitions/visuals",
"./animationComplete",... | "./widgets/popup.arrow",
"./widgets/panel",
"./widgets/table",
"./widgets/table.columntoggle",
"./widgets/table.reflow",
"./widgets/filterable",
"./widgets/filterable.backcompat",
"./widgets/tabs",
"./zoom",
"./zoom/iosorientationfix"
], function( require ) {
require( [ "./init" ], function() {} );
});
//>>e... | "./links",
"./widgets/toolbar",
"./widgets/fixedToolbar",
"./widgets/fixedToolbar.workarounds",
"./widgets/popup", | random_line_split |
hsts.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 net_traits::IncludeSubdomains;
use rustc_serialize::json::{decode};
use std::net::{Ipv4Addr, Ipv6Addr};
use st... | }
})
}
fn has_domain(&self, host: &str) -> bool {
self.entries.iter().any(|e| {
e.matches_domain(&host)
})
}
fn has_subdomain(&self, host: &str) -> bool {
self.entries.iter().any(|e| {
e.matches_subdomain(host)
})
}
p... | self.entries.iter().any(|e| {
if e.include_subdomains {
e.matches_subdomain(host) || e.matches_domain(host)
} else {
e.matches_domain(host) | random_line_split |
hsts.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 net_traits::IncludeSubdomains;
use rustc_serialize::json::{decode};
use std::net::{Ipv4Addr, Ipv6Addr};
use st... | else if !have_subdomain {
for e in &mut self.entries {
if e.matches_domain(&entry.host) {
e.include_subdomains = entry.include_subdomains;
e.max_age = entry.max_age;
}
}
}
}
}
pub fn preload_hsts_domains() -> O... | {
self.entries.push(entry);
} | conditional_block |
hsts.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 net_traits::IncludeSubdomains;
use rustc_serialize::json::{decode};
use std::net::{Ipv4Addr, Ipv6Addr};
use st... | {
pub host: String,
pub include_subdomains: bool,
pub max_age: Option<u64>,
pub timestamp: Option<u64>
}
impl HSTSEntry {
pub fn new(host: String, subdomains: IncludeSubdomains, max_age: Option<u64>) -> Option<HSTSEntry> {
if host.parse::<Ipv4Addr>().is_ok() || host.parse::<Ipv6Addr>().is_... | HSTSEntry | identifier_name |
readline.rs | // SairaDB - A distributed database
// Copyright (C) 2015 by Siyu Wang
//
// 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; either version 2
// of the License, or (at your option) any later ver... |
}
| {
let mut s = "".to_string();
print!("{}", prompt);
match stdin().read_line(&mut s) {
Ok(_) => {
s.pop(); // pop '\n'
Some(s)
}
Err(_) => None
}
} | conditional_block |
readline.rs | // SairaDB - A distributed database
// Copyright (C) 2015 by Siyu Wang
//
// 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; either version 2
// of the License, or (at your option) any later ver... |
pub fn read_line(prompt: &str) -> Option<String> {
if cfg!(unix) {
read_line_unix(prompt)
} else {
let mut s = "".to_string();
print!("{}", prompt);
match stdin().read_line(&mut s) {
Ok(_) => {
s.pop(); // pop '\n'
Some(s)
... | {
let pr = CString::new(prompt.as_bytes()).unwrap();
let sp = unsafe { rl_readline(pr.as_ptr()) };
if sp.is_null() {
None
} else {
let cs = unsafe { CStr::from_ptr(sp) };
let line = from_utf8(cs.to_bytes()).unwrap();
push_history(&line);
Some(line.to_string())
... | identifier_body |
readline.rs | // SairaDB - A distributed database
// Copyright (C) 2015 by Siyu Wang
//
// 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; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty ... | random_line_split | |
readline.rs | // SairaDB - A distributed database
// Copyright (C) 2015 by Siyu Wang
//
// 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; either version 2
// of the License, or (at your option) any later ver... | (prompt: &str) -> Option<String> {
let pr = CString::new(prompt.as_bytes()).unwrap();
let sp = unsafe { rl_readline(pr.as_ptr()) };
if sp.is_null() {
None
} else {
let cs = unsafe { CStr::from_ptr(sp) };
let line = from_utf8(cs.to_bytes()).unwrap();
push_history(&line);
... | read_line_unix | identifier_name |
BudgetTable.js | import React from 'react';
import { getCategoryGroups } from '../selectors/categoryGroups';
import { getCategoriesByGroupId } from '../selectors/categories';
import { getSelectedMonthBudgetItemsByCategoryId, getBudgetItemsSumUpToSelectedMonthByCategoryId } from '../selectors/budgetItems';
import { getTransactionsSumUpT... | static propTypes = {
categoryGroups: React.PropTypes.array.isRequired,
categoriesByGroupId: React.PropTypes.object.isRequired,
getSelectedMonthActivityByCategoryId: React.PropTypes.object.isRequired,
getSelectedMonthBudgetItemsByCategoryId: React.PropTypes.object.isRequired,
transactionsSumUpToSel... | editingCategoryId: undefined
}
})
class BudgetTable extends React.Component { | random_line_split |
BudgetTable.js | import React from 'react';
import { getCategoryGroups } from '../selectors/categoryGroups';
import { getCategoriesByGroupId } from '../selectors/categories';
import { getSelectedMonthBudgetItemsByCategoryId, getBudgetItemsSumUpToSelectedMonthByCategoryId } from '../selectors/budgetItems';
import { getTransactionsSumUpT... | () {
const rows = [];
this.props.categoryGroups.forEach(cg => {
rows.push(<CategoryGroupRow key={"cg"+cg.id} name={cg.name} />);
if (this.props.categoriesByGroupId[cg.id]) {
this.props.categoriesByGroupId[cg.id].forEach(c => {
rows.push(<CategoryRow
key={"c"+c.id}
... | render | identifier_name |
BudgetTable.js | import React from 'react';
import { getCategoryGroups } from '../selectors/categoryGroups';
import { getCategoriesByGroupId } from '../selectors/categories';
import { getSelectedMonthBudgetItemsByCategoryId, getBudgetItemsSumUpToSelectedMonthByCategoryId } from '../selectors/budgetItems';
import { getTransactionsSumUpT... |
});
return (
<table className="table">
<thead>
<tr>
<th>Category</th>
<th>Budgeted</th>
<th>Activity</th>
<th>Available</th>
</tr>
</thead>
<tbody>
{rows}
</tbody>
</table>
);
}
}
c... | {
this.props.categoriesByGroupId[cg.id].forEach(c => {
rows.push(<CategoryRow
key={"c"+c.id}
category={c}
budgetItem={this.props.getSelectedMonthBudgetItemsByCategoryId[c.id]}
activity={this.props.getSelectedMonthActivityByCategoryId[c.id]}
a... | conditional_block |
math-helper.ts | export class Point {
x: number;
y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
delta(p: Point): Point {
return new Point(this.x + p.x, this.y + p.y);
}
add(p: Point) {
return new Point(this.x + p.x, this.y + p.y);
}
subtract(p: Point) {
return new Poin... | else {
leftPoint = line.dst;
rightPoint = line.src;
}
// If point is out of bounds, no need to do further checks.
if (this.x + SELECTION_FUZZINESS < leftPoint.x || rightPoint.x < this.x - SELECTION_FUZZINESS)
return false;
else if (this.y + SELECTION_FUZZINESS < Math.min(leftPoint.... | {
leftPoint = line.src;
rightPoint = line.dst;
} | conditional_block |
math-helper.ts | export class Point {
x: number;
y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
delta(p: Point): Point {
return new Point(this.x + p.x, this.y + p.y);
}
add(p: Point) {
return new Point(this.x + p.x, this.y + p.y);
}
subtract(p: Point) |
multiply(n: number) {
return new Point(this.x * n, this.y * n);
}
isOnLine(line: Line) {
const SELECTION_FUZZINESS = 3;
let leftPoint: Point;
let rightPoint: Point;
// Normalize start/end to left right to make the offset calc simpler.
if (line.src.x <= line.dst.x) {
leftPoint = l... | {
return new Point(this.x - p.x, this.y - p.y);
} | identifier_body |
math-helper.ts | export class Point {
x: number;
y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
delta(p: Point): Point {
return new Point(this.x + p.x, this.y + p.y);
}
add(p: Point) {
return new Point(this.x + p.x, this.y + p.y);
}
subtract(p: Point) {
return new Poin... | }
get negated(): Point {
return new Point(-this.x, -this.y);
}
}
export class Line {
src: Point;
dst: Point;
constructor(src: Point, dst: Point) {
this.src = src;
this.dst = dst;
}
get pointingLeft(): boolean {
return this.src.x > this.dst.x;
}
get angle(): number {
let dy =... | return Math.sqrt(
((p.x - this.x) * (p.x - this.x)) +
((p.y - this.y) * (p.y - this.y))
); | random_line_split |
math-helper.ts | export class Point {
x: number;
y: number;
constructor(x: number, y: number) {
this.x = x;
this.y = y;
}
delta(p: Point): Point {
return new Point(this.x + p.x, this.y + p.y);
}
add(p: Point) {
return new Point(this.x + p.x, this.y + p.y);
}
| (p: Point) {
return new Point(this.x - p.x, this.y - p.y);
}
multiply(n: number) {
return new Point(this.x * n, this.y * n);
}
isOnLine(line: Line) {
const SELECTION_FUZZINESS = 3;
let leftPoint: Point;
let rightPoint: Point;
// Normalize start/end to left right to make the offset cal... | subtract | identifier_name |
script.py | from nider.core import Font
from nider.core import Outline
from nider.models import Header
from nider.models import Paragraph
from nider.models import Linkback
from nider.models import Content
from nider.models import TwitterPost
# TODO: change this fontpath to the fontpath on your machine
roboto_font_folder = '/hom... | img.draw_on_texture('texture.png') | random_line_split | |
queries.generated.ts | /* eslint-disable */
import * as Types from '../graphqlTypes.generated';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type EmailRouteFieldsFragment = { __typename: 'EmailRoute', id: string, receiver_address: string, forward_addresses?: Array... | * variables: {
* page: // value for 'page'
* filters: // value for 'filters'
* sort: // value for 'sort'
* },
* });
*/
export function useRootSiteEmailRoutesAdminTableQuery(baseOptions?: Apollo.QueryHookOptions<RootSiteEmailRoutesAdminTableQueryData, RootSiteEmailRoutesAdminTableQueryVariables... | random_line_split | |
queries.generated.ts | /* eslint-disable */
import * as Types from '../graphqlTypes.generated';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type EmailRouteFieldsFragment = { __typename: 'EmailRoute', id: string, receiver_address: string, forward_addresses?: Array... | (baseOptions?: Apollo.LazyQueryHookOptions<RootSiteEmailRoutesAdminTableQueryData, RootSiteEmailRoutesAdminTableQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<RootSiteEmailRoutesAdminTableQueryData, RootSiteEmailRoutesAdminTableQueryVariables>(RootS... | useRootSiteEmailRoutesAdminTableQueryLazyQuery | identifier_name |
queries.generated.ts | /* eslint-disable */
import * as Types from '../graphqlTypes.generated';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type EmailRouteFieldsFragment = { __typename: 'EmailRoute', id: string, receiver_address: string, forward_addresses?: Array... |
export function useRootSiteEmailRoutesAdminTableQueryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<RootSiteEmailRoutesAdminTableQueryData, RootSiteEmailRoutesAdminTableQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<RootSiteEmailRoutesAdminTab... | {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<RootSiteEmailRoutesAdminTableQueryData, RootSiteEmailRoutesAdminTableQueryVariables>(RootSiteEmailRoutesAdminTableQueryDocument, options);
} | identifier_body |
multiple_tpus_test.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
def test_run_classification_and_detection_engine(self):
def classification_task(num_inferences):
tid = threading.get_ident()
print('Thread: %d, %d inferences for classification task' %
(tid, num_inferences))
labels = test_utils.read_label_file(
test_utils.test_data_path('... | edge_tpus = edgetpu_utils.ListEdgeTpuPaths(
edgetpu_utils.EDGE_TPU_STATE_UNASSIGNED)
self.assertGreater(len(edge_tpus), 0)
model_path = test_utils.test_data_path(
'mobilenet_v1_1.0_224_quant_edgetpu.tflite')
basic_engine = BasicEngine(model_path, edge_tpus[0])
self.assertEqual(edge_tpus[... | identifier_body |
multiple_tpus_test.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | model_path = test_utils.test_data_path(
'mobilenet_v1_1.0_224_quant_edgetpu.tflite')
basic_engine = BasicEngine(model_path, edge_tpus[0])
self.assertEqual(edge_tpus[0], basic_engine.device_path())
def test_run_classification_and_detection_engine(self):
def classification_task(num_inferences):... | random_line_split | |
multiple_tpus_test.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
print('Thread: %d, done classification task' % tid)
def detection_task(num_inferences):
tid = threading.get_ident()
print('Thread: %d, %d inferences for detection task' %
(tid, num_inferences))
model_name = 'ssd_mobilenet_v1_coco_quant_postprocess_edgetpu.tflite'
engine =... | ret = engine.classify_with_image(img, top_k=1)
self.assertEqual(len(ret), 1)
self.assertEqual(labels[ret[0][0]], 'Egyptian cat') | conditional_block |
multiple_tpus_test.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | (self):
def classification_task(num_inferences):
tid = threading.get_ident()
print('Thread: %d, %d inferences for classification task' %
(tid, num_inferences))
labels = test_utils.read_label_file(
test_utils.test_data_path('imagenet_labels.txt'))
model_name = 'mobilenet... | test_run_classification_and_detection_engine | identifier_name |
Line.ts | import { Attribute, Class } from '../decorators';
import { Element } from '../models';
import { Point } from './Point';
@Class('Line', Element)
export class Line extends Element {
private _from = new Point();
private _to = new Point();
@Attribute({ type: Point })
get from(): Point {
return this._from;
}... | }
get x1(): number {
return this._from.x;
}
get y1(): number {
return this._from.y;
}
get x2(): number {
return this._to.x;
}
get y2(): number {
return this._to.y;
}
get dy(): number {
return this._to.y - this._from.y;
}
get angle(): number {
return Math.atan2(this.... |
get dx(): number {
return this._to.x - this._from.x; | random_line_split |
Line.ts | import { Attribute, Class } from '../decorators';
import { Element } from '../models';
import { Point } from './Point';
@Class('Line', Element)
export class Line extends Element {
private _from = new Point();
private _to = new Point();
@Attribute({ type: Point })
get from(): Point {
return this._from;
}... |
@Attribute({ type: Point })
get to(): Point {
return this._to;
}
set to(value: Point) {
this._to = value;
}
get dx(): number {
return this._to.x - this._from.x;
}
get x1(): number {
return this._from.x;
}
get y1(): number {
return this._from.y;
}
get x2(): number {
... | {
this._from = value;
} | identifier_body |
Line.ts | import { Attribute, Class } from '../decorators';
import { Element } from '../models';
import { Point } from './Point';
@Class('Line', Element)
export class Line extends Element {
private _from = new Point();
private _to = new Point();
@Attribute({ type: Point })
get from(): Point {
return this._from;
}... | (value: Point) {
this._from = value;
}
@Attribute({ type: Point })
get to(): Point {
return this._to;
}
set to(value: Point) {
this._to = value;
}
get dx(): number {
return this._to.x - this._from.x;
}
get x1(): number {
return this._from.x;
}
get y1(): number {
return... | from | identifier_name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.