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
tachybradycardia.py
def bradycardia(hr, lowerthresh): """ This module determines when in the ECG data there is bradycardia :param hr: (ndarray) heart rate- used to determine when bradycardia occurred in ECG trace :param lowerthresh: (int or double) lower threshold for determining bradycardia- user input or defa...
""" This module determines when in the ECG data there is tachycardia :param hr: (ndarray) heart rate- used to determine when tachycardia occurred in ECG trace :param upperthresh: (int or double) upper threshold for determining tachycardia- user input or default 100 bpm :return: tachy: (ndarra...
identifier_body
tachybradycardia.py
def bradycardia(hr, lowerthresh): """ This module determines when in the ECG data there is bradycardia :param hr: (ndarray) heart rate- used to determine when bradycardia occurred in ECG trace :param lowerthresh: (int or double) lower threshold for determining bradycardia- user input or defa...
(hr, upperthresh): """ This module determines when in the ECG data there is tachycardia :param hr: (ndarray) heart rate- used to determine when tachycardia occurred in ECG trace :param upperthresh: (int or double) upper threshold for determining tachycardia- user input or default 100 bpm ...
tachycardia
identifier_name
workspaceView.tsx
import * as React from 'react'; import {ConnectableComponent, PublishModelEventContext, PublishModelEventDelegate} from 'esp-js-react'; import {MultiItemRegionView, SingleItemRegionView} from 'esp-js-ui'; import {WorkspaceModel} from '../model/workspaceModel'; import {SplashScreenState} from '../model/splashScreenModel...
/> </div> <div> <ConnectableComponent view={ModalView} modelId={model.modalRegion.modelId} /> </div> </div>); } else if (model.splashScreen.state === SplashScreenState.Error) { ...
modelId={model.blotterRegion.modelId}
random_line_split
error-viewport.component.spec.ts
/* * Copyright 2019, TeamDev. All rights reserved.
* Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following * disclaimer. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, ...
*
random_line_split
loading.component.ts
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { BaseDatabaseMigrator } from '../../common/data/base-database-migrator'; import { BaseScheduler } from '../../common/scheduler/base-scheduler'; import { BaseSettings } from '../../common/settings/base-settings'; import { BaseAppearanceService...
}
{ await this.scheduler.sleepAsync(2000); if (this.settings.refreshCollectionAutomatically) { await this.indexingService.indexCollectionIfOutdatedAsync(); } await this.updateService.checkForUpdatesAsync(); }
identifier_body
loading.component.ts
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { BaseDatabaseMigrator } from '../../common/data/base-database-migrator'; import { BaseScheduler } from '../../common/scheduler/base-scheduler'; import { BaseSettings } from '../../common/settings/base-settings'; import { BaseAppearanceService...
private updateService: BaseUpdateService, private indexingService: BaseIndexingService, private fileService: BaseFileService, private scheduler: BaseScheduler ) {} public async ngOnInit(): Promise<void> { await this.databaseMigrator.migrateAsync(); if (this.sett...
random_line_split
loading.component.ts
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { BaseDatabaseMigrator } from '../../common/data/base-database-migrator'; import { BaseScheduler } from '../../common/scheduler/base-scheduler'; import { BaseSettings } from '../../common/settings/base-settings'; import { BaseAppearanceService...
implements OnInit { constructor( public navigationService: BaseNavigationService, private databaseMigrator: BaseDatabaseMigrator, public appearanceService: BaseAppearanceService, private settings: BaseSettings, private updateService: BaseUpdateService, private indexi...
LoadingComponent
identifier_name
loading.component.ts
import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { BaseDatabaseMigrator } from '../../common/data/base-database-migrator'; import { BaseScheduler } from '../../common/scheduler/base-scheduler'; import { BaseSettings } from '../../common/settings/base-settings'; import { BaseAppearanceService...
} private async initializeAsync(): Promise<void> { await this.scheduler.sleepAsync(2000); if (this.settings.refreshCollectionAutomatically) { await this.indexingService.indexCollectionIfOutdatedAsync(); } await this.updateService.checkForUpdatesAsync(); } }
{ if (this.fileService.hasPlayableFilesAsParameters()) { await this.fileService.enqueueParameterFilesAsync(); this.navigationService.navigateToNowPlaying(); } else { this.navigationService.navigateToCollection(); this.initializeAsyn...
conditional_block
factory_of_factories.py
"""`Factory of Factories` pattern.""" from dependency_injector import containers, providers class SqlAlchemyDatabaseService: def __init__(self, session, base_class): self.session = session self.base_class = base_class class TokensService: def __init__(self, id_generator, database): ...
: ... # Sample objects session = object() id_generator = object() class Container(containers.DeclarativeContainer): database_factory = providers.Factory( providers.Factory, SqlAlchemyDatabaseService, session=session, ) token_service = providers.Factory( TokensServic...
User
identifier_name
factory_of_factories.py
"""`Factory of Factories` pattern.""" from dependency_injector import containers, providers class SqlAlchemyDatabaseService: def __init__(self, session, base_class): self.session = session self.base_class = base_class class TokensService: def __init__(self, id_generator, database): ...
container = Container() token_service = container.token_service() assert token_service.database.base_class is Token user_service = container.user_service() assert user_service.database.base_class is User
conditional_block
factory_of_factories.py
"""`Factory of Factories` pattern.""" from dependency_injector import containers, providers class SqlAlchemyDatabaseService: def __init__(self, session, base_class): self.session = session self.base_class = base_class class TokensService: def __init__(self, id_generator, database): ...
class Token: ... class UsersService: def __init__(self, id_generator, database): self.id_generator = id_generator self.database = database class User: ... # Sample objects session = object() id_generator = object() class Container(containers.DeclarativeContainer): database_f...
self.id_generator = id_generator self.database = database
identifier_body
factory_of_factories.py
"""`Factory of Factories` pattern.""" from dependency_injector import containers, providers
def __init__(self, session, base_class): self.session = session self.base_class = base_class class TokensService: def __init__(self, id_generator, database): self.id_generator = id_generator self.database = database class Token: ... class UsersService: def __init_...
class SqlAlchemyDatabaseService:
random_line_split
tanh_shrink.py
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 # # Un...
(inputs): """ Args: inputs (list of nn.Variable): Incomming grads/inputs to/of the forward function. kwargs (dict of arguments): Dictionary of the corresponding function arguments. Return: list of Variable: Return the gradients wrt inputs of the corresponding function. """ dy = in...
tanh_shrink_backward
identifier_name
tanh_shrink.py
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 #
# limitations under the License. import nnabla.functions as F def tanh_shrink_backward(inputs): """ Args: inputs (list of nn.Variable): Incomming grads/inputs to/of the forward function. kwargs (dict of arguments): Dictionary of the corresponding function arguments. Return: list of Va...
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
random_line_split
tanh_shrink.py
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # 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 # # Un...
""" Args: inputs (list of nn.Variable): Incomming grads/inputs to/of the forward function. kwargs (dict of arguments): Dictionary of the corresponding function arguments. Return: list of Variable: Return the gradients wrt inputs of the corresponding function. """ dy = inputs[0] x0...
identifier_body
from_primitive_int.rs
use malachite_base::num::basic::traits::One; use malachite_nz::natural::Natural; use Rational; macro_rules! impl_from_unsigned { ($t: ident) => { impl From<$t> for Rational { /// Converts a value to an `Integer`, where the value is of a primitive unsigned integer /// type. ...
/// /// # Examples /// See the documentation of the `conversion::from_primitive_int` module. #[inline] fn from(i: $t) -> Rational { Rational { sign: i >= 0, numerator: Natural::from(i.unsigned_abs()), ...
/// # Worst-case complexity /// Constant time and additional memory.
random_line_split
LabeledSelect.tsx
// // LESERKRITIKK v2 (aka Reader Critics) // Copyright (C) 2017 DB Medialab/Aller Media AS, Oslo, Norway // https://github.com/dbmedialab/reader-critics/ // // 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 ...
() { const { ID, value, onChange, name, label, options, chosen = true, defaultOptionText = '-- None --', disabled, } = this.props; return ( <div className="row"> <Label label={label} ID={ID} /> <div className="small-12 columns"> <select id={`${ID}-input`} v...
render
identifier_name
LabeledSelect.tsx
// // LESERKRITIKK v2 (aka Reader Critics) // Copyright (C) 2017 DB Medialab/Aller Media AS, Oslo, Norway // https://github.com/dbmedialab/reader-critics/ // // 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 ...
createSelectOptions (options: IOption[]) { return options.map((option, index) => ( <option value={option.value} key={option.value}>{option.name}</option> )); } render () { const { ID, value, onChange, name, label, options, chosen = true, defaultOptionText = '-- None --', disabl...
{ super(props); }
identifier_body
LabeledSelect.tsx
// // LESERKRITIKK v2 (aka Reader Critics) // Copyright (C) 2017 DB Medialab/Aller Media AS, Oslo, Norway // https://github.com/dbmedialab/reader-critics/ // // 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 ...
> {defaultOptionText && !chosen && <option value="">{defaultOptionText}</option> } {options.length && this.createSelectOptions(options)} </select> </div> </div> ); } }
disabled={ disabled }
random_line_split
setup.py
# 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
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # -*- coding: utf-8 -*- try: import setuptools except Imp...
# # Unless required by applicable law or agreed to in writing, software
random_line_split
defaults.ts
import { Observable } from 'rxjs'; import { ValidatorFn, AsyncValidatorFn } from '@angular/forms'; import { SECONDARY_PLACEHOLDER, PLACEHOLDER } from './core/constants/index'; import { TagInputDropdown } from './components/dropdown/tag-input-dropdown.component'; import { TagModel } from './core/accessor'; export inte...
blinkIfDupe: true, removable: true, editable: false, allowDupes: false, modelAsStrings: false, trimTags: true, ripple: true, tabIndex: '', disable: false, dragZone: '', onRemoving: undefined, onAdding: undefined, dis...
clearOnBlur: false, hideForm: false, addOnBlur: false, addOnPaste: false, pasteSplitPattern: ',',
random_line_split
defaults.ts
import { Observable } from 'rxjs'; import { ValidatorFn, AsyncValidatorFn } from '@angular/forms'; import { SECONDARY_PLACEHOLDER, PLACEHOLDER } from './core/constants/index'; import { TagInputDropdown } from './components/dropdown/tag-input-dropdown.component'; import { TagModel } from './core/accessor'; export inte...
(this: TagInputDropdown, value: string, target: TagModel): boolean { const targetValue = target[this.displayBy].toString(); return targetValue && targetValue .toLowerCase() .indexOf(value.toLowerCase()) >= 0; }
matchingFn
identifier_name
defaults.ts
import { Observable } from 'rxjs'; import { ValidatorFn, AsyncValidatorFn } from '@angular/forms'; import { SECONDARY_PLACEHOLDER, PLACEHOLDER } from './core/constants/index'; import { TagInputDropdown } from './components/dropdown/tag-input-dropdown.component'; import { TagModel } from './core/accessor'; export inte...
{ const targetValue = target[this.displayBy].toString(); return targetValue && targetValue .toLowerCase() .indexOf(value.toLowerCase()) >= 0; }
identifier_body
remote_process.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
else: args['env'] = None args['additional_args'] = request.additional_args protobuf_utils.get_protobuf_field(args, request, 'timeout') protobuf_utils.get_protobuf_field(args, request, 'terminate_before_kill') protobuf_utils.get_protobuf_field(args, request, 'terminate_wait_time') protobuf_utils.get_pr...
args['env'] = request.popen_args.env
conditional_block
remote_process.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
return response
"""Implementation of RunProcess.""" args = {} protobuf_utils.get_protobuf_field(args, request, 'cmdline') protobuf_utils.get_protobuf_field(args, request, 'current_working_directory') protobuf_utils.get_protobuf_field(args, request, 'timeout') protobuf_utils.get_protobuf_field(args, request, 'need_shell') ...
identifier_body
remote_process.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
return untrusted_runner_pb2.RunAndWaitResponse( result=process_result_to_proto(process_runner.run_and_wait(**args))) def run_process(request, _): """Implementation of RunProcess.""" args = {} protobuf_utils.get_protobuf_field(args, request, 'cmdline') protobuf_utils.get_protobuf_field(args, request, '...
random_line_split
remote_process.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
(request, _): """Implementation of RunProcess.""" args = {} protobuf_utils.get_protobuf_field(args, request, 'cmdline') protobuf_utils.get_protobuf_field(args, request, 'current_working_directory') protobuf_utils.get_protobuf_field(args, request, 'timeout') protobuf_utils.get_protobuf_field(args, request, '...
run_process
identifier_name
p069.rs
const N:usize = 1_000_000; fn prime(p:&mut [usize]) { for i in 2..N+1 { if p[i] != 0 { continue ; } for j in i..N+1 { if j*i > N { break; } p[j*i] = i; } } } fn
(p:&[usize], v:usize) -> f32 { let mut ps = Vec::new(); let mut vv = v; while p[vv] != 0 { let pr = p[vv]; ps.push(pr); while vv % pr == 0 { vv/=pr; } } if vv != 1 { ps.push(vv); } // print!("{} :",v); // for i in &ps { // print...
phi_n
identifier_name
p069.rs
const N:usize = 1_000_000; fn prime(p:&mut [usize]) { for i in 2..N+1 { if p[i] != 0 { continue ; } for j in i..N+1 { if j*i > N { break; } p[j*i] = i; } } } fn phi_n(p:&[usize], v:usize) -> f32 { let mut ps = ...
// print!("{} :",v); // for i in &ps { // print!("{} ",i); // } // println!(""); let mut cnt = v as i32; for i in 1..(1<<ps.len()) { let mut mulres = 1; let mut bitcnt = 1; for j in 0..ps.len() { if i & (1<<j) != 0 { mulres *= ps[j]; ...
{ ps.push(vv); }
conditional_block
p069.rs
const N:usize = 1_000_000; fn prime(p:&mut [usize]) { for i in 2..N+1 { if p[i] != 0 { continue ; } for j in i..N+1 { if j*i > N { break; } p[j*i] = i; } } } fn phi_n(p:&[usize], v:usize) -> f32 { let mut ps = ...
ans = (i,ret) } } println!("{:?}",ans); }
random_line_split
p069.rs
const N:usize = 1_000_000; fn prime(p:&mut [usize]) { for i in 2..N+1 { if p[i] != 0 { continue ; } for j in i..N+1 { if j*i > N { break; } p[j*i] = i; } } } fn phi_n(p:&[usize], v:usize) -> f32 { let mut ps = ...
{ let mut arr =[0 as usize;N+10]; prime(&mut arr); let mut ans = (1,2.0); for i in 2..N+1 { let ret = phi_n(&arr, i); if ret > ans.1 { ans = (i,ret) } } println!("{:?}",ans); }
identifier_body
api-parser.ts
.</p>`, pin: [ 'tensor', 'scalar', 'tensor1d', 'tensor2d', 'tensor3d', 'tensor4d' ] }, { name: 'Classes', description: `<p> This section shows the main Tensor related classes in deeplearn.js and the methods we expose on them. ...
{ if (!sourceFile.fileName.startsWith(repoPath)) { throw new Error( `Error: source file ${sourceFile.fileName} ` + `does not start with srcPath provided ${repoPath}.`); } const symbol = checker.getSymbolAtLocation(node.name); const type = checker.getTypeOfSymbolAtLocation(symbol...
identifier_body
api-parser.ts
, repoPath: string, githubRoot: string): {docs: Docs, docLinkAliases: {[symbolName: string]: string}} { if (!fs.existsSync(programRoot)) { throw new Error( `Program root ${programRoot} does not exist. Please run this script ` + `from the root of repository.`); } // Initialize the doc he...
ts.forEachChild( node, node => visitNode( docHeadings, subclassMethodMap, docTypeAliases, docLinkAliases, checker, node, sourceFile, srcRoot, repoPath, githubRoot)); } export function serializeClass( checker: ts.TypeChecker, node: ts.ClassDeclaration, docInfo: util.DocInfo, ...
{ const docAlias = util.getJsdoc(checker, node, DOCUMENTATION_TYPE_ALIAS); if (docAlias != null) { const symbol = checker.getSymbolAtLocation(node.name); docTypeAliases[symbol.getName()] = docAlias; } }
conditional_block
api-parser.ts
string, repoPath: string, githubRoot: string): {docs: Docs, docLinkAliases: {[symbolName: string]: string}} { if (!fs.existsSync(programRoot)) { throw new Error( `Program root ${programRoot} does not exist. Please run this script ` + `from the root of repository.`); } // Initialize the...
// You can't use both doc link aliases and @doc decorators. if (docInfo != null && docLinkAlias != null) { throw new Error( `Class ${node.name.getText()} has both a ` + `doc link alias and a doc decorator.`); } } else if ( ts.isInterfaceDeclaration(node) || ts.isTypeAliasD...
}
random_line_split
api-parser.ts
string, repoPath: string, githubRoot: string): {docs: Docs, docLinkAliases: {[symbolName: string]: string}} { if (!fs.existsSync(programRoot)) { throw new Error( `Program root ${programRoot} does not exist. Please run this script ` + `from the root of repository.`); } // Initialize the...
( docHeadings: DocHeading[], subclassMethodMap: {[subclass: string]: DocFunction[]}, docTypeAliases: {[type: string]: string}, docLinkAliases: {[symbolName: string]: string}, checker: ts.TypeChecker, node: ts.Node, sourceFile: ts.SourceFile, srcRoot: string, repoPath: string, githubRoot: string)...
visitNode
identifier_name
log-knows-the-names-of-variants-in-std.rs
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
check_log(exp, x); }
x = None; let exp = "None".to_string(); let act = format!("{:?}", x); assert_eq!(act, exp);
random_line_split
log-knows-the-names-of-variants-in-std.rs
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
<T>(exp: String, v: T) { assert_eq!(exp, format!("{:?}", v)); } pub fn main() { let mut x = Some(a(22u)); let exp = "Some(a(22u))".to_string(); let act = format!("{:?}", x); assert_eq!(act, exp); check_log(exp, x); x = None; let exp = "None".to_string(); let act = format!("{:?}", x...
check_log
identifier_name
liveness-use-after-send.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.
// option. This file may not be copied, modified, or distributed // except according to those terms. extern crate debug; fn send<T:Send>(ch: _chan<T>, data: T) { println!("{:?}", ch); println!("{:?}", data); fail!(); } struct _chan<T>(int); // Tests that "log(debug, message);" is flagged as using // mes...
// // 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 http://opensource.org/licenses/MIT>, at your
random_line_split
liveness-use-after-send.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 ...
fn main() { fail!(); }
{ send(ch, message); println!("{:?}", message); //~ ERROR use of moved value: `message` }
identifier_body
liveness-use-after-send.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 ...
<T:Send>(ch: _chan<T>, data: T) { println!("{:?}", ch); println!("{:?}", data); fail!(); } struct _chan<T>(int); // Tests that "log(debug, message);" is flagged as using // message after the send deinitializes it fn test00_start(ch: _chan<Box<int>>, message: Box<int>, _count: Box<int>) { send(ch, mess...
send
identifier_name
index.ts
/* MIT License Copyright (c) 2022 Looker Data Sciences, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modi...
export * from './components' export * from './design-tokens' export * from './icons'
random_line_split
badgereg.js
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 3 of the License, or // (at your option) any la...
(certifier, address) { if (!this.contracts[certifier]) { this.contracts[certifier] = this._api.newContract(ABI, certifier); } const contract = this.contracts[certifier]; return contract.instance.certified.call({}, [address]); } }
checkIfCertified
identifier_name
badgereg.js
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 3 of the License, or // (at your option) any la...
return contract.instance.certified.call({}, [address]); } }
checkIfCertified (certifier, address) { if (!this.contracts[certifier]) { this.contracts[certifier] = this._api.newContract(ABI, certifier); } const contract = this.contracts[certifier];
random_line_split
badgereg.js
// Copyright 2015, 2016 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 3 of the License, or // (at your option) any la...
const contract = this.contracts[certifier]; return contract.instance.certified.call({}, [address]); } }
{ this.contracts[certifier] = this._api.newContract(ABI, certifier); }
conditional_block
ui-password-meter.ts
/** * @author : Adarsh Pastakia * @version : 5.0.0 * @copyright : 2019 * @license : MIT */ import { bindable, computedFrom, customElement, inlineView } from "aurelia-framework"; @customElement("ui-password-meter") @inlineView( `<template class="ui-password-meter" css.bind="strength" ui-tooltip.bind="tool...
() { if (this.hasPassword) { const s = (this.score / this.maxStrength) * 100; return { "--password-strength": `${s || 5}%` }; } return { "--password-strength": 0 }; } }
strength
identifier_name
ui-password-meter.ts
/** * @author : Adarsh Pastakia * @version : 5.0.0 * @copyright : 2019 * @license : MIT */ import { bindable, computedFrom, customElement, inlineView } from "aurelia-framework"; @customElement("ui-password-meter") @inlineView( `<template class="ui-password-meter" css.bind="strength" ui-tooltip.bind="tool...
return { "--password-strength": 0 }; } }
{ const s = (this.score / this.maxStrength) * 100; return { "--password-strength": `${s || 5}%` }; }
conditional_block
ui-password-meter.ts
/** * @author : Adarsh Pastakia * @version : 5.0.0 * @copyright : 2019 * @license : MIT */ import { bindable, computedFrom, customElement, inlineView } from "aurelia-framework"; @customElement("ui-password-meter") @inlineView( `<template class="ui-password-meter" css.bind="strength" ui-tooltip.bind="tool...
public score: number = 0; @bindable() public hasPassword: boolean = false; @bindable() public tooltip: string = ""; @bindable() public maxStrength: number = 4; @computedFrom("score", "maxStrength", "hasPassword") get strength() { if (this.hasPassword) { const s = (this.score / this.maxStre...
) export class UIPasswordMeter { @bindable()
random_line_split
htmlframesetelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFr...
}
{ self.htmlelement.reflector() }
identifier_body
htmlframesetelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFr...
(localName: DOMString, document: &JSRef<Document>) -> Temporary<HTMLFrameSetElement> { let element = HTMLFrameSetElement::new_inherited(localName, document); Node::reflect_node(box element, document, HTMLFrameSetElementBinding::Wrap) } } pub trait HTMLFrameSetElementMethods { } impl Reflectable fo...
new
identifier_name
htmlframesetelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLFrameSetElementBinding; use dom::bindings::codegen::InheritTypes::HTMLFr...
#[deriving(Encodable)] pub struct HTMLFrameSetElement { pub htmlelement: HTMLElement } impl HTMLFrameSetElementDerived for EventTarget { fn is_htmlframesetelement(&self) -> bool { self.type_id == NodeTargetTypeId(ElementNodeTypeId(HTMLFrameSetElementTypeId)) } } impl HTMLFrameSetElement { pub ...
use dom::htmlelement::HTMLElement; use dom::node::{Node, ElementNodeTypeId}; use servo_util::str::DOMString;
random_line_split
test_sql_files.py
# -*- coding: utf-8 -*- import pytest from .utils import last_activity @pytest.mark.usefixtures('versioning_manager', 'table_creator') class TestActivityCreationWithColumnExclusion(object): @pytest.fixture def audit_trigger_creator(self, session, user_class): session.execute( '''SELECT au...
user.age = 18 session.flush() activity = last_activity(session) assert activity['changed_data'] == {'name': 'Luke'} assert activity['old_data'] == { 'id': user.id, 'name': 'John', } assert activity['table_name'] == 'user' assert act...
user.name = 'Luke'
random_line_split
test_sql_files.py
# -*- coding: utf-8 -*- import pytest from .utils import last_activity @pytest.mark.usefixtures('versioning_manager', 'table_creator') class TestActivityCreationWithColumnExclusion(object): @pytest.fixture def audit_trigger_creator(self, session, user_class): session.execute( '''SELECT au...
(self, user, session): session.delete(user) session.flush() activity = last_activity(session) assert activity['changed_data'] == {} assert activity['old_data'] == { 'id': user.id, 'name': 'John', } assert activity['table_name'] == 'user' ...
test_delete
identifier_name
test_sql_files.py
# -*- coding: utf-8 -*- import pytest from .utils import last_activity @pytest.mark.usefixtures('versioning_manager', 'table_creator') class TestActivityCreationWithColumnExclusion(object): @pytest.fixture def audit_trigger_creator(self, session, user_class): session.execute( '''SELECT au...
session.delete(user) session.flush() activity = last_activity(session) assert activity['changed_data'] == {} assert activity['old_data'] == { 'id': user.id, 'name': 'John', } assert activity['table_name'] == 'user' assert activity['native_t...
identifier_body
jwtAuth.js
(function (define) { 'use strict'; define(function (require) { var interceptor; interceptor = require('rest/interceptor'); /** * Authenticates the request using JWT Authentication * * @param {Client} [client] client to wrap * @param {Object} config * * @returns {Client} */ return inte...
if (response.entity && response.entity.token && response.entity.token.length > 10) { localStorage.setItem('jwt-token', 'Bearer ' + response.entity.token); } return response; } }); }); }( typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(requir...
{ localStorage.setItem('jwt-token', response.headers.Authorization) }
conditional_block
jwtAuth.js
(function (define) { 'use strict'; define(function (require) { var interceptor; interceptor = require('rest/interceptor'); /** * Authenticates the request using JWT Authentication *
* @param {Object} config * * @returns {Client} */ return interceptor({ request: function (request, config) { var token, headers; token = localStorage.getItem('jwt-token'); headers = request.headers || (request.headers = {}); if ( token !== null && token !== 'undefined') { headers...
* @param {Client} [client] client to wrap
random_line_split
size_hint.rs
#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::option::Iter; // #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] // #[stable(feature = "rust1", since = "1.0.0")] // pub enum Option<T> { // /// No value // #[stable(feature = "rust1", since = "...
// type Item = &'a A; // // #[inline] // fn next(&mut self) -> Option<&'a A> { self.inner.next() } // #[inline] // fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() } // } type T = u32; #[test] fn size_hint_test1() { let x: Option<T> = ...
// impl<'a, A> Iterator for Iter<'a, A> {
random_line_split
size_hint.rs
#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::option::Iter; // #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] // #[stable(feature = "rust1", since = "1.0.0")] // pub enum Option<T> { // /// No value // #[stable(feature = "rust1", since = "...
#[test] fn size_hint_test2() { let x: Option<T> = None::<T>; let iter: Iter<T> = x.iter(); let (lower, upper): (usize, Option<usize>) = iter.size_hint(); assert_eq!(lower, 0); assert_eq!(upper, Some::<usize>(0)); } }
{ let x: Option<T> = Some::<T>(7); let iter: Iter<T> = x.iter(); let (lower, upper): (usize, Option<usize>) = iter.size_hint(); assert_eq!(lower, 1); assert_eq!(upper, Some::<usize>(1)); }
identifier_body
size_hint.rs
#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::option::Iter; // #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] // #[stable(feature = "rust1", since = "1.0.0")] // pub enum Option<T> { // /// No value // #[stable(feature = "rust1", since = "...
() { let x: Option<T> = None::<T>; let iter: Iter<T> = x.iter(); let (lower, upper): (usize, Option<usize>) = iter.size_hint(); assert_eq!(lower, 0); assert_eq!(upper, Some::<usize>(0)); } }
size_hint_test2
identifier_name
testCombined.py
from __future__ import print_function from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.PyMol import MolViewer from rdkit.Chem.Subshape import SubshapeBuilder,SubshapeObjects,SubshapeAligner from rdkit.six.moves import cPickle import copy m1 = Chem.MolFromMolFile('test_data/square1.mol') m2 = Chem....
else: s1 = cPickle.load(file('test_data/square1.shp.pkl','rb')) s2 = cPickle.load(file('test_data/square2.shp.pkl','rb')) #ns1 = cPickle.load(file('test_data/combined.shp.pkl','rb')) ns1=cPickle.load(file('test_data/combined.shp.pkl','rb')) v = MolViewer() SubshapeObjects.DisplaySubshape(v,s1,'shape1') Subsha...
print('m1:') s1 = b.GenerateSubshapeShape(m1) cPickle.dump(s1,file('test_data/square1.shp.pkl','wb+')) print('m2:') s2 = b.GenerateSubshapeShape(m2) cPickle.dump(s2,file('test_data/square2.shp.pkl','wb+')) ns1 = b.CombineSubshapes(s1,s2) b.GenerateSubshapeSkeleton(ns1) cPickle.dump(ns1,file('test_data/c...
conditional_block
testCombined.py
from __future__ import print_function from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem.PyMol import MolViewer from rdkit.Chem.Subshape import SubshapeBuilder,SubshapeObjects,SubshapeAligner from rdkit.six.moves import cPickle import copy m1 = Chem.MolFromMolFile('test_data/square1.mol') m2 = Chem....
fName = tempfile.mktemp('.grd') Geometry.WriteGridToFile(ns1.coarseGrid.grid,fName) v.server.loadSurface(fName,'coarse','',2.5) os.unlink(fName) fName = tempfile.mktemp('.grd') Geometry.WriteGridToFile(ns1.medGrid.grid,fName) v.server.loadSurface(fName,'med','',2.5) os.unlink(fName)
print(len(algs)) print(pruneStats) import os,tempfile from rdkit import Geometry
random_line_split
job-view.component.ts
import { Component, OnInit } from '@angular/core'; import { Response } from '@angular/http'; import {ActivatedRoute, Params} from "@angular/router"; import { Title } from '@angular/platform-browser'; import 'rxjs/add/operator/switchMap'; import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/map'; import {Job...
} }); this.currentSubJobsService.getCurrentSubJobs().subscribe((jobs: SubJob[]) => { this.subJobs = jobs; }); } }
{ this.titleService.setTitle('Comrade - Job view'); let jobStream = this.route.params .do((params: Params) => this.tab = params['tab']) .switchMap((params: Params) => { this.currentJobService.change(params['id']); return this.currentJobService.getCurrentJob(); ...
identifier_body
job-view.component.ts
import { Component, OnInit } from '@angular/core'; import { Response } from '@angular/http'; import {ActivatedRoute, Params} from "@angular/router"; import { Title } from '@angular/platform-browser'; import 'rxjs/add/operator/switchMap'; import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/map'; import {Job...
}); this.currentSubJobsService.getCurrentSubJobs().subscribe((jobs: SubJob[]) => { this.subJobs = jobs; }); } }
{ this.httpService.post('/api/get-dependent-jobs', new GetDependentJobs(job.id)) .map((res: Response) => res.json() as GetDependentJobsResult) .subscribe((result: GetDependentJobsResult) => { this.dependentJobs = result.jobs; }) }
conditional_block
job-view.component.ts
import { Component, OnInit } from '@angular/core'; import { Response } from '@angular/http'; import {ActivatedRoute, Params} from "@angular/router"; import { Title } from '@angular/platform-browser'; import 'rxjs/add/operator/switchMap'; import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/map'; import {Job...
(): void { this.titleService.setTitle('Comrade - Job view'); let jobStream = this.route.params .do((params: Params) => this.tab = params['tab']) .switchMap((params: Params) => { this.currentJobService.change(params['id']); return this.currentJobService.getCurren...
ngOnInit
identifier_name
job-view.component.ts
import { Component, OnInit } from '@angular/core'; import { Response } from '@angular/http'; import {ActivatedRoute, Params} from "@angular/router"; import { Title } from '@angular/platform-browser'; import 'rxjs/add/operator/switchMap'; import 'rxjs/add/operator/filter'; import 'rxjs/add/operator/map'; import {Job...
}
}
random_line_split
popup.js
// Table row template with placeholders var ordersRowTemplate = '<tr><td><img class="order-status-icon" title="order_status_title" src="order_status_icon"></td><td><p class="order-number">Narudžba <strong>#order_number</strong> by</p><p class="first-last-name">order_name</p><p><a class="email" href="mailto:order_email...
return target.replace(new RegExp(search, 'g'), replacement); }; // Loads saved data from chrome storage function loadOrdersFromStorage() { chrome.storage.local.get( 'allOrders', function (result) { insertData(result); }); } // Manipulate loaded data and insert it into template/HTML func...
//------------------------------------------------------ // For replacing all string instances in the template String.prototype.replaceAll = function(search, replacement) { var target = this;
random_line_split
popup.js
// Table row template with placeholders var ordersRowTemplate = '<tr><td><img class="order-status-icon" title="order_status_title" src="order_status_icon"></td><td><p class="order-number">Narudžba <strong>#order_number</strong> by</p><p class="first-last-name">order_name</p><p><a class="email" href="mailto:order_email...
function processingOrder(url, id){ changeOrderStatus('jconfig.json', url, {status: "processing"}); } function viewOrder(viewURL, id){ var win = window.open(viewURL, '_blank'); win.focus(); } //-------------------------------------------------------------------- // GET REQUEST TO SERVER //------------...
changeOrderStatus('jconfig.json', url, {status: "completed"}); }
identifier_body
popup.js
// Table row template with placeholders var ordersRowTemplate = '<tr><td><img class="order-status-icon" title="order_status_title" src="order_status_icon"></td><td><p class="order-number">Narudžba <strong>#order_number</strong> by</p><p class="first-last-name">order_name</p><p><a class="email" href="mailto:order_email...
) { chrome.storage.sync.get( 'options', function (items) { let URL = "https://" + items.options.siteURL + "/wp-json/wc/v2/orders/?consumer_key=" + items.options.consumerKey + "&consumer_secret=" + items.options.consumerSecret; loadJSON('jconfig.json', URL, function saveJ...
eloadItems(
identifier_name
read_rgb.py
import json from PIL import Image import collections with open('../config/nodes.json') as data_file: nodes = json.load(data_file) # empty fucker ordered_nodes = [None] * len(nodes) # populate fucker for i, pos in nodes.items(): ordered_nodes[int(i)] = [pos['x'], pos['y']] filename = "04_rgb_vertical_lines" i...
"meta": {}, "data": data }, outfile) print im.size #Get the width and hight of the image for iterating over #print pix[,y] #Get the RGBA Value of the a pixel of an image
with open(filename+'.json', 'w') as outfile: json.dump({
random_line_split
read_rgb.py
import json from PIL import Image import collections with open('../config/nodes.json') as data_file: nodes = json.load(data_file) # empty fucker ordered_nodes = [None] * len(nodes) # populate fucker for i, pos in nodes.items(): ordered_nodes[int(i)] = [pos['x'], pos['y']] filename = "04_rgb_vertical_lines" i...
frame_num+=1 except EOFError: pass # end of sequence #print data #print r, g, b with open(filename+'.json', 'w') as outfile: json.dump({ "meta": {}, "data": data }, outfile) print im.size #Get the width and hight of the image for iterating over #print pix[,y] #Get the RGBA Value of the...
im.seek(frame_num) frame_data = [] # do something to im img = im.convert('RGB') if resize == True: print "Resizing" img.thumbnail(target_size, Image.ANTIALIAS) for x, y in ordered_nodes: frame_data.append(img.getpixel((x, y))) #print r, g, b data.append(frame_data) ...
conditional_block
15.4.4.15-8-a-12.js
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// ...
test: function testcase() { var arr = [1, 2, 3, 4]; Object.defineProperty(arr, "1", { get: function () { return "6.99"; }, configurable: true }); Object.defineProperty(arr, "3", { get: function () { ...
path: "TestCases/chapter15/15.4/15.4.4/15.4.4.15/15.4.4.15-8-a-12.js", description: "Array.prototype.lastIndexOf - test that deleting own property causes it not to be visited on an Array",
random_line_split
optional.d.ts
/** @hidden */ interface Option<V> { getOrElse(arg: V): V; get(): V; filter(f: (value: V) => boolean): Option<V>; map<V2>(f: (value: V) => V2): Option<V2>; forEach(f: (value: V) => any): void; isDefined: boolean; toArray(): V[]; inspect(): string; toString(): string; } /** @hidden */...
<V> implements Option<V> { value: V; constructor(value: V); _isSome: boolean; getOrElse(arg: V): V; get(): V; filter(f: (value: V) => boolean): Option<V>; map<V2>(f: (value: V) => V2): Option<V2>; forEach(f: (value: V) => any): void; isDefined: boolean; toArray(): V[]; inspec...
Some
identifier_name
optional.d.ts
/** @hidden */ interface Option<V> { getOrElse(arg: V): V; get(): V; filter(f: (value: V) => boolean): Option<V>; map<V2>(f: (value: V) => V2): Option<V2>;
forEach(f: (value: V) => any): void; isDefined: boolean; toArray(): V[]; inspect(): string; toString(): string; } /** @hidden */ declare class Some<V> implements Option<V> { value: V; constructor(value: V); _isSome: boolean; getOrElse(arg: V): V; get(): V; filter(f: (value: V...
random_line_split
Layer.Hosted.Example.tsx
import * as React from 'react'; import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; import { Layer, LayerHost } from 'office-ui-fabric-react/lib/Layer'; import { Toggle } from 'office-ui-fabric-react/lib/Toggle'; import './Layer.Example.scss'; export class LayerHostedExample extends React.Component<any, an...
public render() { let { showLayer, showHost} = this.state; let content = ( <div className='LayerExample-content ms-u-scaleUpIn100'> This is example layer content. </div> ); return ( <div> <Toggle label='Show host' checked={ showHost } ...
{ super(); this.state = { showLayer: false, showHost: true }; }
identifier_body
Layer.Hosted.Example.tsx
import * as React from 'react'; import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; import { Layer, LayerHost } from 'office-ui-fabric-react/lib/Layer'; import { Toggle } from 'office-ui-fabric-react/lib/Toggle'; import './Layer.Example.scss'; export class LayerHostedExample extends React.Component<any, an...
() { super(); this.state = { showLayer: false, showHost: true }; } public render() { let { showLayer, showHost} = this.state; let content = ( <div className='LayerExample-content ms-u-scaleUpIn100'> This is example layer content. </div> ); return ( ...
constructor
identifier_name
Layer.Hosted.Example.tsx
import * as React from 'react'; import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox'; import { Layer, LayerHost } from 'office-ui-fabric-react/lib/Layer'; import { Toggle } from 'office-ui-fabric-react/lib/Toggle'; import './Layer.Example.scss'; export class LayerHostedExample extends React.Component<any, an...
}
); }
random_line_split
remove_unwanted_files.py
""" Workaround for a conda-build bug where failing to compile some Python files results in a build failure. See https://github.com/conda/conda-build/issues/1001 """ import os import sys py2_only_files = [] py3_only_files = [ 'numba/tests/annotation_usecases.py', ] def remove_files(basedir): """ R...
if __name__ == "__main__": remove_files('.')
path = os.path.join(basedir, relpath) print("Removing %s %r" % (msg, relpath)) os.remove(path)
random_line_split
remove_unwanted_files.py
""" Workaround for a conda-build bug where failing to compile some Python files results in a build failure. See https://github.com/conda/conda-build/issues/1001 """ import os import sys py2_only_files = [] py3_only_files = [ 'numba/tests/annotation_usecases.py', ] def remove_files(basedir): """ R...
else: removelist = py3_only_files msg = "Python 3-only file" for relpath in removelist: path = os.path.join(basedir, relpath) print("Removing %s %r" % (msg, relpath)) os.remove(path) if __name__ == "__main__": remove_files('.')
removelist = py2_only_files msg = "Python 2-only file"
conditional_block
remove_unwanted_files.py
""" Workaround for a conda-build bug where failing to compile some Python files results in a build failure. See https://github.com/conda/conda-build/issues/1001 """ import os import sys py2_only_files = [] py3_only_files = [ 'numba/tests/annotation_usecases.py', ] def remove_files(basedir):
if __name__ == "__main__": remove_files('.')
""" Remove unwanted files from the current source tree """ if sys.version_info >= (3,): removelist = py2_only_files msg = "Python 2-only file" else: removelist = py3_only_files msg = "Python 3-only file" for relpath in removelist: path = os.path.join(basedir, ...
identifier_body
remove_unwanted_files.py
""" Workaround for a conda-build bug where failing to compile some Python files results in a build failure. See https://github.com/conda/conda-build/issues/1001 """ import os import sys py2_only_files = [] py3_only_files = [ 'numba/tests/annotation_usecases.py', ] def
(basedir): """ Remove unwanted files from the current source tree """ if sys.version_info >= (3,): removelist = py2_only_files msg = "Python 2-only file" else: removelist = py3_only_files msg = "Python 3-only file" for relpath in removelist: path = os.path...
remove_files
identifier_name
DEPRECATED_testSolutions.py
#!/usr/bin/python import sys import CoolProp.CoolProp as cp import numpy as np def props(in1=None, in2=None, in3=None, in4=None, in5=None, in6=None):
#print "{0:14.8f}".format(CP.Props('V','D',13,'P',500,'n-Pentane')) #print "{0:14.8f}".format(CP.Props('V','H',158,'P',1000,'TX22')) #T = 300 T = float(sys.argv[1])+273.15 P = float(sys.argv[2])*1e5 print "Temperature: "+str(T-273.15)+" C" print "Pressure: "+str(P/1e5)+" bar" print Melinder = ["MEG", "MPG", "MEA",...
try: return cp.PropsU(in1=in1,in2=in2,in3=in3,in4=in4,in5=in5,in6=in6,in7="SI") except ValueError as ve: #print "Error in CoolProp, try adjusting the fluid or T and p:" print ve return -1.0*np.NAN
identifier_body
DEPRECATED_testSolutions.py
#!/usr/bin/python import sys import CoolProp.CoolProp as cp import numpy as np def props(in1=None, in2=None, in3=None, in4=None, in5=None, in6=None): try: return cp.PropsU(in1=in1,in2=in2,in3=in3,in4=in4,in5=in5,in6=in6,in7="SI") except ValueError as ve: #print "Error in CoolProp, try adjusting...
#fluids.extend(Melinder) #fluids.extend(SecCool) fluids.extend(Other) for fluid in fluids: print "Fluid: "+str(fluid) try: print "Density: "+"{0:14.8f} kg/m3 ".format(props('D','T',T,'P',P,fluid+'-20%')) print "Heat cap.: "+"{0:14.8f} kJ/kg/K".format(props('C','T',T,'P',P,fluid+'-20%')/1e...
Other = ["LiBr"] fluids = []
random_line_split
DEPRECATED_testSolutions.py
#!/usr/bin/python import sys import CoolProp.CoolProp as cp import numpy as np def props(in1=None, in2=None, in3=None, in4=None, in5=None, in6=None): try: return cp.PropsU(in1=in1,in2=in2,in3=in3,in4=in4,in5=in5,in6=in6,in7="SI") except ValueError as ve: #print "Error in CoolProp, try adjusting...
print "Fluid: "+str(fluid) try: print "Density: "+"{0:14.8f} kg/m3 ".format(props('D','T',T,'P',P,fluid+'-20%')) print "Heat cap.: "+"{0:14.8f} kJ/kg/K".format(props('C','T',T,'P',P,fluid+'-20%')/1e3) print "Th. cond.: "+"{0:14.8f} W/m/K ".format(props('L','T',T,'P',P,fluid+'-20%')) ...
conditional_block
DEPRECATED_testSolutions.py
#!/usr/bin/python import sys import CoolProp.CoolProp as cp import numpy as np def
(in1=None, in2=None, in3=None, in4=None, in5=None, in6=None): try: return cp.PropsU(in1=in1,in2=in2,in3=in3,in4=in4,in5=in5,in6=in6,in7="SI") except ValueError as ve: #print "Error in CoolProp, try adjusting the fluid or T and p:" print ve return -1.0*np.NAN #print "{0:14.8f}".fo...
props
identifier_name
common.rs
Error { errno: isize, } impl SysError { pub fn new(errno: isize) -> SysError { SysError { errno: errno } } pub fn mux(result: Result<usize, SysError>) -> usize { match result { Ok(value) => value, Err(error) => -error.errno as usize }...
(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { f.write_str(self.text()) } } pub const EPERM: isize = 1; /* Operation not permitted */ pub const ENOENT: isize = 2; /* No such file or directory */ pub const ESRCH: isize = 3; /* No such process */ pub const EINTR: isize = 4; /* Interrupted sy...
fmt
identifier_name
common.rs
pub const ENOTDIR: isize = 20; /* Not a directory */ pub const EISDIR: isize = 21; /* Is a directory */ pub const EINVAL: isize = 22; /* Invalid argument */ pub const ENFILE: isize = 23; /* File table overflow */ pub const EMFILE: isize = 24; /* Too many open files */ pub const ENOTTY: isize = 25; /* Not a typewr...
pub const EMEDIUMTYPE: isize = 124; /* Wrong medium type */ pub const ECANCELED: isize = 125; /* Operation Canceled */
random_line_split
common.rs
{ errno: isize, } impl SysError { pub fn new(errno: isize) -> SysError { SysError { errno: errno } } pub fn mux(result: Result<usize, SysError>) -> usize { match result { Ok(value) => value, Err(error) => -error.errno as usize } ...
} impl fmt::Display for SysError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { f.write_str(self.text()) } } pub const EPERM: isize = 1; /* Operation not permitted */ pub const ENOENT: isize = 2; /* No such file or directory */ pub const ESRCH: isize = 3; /* No such process */...
{ f.write_str(self.text()) }
identifier_body
Sprite.ts
/** * The GameObject namespace holds classes which are designed to be added to a State (either directly, or as an ancestor of a Group) and are the Objects that are used when wanting to render anything visual onto the current State. Each GameObject is a representation of a particular item in a game and as such has infor...
(camera:Kiwi.Camera) { super.render(camera); //if it is would even be visible. if (this.alpha > 0) { var ctx: CanvasRenderingContext2D = this.game.stage.ctx; ctx.save(); if (this.alpha > 0 && t...
render
identifier_name
Sprite.ts
/** * The GameObject namespace holds classes which are designed to be added to a State (either directly, or as an ancestor of a Group) and are the Objects that are used when wanting to render anything visual onto the current State. Each GameObject is a representation of a particular item in a game and as such has infor...
} /** * Renders the GameObject using WebGL. * @method renderGL * @param {WebGLRenderingContext} gl * @param {Kiwi.Camera} camera * @param {Object} params * @public */ public renderGL(gl: WebGLRenderingContext, camera: Kiwi.Camera, param...
{ var ctx: CanvasRenderingContext2D = this.game.stage.ctx; ctx.save(); if (this.alpha > 0 && this.alpha <= 1) { ctx.globalAlpha = this.alpha; } //get entity/view matrix var t: Kiwi.Geom...
conditional_block
Sprite.ts
/** * The GameObject namespace holds classes which are designed to be added to a State (either directly, or as an ancestor of a Group) and are the Objects that are used when wanting to render anything visual onto the current State. Each GameObject is a representation of a particular item in a game and as such has infor...
} } }
* @public */ public renderGL(gl: WebGLRenderingContext, camera: Kiwi.Camera, params: any = null) { (<Kiwi.Renderers.TextureAtlasRenderer>this.glRenderer).addToBatch(gl, this, camera);
random_line_split
Sprite.ts
/** * The GameObject namespace holds classes which are designed to be added to a State (either directly, or as an ancestor of a Group) and are the Objects that are used when wanting to render anything visual onto the current State. Each GameObject is a representation of a particular item in a game and as such has infor...
var cell = this.atlas.cells[this.cellIndex]; ctx.drawImage(this.atlas.image, cell.x, cell.y, cell.w, cell.h, -t.rotPointX, -t.rotPointY, cell.w, cell.h); ctx.restore(); } } /** * Renders the GameObject using...
{ super.render(camera); //if it is would even be visible. if (this.alpha > 0) { var ctx: CanvasRenderingContext2D = this.game.stage.ctx; ctx.save(); if (this.alpha > 0 && this.alpha <= 1) { ...
identifier_body
numpy-examples.py
import numpy as np # Inner (or dot) product a = np.array([1,2]) b = np.array([3,4]) np.inner(a, b) a.dot(b) # Outer product a = np.array([1,2]) b = np.array([3,4]) np.outer(a, b) # Inverse m = np.array([[1,2], [3,4]]) np.linalg.inv(m) # Inner (or dot) product m = np.array([[1,2], [3,4]]) minv = np.linalg.inv(m) m....
np.linalg.solve(a, b)
b = np.array( [ 2200, 5050] )
random_line_split
misc.js
/** * The MIT License (MIT) * * Copyright (c) 2015 Sébastien CAPARROS (GlitchyVerse) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
/** * Returns the euler rotation from a Quaternion * @param quat The rotation quaternion * @return vec3 The euler angles */ /*function quatToEuler(q) { var x = q[0], y = q[1], z = q[2], w = q[3]; return vec3.fromValues( Math.atan2( 2 * (y * z + w * x), w * w - x * x - y * y + z * z), Math.asin (-2 * (x * z -...
return (radians * 180) / Math.PI; }
identifier_body
misc.js
/** * The MIT License (MIT) * * Copyright (c) 2015 Sébastien CAPARROS (GlitchyVerse) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
Math.atan2( 2 * (y * z + w * x), w * w - x * x - y * y + z * z), Math.asin (-2 * (x * z - w * y)), Math.atan2( 2 * (x * y + w * z), w * w + x * x - y * y - z * z) ); }*/ /** * Returns the quaternion rotation from a vec3 (euler) * @param vec3 The euler rotation vector (degrees) * @return quat The quaternion ...
*/ /*function quatToEuler(q) { var x = q[0], y = q[1], z = q[2], w = q[3]; return vec3.fromValues(
random_line_split
misc.js
/** * The MIT License (MIT) * * Copyright (c) 2015 Sébastien CAPARROS (GlitchyVerse) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
} // TODO make windows movable to the left, but always seeing the title bar // TODO dynamic size of window for small screens ? /** * Draws an image as a tile, as many times needed to cover the given surface * @param CanvasRenderingContext2D The context where to draw image * @param Image The image to draw * @param...
container.innerHTML = s; }
conditional_block
misc.js
/** * The MIT License (MIT) * * Copyright (c) 2015 Sébastien CAPARROS (GlitchyVerse) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
point, rotation) { var cos = [Math.cos(rotation[0]), Math.cos(rotation[1]), Math.cos(rotation[2])]; var sin = [Math.sin(rotation[0]), Math.sin(rotation[1]), Math.sin(rotation[2])]; // Temp vars var p0, p1, p2; // Rotating X p1 = point[1] * cos[0] + point[2] * sin[0]; p2 = point[2] * cos[0] - point[1] * sin[0...
otatePoint(
identifier_name
MUIDetailView.tsx
import * as React from 'react'; import { withStyles, WithStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import { IDetailViewProps } from 'rev-ui/lib/views/DetailView'; const styles = { root: { width: '100%' } }; type IMUIDetailViewProps = IDetailViewProps & With...
);
}
random_line_split
MUIDetailView.tsx
import * as React from 'react'; import { withStyles, WithStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import { IDetailViewProps } from 'rev-ui/lib/views/DetailView'; const styles = { root: { width: '100%' } }; type IMUIDetailViewProps = IDetailViewProps & Wit...
} );
{ return ( <form onSubmit={this.handleSubmit} style={this.props.style}> <Grid container spacing={8}> {this.props.children} </Grid> </form> ); }
identifier_body
MUIDetailView.tsx
import * as React from 'react'; import { withStyles, WithStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import { IDetailViewProps } from 'rev-ui/lib/views/DetailView'; const styles = { root: { width: '100%' } }; type IMUIDetailViewProps = IDetailViewProps & Wit...
(props: IMUIDetailViewProps) { super(props); this.handleSubmit.bind(this); } handleSubmit(e: React.FormEvent<HTMLFormElement>) { e.preventDefault(); } render() { return ( <form onSubmit={this.handleSubmit} style={this.prop...
constructor
identifier_name
addBzptCms.js
/** * cms 新增js */ $(document).ready(function(){ // 数据回显 if(bzptCmsId){ intaddBzptCms(bzptCmsId); } //保存 $("#btn_save").on("click",function(){ addBzptCms.saveData(); }); // //确认 // $("#btn_affirm").on("click",function(){ // addArchives.affirmData(); // }); //返回 $("#btn_back").on("click",function(...
content : content, cmsType : cmsType, title : title }, dataType:"json", type:"post", success:function(res){ if(res.flag){ layer.alert("保存成功!",function(){ // window.history.go(-1); //location.href = ctxManager + '/bzptCms/listBzptCms'; window.parent.OptApi.closeNowTab();...
data:{ id : bzptCmsId,
random_line_split
addBzptCms.js
/** * cms 新增js */ $(document).ready(function(){ // 数据回显 if(bzptCmsId){ intaddBzptCms(bzptCmsId); } //保存 $("#btn_save").on("click",function(){ addBzptCms.saveData(); }); // //确认 // $("#btn_affirm").on("click",function(){ // addArchives.affirmData(); // }); //返回 $("#btn_back").on("click",function(...
+"/bzptCms/getDetail", data:{id : id}, dataType:"json", type:"post", success:function(res){ if(res.flag){ if(res.bzptCms){ var bzptCms = res.bzptCms; var content = bzptCms.content; $('.summernote').code(content); $('#cms_type').val(bzptCms.cmsType); $('#title').val(bzptCms.title...
rl:ctxManager
identifier_name