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 |
|---|---|---|---|---|
utils.ts | /*
* SonarQube | * Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your optio... | random_line_split | |
utils.ts | /*
* SonarQube
* Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, o... |
return convertToPermissionDefinition(permission, l10nPrefix);
});
}
export function isPermissionDefinitionGroup(
permission?: T.PermissionDefinition | T.PermissionDefinitionGroup
): permission is T.PermissionDefinitionGroup {
return Boolean(permission && (permission as T.PermissionDefinitionGroup).category)... | {
return {
category: permission.category,
permissions: permission.permissions.map(permission =>
convertToPermissionDefinition(permission, l10nPrefix)
)
};
} | conditional_block |
utils.ts | /*
* SonarQube
* Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, o... | (
permissions: Array<string | { category: string; permissions: string[] }>,
l10nPrefix: string
): Array<T.PermissionDefinition | T.PermissionDefinitionGroup> {
return permissions.map(permission => {
if (typeof permission === 'object') {
return {
category: permission.category,
permissions... | convertToPermissionDefinitions | identifier_name |
utils.ts | /*
* SonarQube
* Copyright (C) 2009-2019 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, o... |
export function convertToPermissionDefinitions(
permissions: Array<string | { category: string; permissions: string[] }>,
l10nPrefix: string
): Array<T.PermissionDefinition | T.PermissionDefinitionGroup> {
return permissions.map(permission => {
if (typeof permission === 'object') {
return {
ca... | {
const getMessage = (messageKey: string) => {
const cloudMessageKey = `${messageKey}.sonarcloud`;
return isSonarCloud() && hasMessage(cloudMessageKey)
? translate(cloudMessageKey)
: translate(messageKey);
};
const name = getMessage(`${l10nPrefix}.${permission}`);
const description = getMes... | identifier_body |
__init__.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
GeobricksTRMM
A QGIS plugin
Download TRMM daily data.
-------------------
begin : 2015-10-06
copyright : (C) ... | (iface): # pylint: disable=invalid-name
"""Load GeobricksTRMM class from file GeobricksTRMM.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
#
from .geobricks_trmm_qgis import GeobricksTRMM
return GeobricksTRMM(iface)
| classFactory | identifier_name |
__init__.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
GeobricksTRMM
A QGIS plugin
Download TRMM daily data.
-------------------
begin : 2015-10-06
copyright : (C) ... | """Load GeobricksTRMM class from file GeobricksTRMM.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
#
from .geobricks_trmm_qgis import GeobricksTRMM
return GeobricksTRMM(iface) | identifier_body | |
__init__.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
GeobricksTRMM
A QGIS plugin
Download TRMM daily data.
------------------- | begin : 2015-10-06
copyright : (C) 2015 by Geobricks
email : info@geobricks.org
git sha : $Format:%H$
***************************************************************************/
/****************************************************... | random_line_split | |
check_data.py | from data import *
from draw import *
|
print img
d_idx = np.random.randint(0, 50)
x_x, obs_x, obs_y, obs_tfs, new_ob_x, new_ob_y, new_ob_tf, imgs = gen_data()
print show_dim(x_x)
print show_dim(obs_x)
print show_dim(obs_y)
print show_dim(obs_tfs)
print show_dim(new_ob_x)
print show_dim(new_ob_y)
print show_dim(new_ob_tf)
obss = zip([np.argmax(obx[d_id... | img, hiden_x = get_img_class()
print img.shape | random_line_split |
tests.js | describe("twitter plugin", function () {
xit("works", function () {
expect(function () {
var plugins = require("../index.js").convert,
assert = require("assert");
var goodURLs = [
"https://twitter.com/davidmerfieId/status/500323409218117633",
"http://twitter.com/davidmerfieId/... |
}).not.toThrow();
});
});
| {
return '<p><a href="' + url + '">' + url + "</a></p>";
} | identifier_body |
tests.js | describe("twitter plugin", function () {
xit("works", function () {
expect(function () {
var plugins = require("../index.js").convert,
assert = require("assert");
var goodURLs = [
"https://twitter.com/davidmerfieId/status/500323409218117633",
"http://twitter.com/davidmerfieId/... |
badURLs.forEach(function (html) {
plugins(
{ plugins: { twitter: { enabled: true } } },
"/path.txt",
html,
function (err, newHTML) {
assert(newHTML === html);
}
);
});
console.log("All tests complete?");
function li... | function (err, newHTML) {
assert(newHTML !== html);
}
);
}); | random_line_split |
tests.js | describe("twitter plugin", function () {
xit("works", function () {
expect(function () {
var plugins = require("../index.js").convert,
assert = require("assert");
var goodURLs = [
"https://twitter.com/davidmerfieId/status/500323409218117633",
"http://twitter.com/davidmerfieId/... | (url) {
return '<p><a href="' + url + '">' + url + "</a></p>";
}
}).not.toThrow();
});
});
| linkify | identifier_name |
domrect.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::DOMRectBinding;
use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRec... | left: Au, right: Au) -> DOMRect {
DOMRect {
top: top.to_nearest_px() as f32,
bottom: bottom.to_nearest_px() as f32,
left: left.to_nearest_px() as f32,
right: right.to_nearest_px() as f32,
reflector_: Reflector::new(),
}... | right: f32,
}
impl DOMRect {
fn new_inherited(top: Au, bottom: Au, | random_line_split |
domrect.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::DOMRectBinding;
use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRec... | (self) -> Finite<f32> {
let result = (self.right - self.left).abs();
Finite::wrap(result)
}
fn Height(self) -> Finite<f32> {
let result = (self.bottom - self.top).abs();
Finite::wrap(result)
}
}
| Width | identifier_name |
domrect.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::DOMRectBinding;
use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRec... |
fn Left(self) -> Finite<f32> {
Finite::wrap(self.left)
}
fn Right(self) -> Finite<f32> {
Finite::wrap(self.right)
}
fn Width(self) -> Finite<f32> {
let result = (self.right - self.left).abs();
Finite::wrap(result)
}
fn Height(self) -> Finite<f32> {
... | {
Finite::wrap(self.bottom)
} | identifier_body |
layoutService.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | /**
* Asks the part service if all parts have been fully restored. For editor part
* this means that the contents of editors have loaded.
*/
isRestored(): boolean;
/**
* Returns whether the given part has the keyboard focus or not.
*/
hasFocus(part: Parts): boolean;
/**
* Returns the parts HTML eleme... | random_line_split | |
makemessages_unique.py | # -*- coding: utf-8 -*-
import glob
import os
import polib
from django import VERSION as DJANGO_VERSION
from django.core.management.commands.makemessages import (
Command as OriginalMakeMessagesCommand)
from django.utils import translation
from django.utils.translation.trans_real import CONTEXT_SEPARATOR
class Co... | locales = [os.path.basename(l) for l in locale_dirs]
# monkeypatch settings to not include the project locale directory
localepaths = [os.path.normpath(path) for path in settings.LOCALE_PATHS]
# remove the locale we're currently writing to from the settings, so that we can check for... | if DJANGO_VERSION < (1, 7):
requires_model_validation = False
can_import_settings = True
def handle_noargs(self, *args, **options):
from django.conf import settings
super(Command, self).handle_noargs(*args, **options)
locale = options.get('locale')
domain = options.get('... | identifier_body |
makemessages_unique.py | # -*- coding: utf-8 -*-
import glob
import os
import polib
from django import VERSION as DJANGO_VERSION
from django.core.management.commands.makemessages import (
Command as OriginalMakeMessagesCommand)
from django.utils import translation
from django.utils.translation.trans_real import CONTEXT_SEPARATOR
class Co... | settings.LOCALE_PATHS = list(localepaths)
missing = object()
for locale in locales:
translation.activate(locale)
catalog = translation.trans_real.catalog()
# catalog = trans.translation(locale)
# catalog = translation.trans_real.translation._fetch... | random_line_split | |
makemessages_unique.py | # -*- coding: utf-8 -*-
import glob
import os
import polib
from django import VERSION as DJANGO_VERSION
from django.core.management.commands.makemessages import (
Command as OriginalMakeMessagesCommand)
from django.utils import translation
from django.utils.translation.trans_real import CONTEXT_SEPARATOR
class Co... | (self, *args, **options):
from django.conf import settings
super(Command, self).handle_noargs(*args, **options)
locale = options.get('locale')
domain = options.get('domain')
verbosity = int(options.get('verbosity'))
process_all = options.get('all')
# now that we'... | handle_noargs | identifier_name |
makemessages_unique.py | # -*- coding: utf-8 -*-
import glob
import os
import polib
from django import VERSION as DJANGO_VERSION
from django.core.management.commands.makemessages import (
Command as OriginalMakeMessagesCommand)
from django.utils import translation
from django.utils.translation.trans_real import CONTEXT_SEPARATOR
class Co... |
# monkeypatch settings to not include the project locale directory
localepaths = [os.path.normpath(path) for path in settings.LOCALE_PATHS]
# remove the locale we're currently writing to from the settings, so that we can check for existing translations
# NOT in this file
locale... | locale_dirs = filter(os.path.isdir, glob.glob('%s/*' % localedir))
locales = [os.path.basename(l) for l in locale_dirs] | conditional_block |
19180cf98af6_nsx_gw_devices.py | # Copyright 2014 OpenStack Foundation
#
# 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 ... | 'networkgatewaydevices',
sa.Column('tenant_id', sa.String(length=255), nullable=True),
sa.Column('id', sa.String(length=36), nullable=False),
sa.Column('nsx_id', sa.String(length=36), nullable=True),
sa.Column('name', sa.String(length=255), nullable=True),
sa.Column('conn... | if not migration.schema_has_table('networkgatewaydevices'):
# Assume that, in the database we are migrating from, the
# configured plugin did not create any nsx tables.
return
op.create_table(
'networkgatewaydevicereferences',
sa.Column('id', sa.String(length=36), nullable=F... | identifier_body |
19180cf98af6_nsx_gw_devices.py | # Copyright 2014 OpenStack Foundation
#
# 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 ... | sa.Column('interface_name', sa.String(length=64), nullable=True),
sa.ForeignKeyConstraint(['network_gateway_id'], ['networkgateways.id'],
ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id', 'network_gateway_id', 'interface_name'))
# Copy data from networkgatewa... | sa.Column('network_gateway_id', sa.String(length=36), nullable=True), | random_line_split |
19180cf98af6_nsx_gw_devices.py | # Copyright 2014 OpenStack Foundation
#
# 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 ... |
op.create_table(
'networkgatewaydevicereferences',
sa.Column('id', sa.String(length=36), nullable=False),
sa.Column('network_gateway_id', sa.String(length=36), nullable=True),
sa.Column('interface_name', sa.String(length=64), nullable=True),
sa.ForeignKeyConstraint(['networ... | return | conditional_block |
19180cf98af6_nsx_gw_devices.py | # Copyright 2014 OpenStack Foundation
#
# 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 ... | ():
if not migration.schema_has_table('networkgatewaydevices'):
# Assume that, in the database we are migrating from, the
# configured plugin did not create any nsx tables.
return
op.create_table(
'networkgatewaydevicereferences',
sa.Column('id', sa.String(length=36), n... | upgrade | identifier_name |
euler.rs | of the authors,
// refer to the Cargo.toml file at the top-level directory of this distribution.
//
// 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/... | A::Epsilon {
A::default_epsilon()
}
#[inline]
fn abs_diff_eq(&self, other: &Self, epsilon: A::Epsilon) -> bool {
A::abs_diff_eq(&self.x, &other.x, epsilon)
&& A::abs_diff_eq(&self.y, &other.y, epsilon)
&& A::abs_diff_eq(&self.z, &other.z, epsilon)
}
}
impl<A: A... | lt_epsilon() -> | identifier_name |
euler.rs | of the authors,
// refer to the Cargo.toml file at the top-level directory of this distribution.
//
// 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/... | }
#[cfg(feature = "rand")]
impl<A> Distribution<Euler<A>> for Standard
where
Standard: Distribution<A>,
A: Angle,
{
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Euler<A> {
Euler {
x: rng.gen(),
y: rng.gen(),
z: rng.gen(),
}
}
}
#[cfg(feature = "... | && A::ulps_eq(&self.y, &other.y, epsilon, max_ulps)
&& A::ulps_eq(&self.z, &other.z, epsilon, max_ulps)
} | random_line_split |
productos.js | window.images = [];
$(document).ready(function() {
var imgs = [];
IMG_FOLDER = "../img";
ajaxPath = ["perifericos/controles",
"perifericos/mouses",
"perifericos/parlantes",
"perifericos/teclados",
"procesadores/intel",
"p... | else{
$(this).html($(this).html().replace($(this).html().substr(-1), "▲"));
}
}
});
});
});
}); | {
$(this).html($(this).html().replace($(this).html().substr(-1), "▼"));
}
| conditional_block |
productos.js | window.images = [];
$(document).ready(function() {
var imgs = [];
IMG_FOLDER = "../img";
ajaxPath = ["perifericos/controles",
"perifericos/mouses",
"perifericos/parlantes",
"perifericos/teclados",
"procesadores/intel",
"p... | if(imgs[e].match(filter)){
imageArray.push(imgs[e]);
};
}
setRoot(IMG_FOLDER);
setImageArray(imageArray);
console.log(imageArray.length);
setIma... | $("td a").click(function(){
console.log("TD A!!");
var imageArray = [];
var filter = $(this).parent().parent().attr("procimages");
for(e=0;e<imgs.length;e++){ | random_line_split |
authority.rs | // Copyright 2015-2019 Benjamin Fry <benjaminfry@me.com>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed... | Ok(ForwardAuthority {
origin: Name::root().into(),
resolver,
})
}
/// Read the Authority for the origin from the specified configuration
pub async fn try_from_config(
origin: Name,
_zone_type: ZoneType,
config: &ForwardConfig,
runtime:... | pub async fn new(runtime: Handle) -> Result<Self, String> {
let resolver = TokioAsyncResolver::from_system_conf(runtime)
.map_err(|e| format!("error constructing new Resolver: {}", e))?;
| random_line_split |
authority.rs | // Copyright 2015-2019 Benjamin Fry <benjaminfry@me.com>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed... | {
origin: LowerName,
resolver: TokioAsyncResolver,
}
impl ForwardAuthority {
/// TODO: change this name to create or something
#[allow(clippy::new_without_default)]
#[doc(hidden)]
pub async fn new(runtime: Handle) -> Result<Self, String> {
let resolver = TokioAsyncResolver::from_system... | ForwardAuthority | identifier_name |
CheckBox.ts | /**
* The UI_CheckBox class represent a standard user interface checkbox control. Optionally,
* setting it's tri-state property to true, the checkbox can become a tri-state one.
*
* Sample checkboxes (focused, disabled, and tri-state):
*
* ;
this._dom.caption.appendChild( document.createTextNode( this._caption ) );
this.width = UI_CheckBox._theme.defaultWidth;
this.height= UI_CheckBox._theme.defaultHeight;
this._initDom_();
}
get caption(): string {
return this._caption;
}
set caption( newOne... | constructor( owner: UI ) {
super( owner, [ 'IFocusable', 'IInput' ], Utils.dom.create('div', 'ui UI_CheckBox v-false' ) );
this._root.appendChild( this._dom.input ); | random_line_split |
CheckBox.ts | /**
* The UI_CheckBox class represent a standard user interface checkbox control. Optionally,
* setting it's tri-state property to true, the checkbox can become a tri-state one.
*
* Sample checkboxes (focused, disabled, and tri-state):
*
*  {
if ( newOne !== null ) {
newOne = !!newOne;
}
if ( newOne !== this._value ) {
switch ( newOne ) {
case null:
Utils.dom.removeClasses( this._root, [ 'v-true', 'v-false' ] );
Utils.dom.addClass( this._root, 'v-null' );
this._value = null;
break;
case true:
... | value | identifier_name |
CheckBox.ts | /**
* The UI_CheckBox class represent a standard user interface checkbox control. Optionally,
* setting it's tri-state property to true, the checkbox can become a tri-state one.
*
* Sample checkboxes (focused, disabled, and tri-state):
*
*  {
( function( me ) {
me.onDOMEvent( me._root, EEventType.CLICK, function( e: Utils_Event_Mouse ) {
me.fire( 'click' );
e.handled = true;
}, false );
me.on( 'keydown', function( ev: Utils_Event_Keyboard ) {
var code: number = ev.code;
if ( code == Utils.keyboa... | {
switch ( this.value ) {
case null:
this.value = true;
break;
case true:
this.value = false;
break;
case false:
this.value = this._triState ? null : true;
break;
}
this.fire( 'change' );
} | conditional_block |
CheckBox.ts | /**
* The UI_CheckBox class represent a standard user interface checkbox control. Optionally,
* setting it's tri-state property to true, the checkbox can become a tri-state one.
*
* Sample checkboxes (focused, disabled, and tri-state):
*
*  {
if ( newOne !== null ) {
newOne = !!newOne;
}
if ( newOne !== this._value ) {
switch ( newOne ) {
case null:
Utils.dom.removeClasses( this._root, [ 'v-true', 'v-false' ] );
Utils.dom.addClass( this._root, 'v-null' );
this._value = null;
break;
ca... | {
return this._value;
} | identifier_body |
lib.rs | #![feature(quote, plugin_registrar, rustc_private)]
#![feature(tempdir, path, io, fs, process)]
extern crate syntax;
extern crate rustc;
use std::path::{PathBuf, Path};
use std::fs::{self, TempDir, File};
use std::io;
use std::io::prelude::*;
use std::process::Command;
use syntax::ast;
use syntax::codemap;
use synta... | let mut version = set_once::SetOnce::new();
let mut p = cx.new_parser_from_tts(tts);
while p.token != token::Eof {
// <name> = "..."
let ident = p.parse_ident();
let ident_span = p.last_span;
match ident.as_str() {
"version" => {
... |
impl Options {
fn parse(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> Options { | random_line_split |
lib.rs | #![feature(quote, plugin_registrar, rustc_private)]
#![feature(tempdir, path, io, fs, process)]
extern crate syntax;
extern crate rustc;
use std::path::{PathBuf, Path};
use std::fs::{self, TempDir, File};
use std::io;
use std::io::prelude::*;
use std::process::Command;
use syntax::ast;
use syntax::codemap;
use synta... |
struct Expander {
dir: TempDir
}
impl base::TTMacroExpander for Expander {
fn expand<'cx>(&self,
cx: &'cx mut ExtCtxt,
sp: codemap::Span,
raw_tts: &[ast::TokenTree])
-> Box<MacResult+'cx>
{
macro_rules! mac_try {
... | {
let dir = match TempDir::new("rustc_python_mixin") {
Ok(d) => d,
Err(e) => {
registrar.sess.span_err(registrar.krate_span,
&format!("could not create temporary directory: {}", e));
return;
}
};
registrar.register_syntax_e... | identifier_body |
lib.rs | #![feature(quote, plugin_registrar, rustc_private)]
#![feature(tempdir, path, io, fs, process)]
extern crate syntax;
extern crate rustc;
use std::path::{PathBuf, Path};
use std::fs::{self, TempDir, File};
use std::io;
use std::io::prelude::*;
use std::process::Command;
use syntax::ast;
use syntax::codemap;
use synta... | {
version: String,
}
impl Options {
fn parse(cx: &ExtCtxt, tts: &[ast::TokenTree]) -> Options {
let mut version = set_once::SetOnce::new();
let mut p = cx.new_parser_from_tts(tts);
while p.token != token::Eof {
// <name> = "..."
let ident = p.parse_ident();
... | Options | identifier_name |
owncloud_core_js_multiselect.js | (function( $ ){
var multiSelectId=-1;
$.fn.multiSelect=function(options){
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
'title':this.attr('title'),
'checked':[],
'oncheck':false,
'onuncheck':false,
};
$.extend(settings,options);
var button=$('<div class="... | tem,checked){
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked',true);
}
if(checked){
settings.checked.push(item);
... | eateItem(i | identifier_name |
owncloud_core_js_multiselect.js | (function( $ ){
var multiSelectId=-1;
$.fn.multiSelect=function(options){
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
'title':this.attr('title'),
'checked':[],
'oncheck':false,
'onuncheck':false,
};
$.extend(settings,options);
var button=$('<div class="... | var lists=$('ul.multiselectoptions');
lists.slideUp(400,function(){
lists.remove();
$('div.multiselect').removeClass('active');
button.addClass('active');
});
button.addClass('active');
event.stopPropagation();
var options=$(this).parent().next().children().map(function(){return $(this).val... | button.parent().children('ul').slideUp(400,function(){
button.parent().children('ul').remove();
button.removeClass('active');
});
return;
}
| conditional_block |
owncloud_core_js_multiselect.js | (function( $ ){
var multiSelectId=-1;
$.fn.multiSelect=function(options){
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
'title':this.attr('title'),
'checked':[],
'oncheck':false,
'onuncheck':false,
};
$.extend(settings,options);
var button=$('<div class="... | var index=settings.checked.indexOf(groupname);
settings.checked.splice(index,1);
if(settings.onuncheck){
if(settings.onuncheck(groupname)===false){
$(this).attr('checked',true);
return;
}
}
}
var oldWidth=button.width();
if(settings.checked.length>0){... | var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked',true);
}
if(checked){
settings.checked.push(item);
}
inpu... | identifier_body |
owncloud_core_js_multiselect.js | (function( $ ){
var multiSelectId=-1;
$.fn.multiSelect=function(options){
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
'title':this.attr('title'),
'checked':[],
'oncheck':false,
'onuncheck':false,
};
$.extend(settings,options);
var button=$('<div class="... | event.stopPropagation();
});
});
$(window).click(function(){
if(!button.parent().data('preventHide')){
button.parent().children('ul').slideUp(400,function(){
button.parent().children('ul').remove();
button.removeClass('active');
});
}
});
return span;
};
})( jQuery ); | list.slideDown();
list.click(function(event){ | random_line_split |
RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$normalization.graphql.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7739615f09bf108233e1aab9e00191f9>>
* @flow
* @lightSyntaxTransform
* @nogrep
*/
/* eslint-disable ... | "alias": null,
"args": null,
"concreteType": "MarkdownUserNameData",
"kind": "LinkedField",
"name": "data",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "markup",
"storag... | "name": "markdown",
"storageKey": null
},
{ | random_line_split |
RelayResponseNormalizerTest1MarkdownUserNameRenderer_name$normalization.graphql.js | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<7739615f09bf108233e1aab9e00191f9>>
* @flow
* @lightSyntaxTransform
* @nogrep
*/
/* eslint-disable ... |
module.exports = node;
| {
(node/*: any*/).hash = "0664dafd5e47ea16f70ed265f10ae379";
} | conditional_block |
ListPlaylistsByID.py | # -*- coding: utf-8 -*-
###############################################################################
#
# ListPlaylistsByID
# Returns a collection of playlists that match the provided IDs.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... |
def set_PageToken(self, value):
"""
Set the value of the PageToken input for this Choreo. ((optional, string) The "nextPageToken" found in the response which is used to page through results.)
"""
super(ListPlaylistsByIDInputSet, self)._set_input('PageToken', value)
def set_Part(... | """
Set the value of the MaxResults input for this Choreo. ((optional, integer) The maximum number of results to return.)
"""
super(ListPlaylistsByIDInputSet, self)._set_input('MaxResults', value) | identifier_body |
ListPlaylistsByID.py | # -*- coding: utf-8 -*-
###############################################################################
#
# ListPlaylistsByID
# Returns a collection of playlists that match the provided IDs.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | (self, value):
"""
Set the value of the ClientID input for this Choreo. ((conditional, string) The Client ID provided by Google. Required for OAuth authentication unless providing a valid AccessToken.)
"""
super(ListPlaylistsByIDInputSet, self)._set_input('ClientID', value)
def set_C... | set_ClientID | identifier_name |
ListPlaylistsByID.py | # -*- coding: utf-8 -*-
###############################################################################
#
# ListPlaylistsByID
# Returns a collection of playlists that match the provided IDs.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | set of Temboo credentials, must be supplied.
"""
super(ListPlaylistsByID, self).__init__(temboo_session, '/Library/YouTube/Playlists/ListPlaylistsByID')
def new_input_set(self):
return ListPlaylistsByIDInputSet()
def _make_result_set(self, result, path):
return ListPla... | def __init__(self, temboo_session):
"""
Create a new instance of the ListPlaylistsByID Choreo. A TembooSession object, containing a valid | random_line_split |
Tephigrams_From_Radiosonde_Climatology_Onset.py | igramPlot import *
from SoundingRoutines import *
imp.load_source('GeogFuncs', '/nfs/see-fs-01_users/eepdw/python_scripts/modules/GeogFunctions.py')
from GeogFuncs import *
pmin=200.
station_list_cs=[42182, 43003, 43014, 42867, 43371, 43353, 43285, 43192, 43150, 42339, 40990, 40948]
#station_list_cs=[43003]
date_mi... |
return arr_index_var
# Parse the data
for stat in station_list_cs:
station_name,la,lo, st_height=StationInfoSearch(stat)
load_file = load('/nfs/a90/eepdw/Data/Observations/Radiosonde_Numpy/Radiosonde_Cross_Section_'
'IND_SOUNDING_INTERP_MEAN_Climat_%s_%s_%s_%s.npz'
... | arr_index_var=value | conditional_block |
Tephigrams_From_Radiosonde_Climatology_Onset.py | igramPlot import *
from SoundingRoutines import *
imp.load_source('GeogFuncs', '/nfs/see-fs-01_users/eepdw/python_scripts/modules/GeogFunctions.py')
from GeogFuncs import *
pmin=200.
station_list_cs=[42182, 43003, 43014, 42867, 43371, 43353, 43285, 43192, 43150, 42339, 40990, 40948]
#station_list_cs=[43003]
date_mi... | (variable, variable_list):
for key, value in variable_list.iteritems(): # iter on both keys and values
if key.startswith('%s' % variable) and key.endswith('%s' % variable):
arr_index_var=value
return arr_index_var
# Parse the data
for stat in station_list_cs:
station_name,la,l... | variable_name_index_match | identifier_name |
Tephigrams_From_Radiosonde_Climatology_Onset.py | igramPlot import *
from SoundingRoutines import *
imp.load_source('GeogFuncs', '/nfs/see-fs-01_users/eepdw/python_scripts/modules/GeogFunctions.py')
from GeogFuncs import *
pmin=200.
station_list_cs=[42182, 43003, 43014, 42867, 43371, 43353, 43285, 43192, 43150, 42339, 40990, 40948]
#station_list_cs=[43003]
date_mi... |
for stat in station_list_cs:
station_name,la,lo, st_height=StationInfoSearch(stat)
load_file = load('/nfs/a90/eepdw/Data/Observations/Radiosonde_Numpy/Radiosonde_Cross_Section_'
'IND_SOUNDING_INTERP_MEAN_Climat_%s_%s_%s_%s.npz'
% (date_min.strftime('%... | for key, value in variable_list.iteritems(): # iter on both keys and values
if key.startswith('%s' % variable) and key.endswith('%s' % variable):
arr_index_var=value
return arr_index_var
# Parse the data | identifier_body |
Tephigrams_From_Radiosonde_Climatology_Onset.py | 3285, 43192, 43150, 42339, 40990, 40948]
#station_list_cs=[43003]
date_min=datetime.datetime(1960,5,1,0,0,0)
date_max=datetime.datetime(2014,10,1,0,0,0)
delta = relativedelta(weeks=+1)
variable_list={'pressures': 0, 'temps':1, 'dewpoints':2, 'winddirs':3, 'windspeeds':4, 'pot_temp':5,
'sa... | barbs_idx=np.logspace(np.log10(10),np.log10(max(len(u_wind))),num=32).astype(int)
wbax.set_yscale('log')
wbax.xaxis.set_ticks([],[]) | random_line_split | |
password-reset-mixin.js | /* 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/. */
/**
* Provides reset password helper methods.
*
* Dependent on the ResumeTokenMixin which is automatically mix... |
var account = this.user.initAccount({ email: email });
return account.retryResetPassword(
passwordForgotToken,
self.relier,
{
resume: self.getStringifiedResumeToken()
}
);
}
}, ResumeTokenMixin);
}); | */
retryResetPassword: function (email, passwordForgotToken) {
var self = this; | random_line_split |
License.ts | .d.ts" />
export = License;
import Util = require('../../Util');
import SaklientException = require('../../errors/SaklientException');
import Client = require('../Client');
import Resource = require('./Resource');
import LicenseInfo = require('./LicenseInfo');
'use strict';
/**
* ライセンスの実体1つに対応し、属性の取得や操作を行うためのクラス。
... | throw new SaklientException("required_field", "Required fields must be set before the License creation: | if (missing.length > 0) { | random_line_split |
License.ts | .ts" />
export = License;
import Util = require('../../Util');
import SaklientException = require('../../errors/SaklientException');
import Client = require('../Client');
import Resource = require('./Resource');
import LicenseInfo = require('./LicenseInfo');
'use strict';
/**
* ライセンスの実体1つに対応し、属性の取得や操作を行うためのクラス。
*... | boolean
* @private
*/
private n_name : boolean = false;
/**
* (This method is generated in Translator_default#buildImpl)
*
* @method get_name
* @private
* @return {string}
*/
private get_name() : string {
return this.m_name;
}
/**
* (This method is generated in Translator_default#buildImpl... | default false
* @type | identifier_body |
License.ts | .ts" />
export = License;
import Util = require('../../Util');
import SaklientException = require('../../errors/SaklientException');
import Client = require('../Client');
import Resource = require('./Resource');
import LicenseInfo = require('./LicenseInfo');
'use strict';
/**
* ライセンスの実体1つに対応し、属性の取得や操作を行うためのクラス。
*... | ments.length, 1);
this.isNew = r == null;
if (this.isNew) {
r = { };
};
this.isIncomplete = false;
if (Util.existsPath(r, "ID")) {
this.m_id = Util.getByPath(r, "ID") == null ? null : "" + Util.getByPath(r, "ID");
}
else {
this.m_id = null;
this.isIncomplete = true;
};
this.n_id = false;
... | argu | identifier_name |
License.ts | .ts" />
export = License;
import Util = require('../../Util');
import SaklientException = require('../../errors/SaklientException');
import Client = require('../Client');
import Resource = require('./Resource');
import LicenseInfo = require('./LicenseInfo');
'use strict';
/**
* ライセンスの実体1つに対応し、属性の取得や操作を行うためのクラス。
*... | an:boolean=false) : any {
Util.validateType(withClean, "boolean");
var missing:string[] = [];
var ret:any = { };
if (withClean || this.n_id) {
Util.setByPath(ret, "ID", this.m_id);
};
if (withClean || this.n_name) {
Util.setByPath(ret, "Name", this.m_name);
}
else {
if (this.isNew) {
missi... | private
* @method apiSerializeImpl
* @protected
* @param {boolean} withClean=false
* @return {any}
*/
apiSerializeImpl(withCle | conditional_block |
test_update_institute_cmd.py | # -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def test_update_institute(mock_app):
| "display_name": "updated_name",
"sanger_recipients": None,
}
# Test CLI to update coverage cutoff
result = runner.invoke(
cli, ["update", "institute", "cust000", "-c", updates["coverage_cutoff"]]
)
# it should return error message
assert result.exit_code == 0
assert "... | """Tests the CLI that updates an institute"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, no arguments provided
result = runner.invoke(cli, ["update", "institute"])
# it should return error message
assert "Error: Missing argument" in result.output
# Test CLI passing... | identifier_body |
test_update_institute_cmd.py | # -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def | (mock_app):
"""Tests the CLI that updates an institute"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, no arguments provided
result = runner.invoke(cli, ["update", "institute"])
# it should return error message
assert "Error: Missing argument" in result.output
# ... | test_update_institute | identifier_name |
test_update_institute_cmd.py | # -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def test_update_institute(mock_app):
"""Tests the CLI that updates an institute"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, no arguments provided
result = runner.invoke(cli... |
# Test CLI to update sanger recipients
result = runner.invoke(
cli,
["update", "institute", "cust000", "-s", institute_obj["sanger_recipients"][0]],
)
# it should return error message
assert result.exit_code == 0
assert "INFO Institute updated" in result.output
# make sure... | assert institute_obj[key] != updated_institute[key] | conditional_block |
test_update_institute_cmd.py | # -*- coding: utf-8 -*-
from scout.commands import cli
from scout.server.extensions import store
def test_update_institute(mock_app):
"""Tests the CLI that updates an institute"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, no arguments provided
result = runner.invoke(cli... | assert result.exit_code == 0
assert "INFO Institute updated" in result.output
# Test CLI to remove a sanger recipient
result = runner.invoke(
cli,
["update", "institute", "cust000", "-r", institute_obj["sanger_recipients"][0]],
)
# it should return error message
assert resul... | random_line_split | |
deeper.py | from collections import OrderedDict, Mapping, Container
from pprint import pprint
from sys import getsizeof
def deep_compare(a, b, pointer='/'):
if a == b:
return
if type(a) != type(b):
reason = 'Different data types'
extra = str((type(a), type(b)))
x(pointer, reason, extra)
... |
def compare(a, b):
try:
deep_compare(a, b, '/')
except RuntimeError as e:
pprint(e.message)
def deep_getsizeof(o, ids):
"""Find the memory footprint of a Python object
This is a recursive function that rills down a Python object graph
like a dictionary holding nested ditionarie... | message = 'Objects are not the same. Pointer: {}. Reason: {}. Extra: {}'
raise RuntimeError(message.format(pointer, reason, extra)) | identifier_body |
deeper.py | from collections import OrderedDict, Mapping, Container
from pprint import pprint
from sys import getsizeof
def deep_compare(a, b, pointer='/'):
if a == b:
return
if type(a) != type(b):
reason = 'Different data types'
extra = str((type(a), type(b)))
x(pointer, reason, extra)
... |
if isinstance(o, Container):
return r + sum(d(x, ids) for x in o)
return r
| return r + sum(d(k, ids) + d(v, ids) for k, v in o.iteritems()) | conditional_block |
deeper.py | from collections import OrderedDict, Mapping, Container
from pprint import pprint
from sys import getsizeof
def deep_compare(a, b, pointer='/'):
if a == b:
return
if type(a) != type(b):
reason = 'Different data types'
extra = str((type(a), type(b)))
x(pointer, reason, extra)
... | deep_compare(a, b, '/')
except RuntimeError as e:
pprint(e.message)
def deep_getsizeof(o, ids):
"""Find the memory footprint of a Python object
This is a recursive function that rills down a Python object graph
like a dictionary holding nested ditionaries with lists of lists
and t... | def compare(a, b):
try: | random_line_split |
deeper.py | from collections import OrderedDict, Mapping, Container
from pprint import pprint
from sys import getsizeof
def deep_compare(a, b, pointer='/'):
if a == b:
return
if type(a) != type(b):
reason = 'Different data types'
extra = str((type(a), type(b)))
x(pointer, reason, extra)
... | (a, b):
try:
deep_compare(a, b, '/')
except RuntimeError as e:
pprint(e.message)
def deep_getsizeof(o, ids):
"""Find the memory footprint of a Python object
This is a recursive function that rills down a Python object graph
like a dictionary holding nested ditionaries with lists o... | compare | identifier_name |
helpers.py | # -*- coding: utf-8 -*-
import sys
import time
def make(session):
session.execute("make (%(rnd_name.0)s)")
a_guid = session.message()[1][-1]
assert(session.message() is None)
return(a_guid)
def link(session, a, l, b):
session.execute("make %s -[%s]> %s" % (a, l, b))
assert(session.message() i... |
session.execute("attr put %s \"%s\" %s%s" % (a, name, value, ttl))
assert(session.message() is None)
def tattr_put(session, a, name, time, value, ttl=None):
if (ttl is None):
ttl = ""
else:
ttl = " with ttl:%d" % (ttl,)
session.execute("attr put %s \"%s\" [%s] %s%s" % (a, name, tim... | ttl = " with ttl:%d" % (ttl,) | conditional_block |
helpers.py | # -*- coding: utf-8 -*-
import sys
import time
def make(session):
|
def link(session, a, l, b):
session.execute("make %s -[%s]> %s" % (a, l, b))
assert(session.message() is None)
def kill(session, a, l, b=None):
if (b is None):
session.execute("kill %s -[%s]> ()" % (a, l))
else:
session.execute("kill %s -[%s]> %s" % (a, l, b))
assert(session.messa... | session.execute("make (%(rnd_name.0)s)")
a_guid = session.message()[1][-1]
assert(session.message() is None)
return(a_guid) | identifier_body |
helpers.py | # -*- coding: utf-8 -*-
import sys
import time
def make(session):
session.execute("make (%(rnd_name.0)s)")
a_guid = session.message()[1][-1]
assert(session.message() is None)
return(a_guid)
def link(session, a, l, b):
session.execute("make %s -[%s]> %s" % (a, l, b))
assert(session.message() i... | (a):
return("(double %s)" % repr(a))
def sleep(t):
sys.stdout.write("(time.sleep %d)" % t)
sys.stdout.flush()
time.sleep(t * 2)
| double_value | identifier_name |
helpers.py | # -*- coding: utf-8 -*-
import sys
import time
def make(session):
session.execute("make (%(rnd_name.0)s)")
a_guid = session.message()[1][-1]
assert(session.message() is None)
return(a_guid)
def link(session, a, l, b):
session.execute("make %s -[%s]> %s" % (a, l, b))
assert(session.message() i... | return("(double %s)" % repr(a))
def sleep(t):
sys.stdout.write("(time.sleep %d)" % t)
sys.stdout.flush()
time.sleep(t * 2) |
def double_value(a): | random_line_split |
unseries.py | ', analytic=None):
"""
Example:
`z2 = Series(3, {0: ufloat(-1, 0.4), 1: ufloat(-2, .004), 2: ufloat(999, .1)})`
will give:
Z₂(g) = -1.0(4) - 2.000(4) g + 999.00(10) g²
:param n: number of the "known" orders, `int`
:param d: dictionary with k=powers, v=`ufloat`s
... | def pprint(self):
res = ""
for g, c in self.gSeries.items():
if c != 0 and g <= self.n and not self.analytic:
res += "(%s ± %s) * %s**%s + " % (str(c.n), str(c.s), self.name, str(g))
elif c != 0 and g <= self.n and self.analytic:
try:
... |
"""
return map(lambda x: float(x.format('S').split("(")[0]), self.gSeries.values())[:self.n + 1]
| identifier_body |
unseries.py | ', analytic=None):
"""
Example:
`z2 = Series(3, {0: ufloat(-1, 0.4), 1: ufloat(-2, .004), 2: ufloat(999, .1)})`
will give:
Z₂(g) = -1.0(4) - 2.000(4) g + 999.00(10) g²
:param n: number of the "known" orders, `int`
:param d: dictionary with k=powers, v=`ufloat`s
... | for i in range(0, n):
if i not in d.keys():
if self.analytic:
self.gSeries[i] = 0
else:
self.gSeries[i] = ufloat(0, 0)
def __lt__(self, other):
return len(self.gSeries) < len(other.gSeries)
def __add__(self, othe... | f.analytic = all(map(lambda x: type(x) == int, d.values()))
| conditional_block |
unseries.py | g', analytic=None):
"""
Example:
`z2 = Series(3, {0: ufloat(-1, 0.4), 1: ufloat(-2, .004), 2: ufloat(999, .1)})`
will give:
Z₂(g) = -1.0(4) - 2.000(4) g + 999.00(10) g²
:param n: number of the "known" orders, `int`
:param d: dictionary with k=powers, v=`ufloat`s
... | self.analytic = True
else:
raise TypeError("Series constructor warning: Type(v)={}".format(type(v)))
if analytic is not None:
# XXX: if defined explicitly:
self.analytic = bool(analytic)
else:
# XXX: if all values are ints a... | self.gSeries[k] = ufloat(v[0], v[1])
elif isinstance(v, str):
self.gSeries[k] = ufloat_fromstr(v)
elif isinstance(v, int):
self.gSeries[k] = v | random_line_split |
unseries.py | 0) g²
:param n: number of the "known" orders, `int`
:param d: dictionary with k=powers, v=`ufloat`s
:param name: name of the series variable, arbitrary character, default is `'g'`
:param analytic: boolean
"""
self.n = n
self.gSeries = d
self.name = name
... | (sel | identifier_name | |
walrus_concurrency.py | #!/usr/bin/env python
import time
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
class WalrusConcurrent(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
s... |
if __name__ == "__main__":
testcase = WalrusConcurrent()
### Use the list of tests passed from config/command line to determine what subset of tests to run
### or use a predefined list
list = testcase.args.tests or ["Concurrent"]
### Convert test suite methods to EutesterUnitTest objects
uni... | key_payload = self.tester.id_generator(self.args.size)
thread_count = self.args.number
thread_pool = []
with ThreadPoolExecutor(max_workers=thread_count) as executor:
for i in xrange(thread_count):
thread_pool.append(executor.submit(self.tester.upload_obje... | identifier_body |
walrus_concurrency.py | #!/usr/bin/env python
import time
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
class WalrusConcurrent(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
s... | (self):
self.tester.clear_bucket(self.bucket_name)
def Concurrent(self):
key_payload = self.tester.id_generator(self.args.size)
thread_count = self.args.number
thread_pool = []
with ThreadPoolExecutor(max_workers=thread_count) as executor:
for i in xrange(thr... | clean_method | identifier_name |
walrus_concurrency.py | #!/usr/bin/env python
import time
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
class WalrusConcurrent(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
s... | self.bucket_name = "concurrency-" + str(int(self.start))
self.tester.create_bucket(self.bucket_name)
def clean_method(self):
self.tester.clear_bucket(self.bucket_name)
def Concurrent(self):
key_payload = self.tester.id_generator(self.args.size)
thread_count = self.args.... | self.tester = Eucaops( credpath=self.args.credpath, config_file=self.args.config,password=self.args.password)
self.start = time.time() | random_line_split |
walrus_concurrency.py | #!/usr/bin/env python
import time
from concurrent.futures import ThreadPoolExecutor
from eucaops import Eucaops
from eucaops import S3ops
from eutester.eutestcase import EutesterTestCase
class WalrusConcurrent(EutesterTestCase):
def __init__(self):
self.setuptestcase()
self.setup_parser()
s... |
else:
self.tester = Eucaops( credpath=self.args.credpath, config_file=self.args.config,password=self.args.password)
self.start = time.time()
self.bucket_name = "concurrency-" + str(int(self.start))
self.tester.create_bucket(self.bucket_name)
def clean_method(self):
... | self.tester = S3ops( credpath=self.args.credpath, region=self.args.region) | conditional_block |
skyeye_common_module.py | #### SkyEye common module ####
import os
from ctypes import *
libcommon_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libcommon.so" | libpmon_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libpmon.so"
libuart_16550_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libuart_16550.so"
libcodecov_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libcodecov.so"
libbus_log_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libbus_log.so"
libgdbserver_path = os.g... |
libcommon = CDLL(libcommon_path, RTLD_GLOBAL)
#### SkyEye other modules ####
libdisasm_path = os.getenv("SKYEYEBIN") + "/../lib/skyeye/libdisasm.so" | random_line_split |
session.service.ts | import { Injectable } from "@angular/core";
import { Session, SessionState } from "chipster-js-common";
import { forkJoin } from "rxjs";
import { flatMap, map } from "rxjs/operators";
import { RestErrorService } from "../../../core/errorhandler/rest-error.service";
import { SessionResource } from "../../../shared/resou... | {
constructor(
private sessionResource: SessionResource,
private dialogModalService: DialogModalService,
private restErrorService: RestErrorService,
private sessionDataService: SessionDataService,
private sessionWorkerResource: SessionWorkerResource
) {}
updateSession(session: Session) {
... | SessionService | identifier_name |
session.service.ts | import { Injectable } from "@angular/core";
import { Session, SessionState } from "chipster-js-common";
import { forkJoin } from "rxjs";
import { flatMap, map } from "rxjs/operators";
import { RestErrorService } from "../../../core/errorhandler/rest-error.service";
import { SessionResource } from "../../../shared/resou... | .subscribe(null, (err) => this.restErrorService.showError("Failed to edit session notes", err));
}
downloadSession(sessionId: string) {
const authenticatedUrl$ = forkJoin(
this.sessionWorkerResource.getPackageUrl(sessionId),
this.sessionDataService.getTokenForSession(sessionId)
).pipe(
... | random_line_split | |
session.service.ts | import { Injectable } from "@angular/core";
import { Session, SessionState } from "chipster-js-common";
import { forkJoin } from "rxjs";
import { flatMap, map } from "rxjs/operators";
import { RestErrorService } from "../../../core/errorhandler/rest-error.service";
import { SessionResource } from "../../../shared/resou... |
return this.updateSession(session);
})
)
.subscribe(null, (err) => this.restErrorService.showError("Rename session failed", err));
}
openNotesModalAndUpdate(session: Session) {
this.dialogModalService
.openNotesModal(session)
.pipe(
flatMap((notes: string) =>... | {
session.state = SessionState.Ready;
} | conditional_block |
session.service.ts | import { Injectable } from "@angular/core";
import { Session, SessionState } from "chipster-js-common";
import { forkJoin } from "rxjs";
import { flatMap, map } from "rxjs/operators";
import { RestErrorService } from "../../../core/errorhandler/rest-error.service";
import { SessionResource } from "../../../shared/resou... |
openNotesModalAndUpdate(session: Session) {
this.dialogModalService
.openNotesModal(session)
.pipe(
flatMap((notes: string) => {
session.notes = notes;
return this.updateSession(session);
})
)
.subscribe(null, (err) => this.restErrorService.showError("... | {
this.dialogModalService
.openSessionNameModal("Rename session", session.name)
.pipe(
flatMap((name: string) => {
session.name = name;
// 'save' temp session when renaming it
if (session.state === SessionState.TemporaryUnmodified || session.state === SessionState.... | identifier_body |
const-bound.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 ... | {
/*foo(1);
foo("hi".to_string());
foo(~[1, 2, 3]);
foo(F{field: 42});
foo((1, 2_usize));
foo(@1);*/
foo(box 1);
} | identifier_body | |
const-bound.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: Sync>(x: T) -> T { x }
struct F { field: int }
pub fn main() {
/*foo(1);
foo("hi".to_string());
foo(~[1, 2, 3]);
foo(F{field: 42});
foo((1, 2_usize));
foo(@1);*/
foo(box 1);
}
| foo | identifier_name |
const-bound.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 ... | foo(box 1);
} | foo(@1);*/ | random_line_split |
visualization.py | mn = min(start, end)
mx = max(start, end)
return start, end, mn, mx
def pretty_tree_horizontal(arrows, _do_print_debug_info=False):
"""Print the dependency tree horizontally
Args:
arrows:
_do_print_debug_info: (Default value = False)
Returns:
"""
# Set the base height;... | print('')
print('Rendering arrow %d: "%s" -> "%s"' % (arrow_index,
arrow['from'],
arrow['to']))
print(' height = %d' % height)
goes_up = src > dst
# Draw... | height = max(height, 3, len(lines[dst]) + 3)
arrow['height'] = height
if _do_print_debug_info: | random_line_split |
visualization.py | , mx
def pretty_tree_horizontal(arrows, _do_print_debug_info=False):
"""Print the dependency tree horizontally
Args:
arrows:
_do_print_debug_info: (Default value = False)
Returns:
"""
# Set the base height; these may increase to allow room for arrowheads after this.
arrows_wit... | ta
columns = [[] for i in ran | conditional_block | |
visualization.py | mn = min(start, end)
mx = max(start, end)
return start, end, mn, mx
def pretty_tree_horizontal(arrows, _do_print_debug_info=False):
"""Print the dependency tree horizontally
Args:
arrows:
_do_print_debug_info: (Default value = False)
Returns:
"""
# Set the base height; th... | - offset))
spans.extend(render_span(b, e, unidirectional))
center = b + (e - b) // 2
labels.extend([''] * (center - offset))
labels.append(label)
labels.extend([''] * (e - center - 1))
def main():
# arrows = [{'from': 1, 'to': 0}, {'from': 2, 'to': 1}, {'from': 2, 'to': 4}, {'from': 2, 'to': ... | ns.extend([''] * (b | identifier_name |
visualization.py | mn = min(start, end)
mx = max(start, end)
return start, end, mn, mx
def pretty_tree_horizontal(arrows, _do_print_debug_info=False):
"""Print the dependency tree horizontally
Args:
arrows:
_do_print_debug_info: (Default value = False)
Returns:
"""
# Set the base height; th... | spans.extend([''] * (b - offset))
spans.extend(render_span(b, e, unidirectional))
center = b + (e - b) // 2
labels.extend([''] * (center - offset))
labels.append(label)
labels.extend([''] * (e - center - 1))
def main():
# arrows = [{'from': 1, 'to': 0}, {'from': 2, 'to': 1}, {'from': 2, 't... | child in L[1]])
def render_labeled_span(b, e, spans, labels, label, offset, unidirectional=False):
| identifier_body |
step6_file.rs | #![feature(exit_status)]
extern crate mal;
use std::collections::HashMap;
use std::env as stdenv;
use mal::types::{MalVal, MalRet, MalError, err_str};
use mal::types::{symbol, _nil, string, list, vector, hash_map, malfunc};
use mal::types::MalError::{ErrString, ErrMalVal};
use mal::types::MalType::{Nil, False, Sym, ... | ,
_ => { // function call
let el = try!(eval_ast(tmp.clone(), env.clone()));
let args = match *el {
List(ref args,_) => args,
_ => return err_str("Invalid apply"),
};
return match *args.clone()[0] {
Func(f,_) => f(ar... | {
let a1 = (*args)[1].clone();
ast = try!(eval(a1, env.clone()));
env = env_root(&env);
continue 'tco;
} | conditional_block |
step6_file.rs | #![feature(exit_status)]
extern crate mal;
use std::collections::HashMap;
use std::env as stdenv;
use mal::types::{MalVal, MalRet, MalError, err_str};
use mal::types::{symbol, _nil, string, list, vector, hash_map, malfunc};
use mal::types::MalError::{ErrString, ErrMalVal};
use mal::types::MalType::{Nil, False, Sym, ... | _ => Ok(ast.clone()),
}
}
fn eval(mut ast: MalVal, mut env: Env) -> MalRet {
'tco: loop {
//println!("eval: {}, {}", ast, env.borrow());
//println!("eval: {}", ast);
match *ast {
List(_,_) => (), // continue
_ => return eval_ast(ast, env),
}
// apply list
mat... | {
match *ast {
Sym(_) => env_get(&env, &ast),
List(ref a,_) | Vector(ref a,_) => {
let mut ast_vec : Vec<MalVal> = vec![];
for mv in a.iter() {
let mv2 = mv.clone();
ast_vec.push(try!(eval(mv2, env.clone())));
}
Ok(match... | identifier_body |
step6_file.rs | #![feature(exit_status)]
extern crate mal;
use std::collections::HashMap;
use std::env as stdenv;
use mal::types::{MalVal, MalRet, MalError, err_str};
use mal::types::{symbol, _nil, string, list, vector, hash_map, malfunc};
use mal::types::MalError::{ErrString, ErrMalVal};
use mal::types::MalType::{Nil, False, Sym, ... | let c = try!(eval(a1, env.clone()));
match *c {
False | Nil => {
if args.len() >= 4 {
ast = args[3].clone();
continue 'tco;
} else {
return Ok(_nil());
... | let a1 = (*args)[1].clone(); | random_line_split |
step6_file.rs | #![feature(exit_status)]
extern crate mal;
use std::collections::HashMap;
use std::env as stdenv;
use mal::types::{MalVal, MalRet, MalError, err_str};
use mal::types::{symbol, _nil, string, list, vector, hash_map, malfunc};
use mal::types::MalError::{ErrString, ErrMalVal};
use mal::types::MalType::{Nil, False, Sym, ... | (str: String) -> MalRet {
reader::read_str(str)
}
// eval
fn eval_ast(ast: MalVal, env: Env) -> MalRet {
match *ast {
Sym(_) => env_get(&env, &ast),
List(ref a,_) | Vector(ref a,_) => {
let mut ast_vec : Vec<MalVal> = vec![];
for mv in a.iter() {
let mv2 ... | read | identifier_name |
PerfHud.tsx | /**
* 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/.
*/
import {client, events} from 'camelot-unchained';
import * as React from 'react';
export interface PerfPage ... | else {
current = pages.filter((p: PerfPage) => p.id == this.state.currentPage.id)[0];
if (typeof current == 'undefined') {
current = pages[0];
}
}
this.setState({
pages: pages,
minimized: this.state.minimized,
currentPage: current
});
}
onSelectedPageChanged = ... | {
current = pages[0];
} | conditional_block |
PerfHud.tsx | /**
* 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/.
*/
import {client, events} from 'camelot-unchained';
import * as React from 'react';
export interface PerfPage ... |
closeWindow(): void {
client.HideUI('perfhud');
}
componentDidMount() {
cuAPI.OnPerfUpdate(() => {
this.updatePages();
});
}
minMaxWindow = () => {
console.log('minmax');
this.setState({
pages: this.state.pages,
minimized: !this.state.minimized,
currentPage: n... | {
super(props);
this.state = {
pages: [],
minimized: true,
currentPage: null
};
} | identifier_body |
PerfHud.tsx | /**
* 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/.
*/
import {client, events} from 'camelot-unchained';
import * as React from 'react';
export interface PerfPage ... |
onSelectedPageChanged = (page: PerfPage) => {
this.setState({
pages: this.state.pages,
minimized: this.state.minimized,
currentPage: page
});
}
changePage = (id:number) => {
let current = this.state.pages[id];
this.changePerfPage(current);
}
changePerfPage = (page:Perf... | pages: pages,
minimized: this.state.minimized,
currentPage: current
});
} | random_line_split |
PerfHud.tsx | /**
* 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/.
*/
import {client, events} from 'camelot-unchained';
import * as React from 'react';
export interface PerfPage ... | () {
cuAPI.OnPerfUpdate(() => {
this.updatePages();
});
}
minMaxWindow = () => {
console.log('minmax');
this.setState({
pages: this.state.pages,
minimized: !this.state.minimized,
currentPage: null
});
}
updatePages = () => {
let updates = JSON.parse(client.per... | componentDidMount | identifier_name |
list_blobs_00.rs | use futures::stream::StreamExt;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// First we retrieve the account name and master key from environment variables.
let account =
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
le... | use azure_sdk_core::prelude::*;
use azure_sdk_storage_blob::prelude::*;
use azure_sdk_storage_core::prelude::*; | random_line_split | |
list_blobs_00.rs | use azure_sdk_core::prelude::*;
use azure_sdk_storage_blob::prelude::*;
use azure_sdk_storage_core::prelude::*;
use futures::stream::StreamExt;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> | {
panic!("The specified container must not exists!");
}
// create the container
client
.create_container()
.with_container_name(&container_name)
.with_public_access(PublicAccess::None)
.with_timeout(100)
.finalize()
.await?;
println!("Containe... | {
// First we retrieve the account name and master key from environment variables.
let account =
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
let master_key =
std::env::var("STORAGE_MASTER_KEY").expect("Set env variable STORAGE_MASTER_KEY first!");
... | identifier_body |
list_blobs_00.rs | use azure_sdk_core::prelude::*;
use azure_sdk_storage_blob::prelude::*;
use azure_sdk_storage_core::prelude::*;
use futures::stream::StreamExt;
use std::error::Error;
#[tokio::main]
async fn | () -> Result<(), Box<dyn Error>> {
// First we retrieve the account name and master key from environment variables.
let account =
std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!");
let master_key =
std::env::var("STORAGE_MASTER_KEY").expect("Set env variable ... | main | identifier_name |
module.tsx | import { DataSourcePlugin } from '@grafana/data';
import { ConfigEditor } from './components/ConfigEditor';
import { CloudWatchDatasource } from './datasource';
import { CloudWatchAnnotationsQueryCtrl } from './annotations_query_ctrl';
import { CloudWatchJsonData, CloudWatchQuery } from './types';
import { CloudWatchLo... | .setExploreLogsQueryField(CloudWatchLogsQueryEditor)
.setAnnotationQueryCtrl(CloudWatchAnnotationsQueryCtrl); | .setQueryEditorHelp(LogsCheatSheet)
.setConfigEditor(ConfigEditor)
.setQueryEditor(PanelQueryEditor)
.setMetadataInspector(MetaInspector)
.setExploreMetricsQueryField(PanelQueryEditor) | random_line_split |
runtime.js | // ECMAScript 5 strict mode
"use strict";
assert2(cr, "cr namespace not created");
assert2(cr.plugins_, "cr.plugins_ not created");
/////////////////////////////////////
// Plugin class
cr.plugins_.Rex_Parse_FileUpload = function(runtime)
{
this.runtime = runtime;
};
(function ()
{
var pluginProto = cr.plugins_.R... | pluginProto.cnds = new Cnds();
Cnds.prototype.OnUploadCompleted = function ()
{
return true;
};
Cnds.prototype.OnUploadError = function ()
{
return true;
};
//////////////////////////////////////
// Actions
function Acts() {};
pluginProto.acts = new Acts();
Acts.prototype.UploadIma... | ;
| identifier_body |
runtime.js | // ECMAScript 5 strict mode
"use strict";
assert2(cr, "cr namespace not created");
assert2(cr.plugins_, "cr.plugins_ not created");
/////////////////////////////////////
// Plugin class
cr.plugins_.Rex_Parse_FileUpload = function(runtime)
{
this.runtime = runtime;
};
(function ()
{
var pluginProto = cr.plugins_.R... | {};
pluginProto.exps = new Exps();
Exps.prototype.LastURL = function (ret)
{
var url = "";
if ((this.file_obj != null) && this.file_obj["url"])
url = this.file_obj["url"]();
ret.set_string(url);
};
Exps.prototype.LastFileName = function (ret)
{
var name = "";
if ((this... | ps() | identifier_name |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.