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 |
|---|---|---|---|---|
common.js | jQuery(document).ready(function() {
$('#btn_minimize').mouseover(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_minimize_over.png');
});
$('#btn_minimize').mouseout(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_... | (url, name, width, height, center, resize, scroll, posleft, postop) {
if (posleft != 0) { X = posleft }
if (postop != 0) { Y = postop }
if (!scroll) { scroll = 'yes' }
if (!resize) { resize = 'yes' }
if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {
X = (screen.width -... | popUp | identifier_name |
common.js | jQuery(document).ready(function() {
$('#btn_minimize').mouseover(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_minimize_over.png');
});
$('#btn_minimize').mouseout(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_... | else
{
// window is already open, update with content
Win.location = url;
}
Win.focus();
}
| {
if (posleft != 0) { X = posleft }
if (postop != 0) { Y = postop }
if (!scroll) { scroll = 'yes' }
if (!resize) { resize = 'yes' }
if ((parseInt (navigator.appVersion) >= 4 ) && (center)) {
X = (screen.width - width ) / 2;
Y = (screen.height - height) / 2;
}
... | identifier_body |
common.js | jQuery(document).ready(function() {
$('#btn_minimize').mouseover(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_minimize_over.png');
});
$('#btn_minimize').mouseout(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_... |
if (scroll != 0) { scroll = 1 }
if (!Win || Win.closed)
{
// display the popup window
var Win = window.open(url, name,'width='+width+',height='+height+',top='+Y+',left='+X+',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');
... | {
X = (screen.width - width ) / 2;
Y = (screen.height - height) / 2;
} | conditional_block |
common.js | jQuery(document).ready(function() {
$('#btn_minimize').mouseover(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_minimize_over.png');
});
$('#btn_minimize').mouseout(function() {
$('#btn_minimize').attr('src','/sites/all/themes/dustnetworks/images/btn_mi... | Win.focus();
} | else
{
// window is already open, update with content
Win.location = url;
} | random_line_split |
main.rs | // Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | {
// Note: This will need to change if the dependency version changes
let texture_synthesis_path =
Path::new("./external/remote_binary_dependencies__texture_synthesis_cli__0_8_0/cargo_bin_texture_synthesis");
// Run the command
let texture_synthesis_output = Command::new(texture_synthesis_path)
.... | identifier_body | |
main.rs | // Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | Path::new("./external/remote_binary_dependencies__texture_synthesis_cli__0_8_0/cargo_bin_texture_synthesis");
// Run the command
let texture_synthesis_output = Command::new(texture_synthesis_path)
.arg("--help")
.output()
.unwrap();
// Print the results
let mut writer = BufWriter::new(std... | // Note: This will need to change if the dependency version changes
let texture_synthesis_path = | random_line_split |
main.rs | // Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | () {
// Note: This will need to change if the dependency version changes
let texture_synthesis_path =
Path::new("./external/remote_binary_dependencies__texture_synthesis_cli__0_8_0/cargo_bin_texture_synthesis");
// Run the command
let texture_synthesis_output = Command::new(texture_synthesis_path)
... | main | identifier_name |
simpleScene.js | function report(str) {
console.log(str);
}
function vec3(x,y,z) { return new THREE.Vector3(x,y,z); }
SCENE = {};
SCENE.getCard = function(boxW, boxH, rotZ)
{
boxD = 0.1;
if (!rotZ)
rotZ = 0;
//report("getImageCard "+imageUrl);
var material = new THREE.MeshLambertMaterial(
{ color: 0xdddd... | light.shadowCameraBottom = -d;
light.shadowCameraFar = 1000;
light.shadowDarkness = 0.5;
scene.add( light );
// ground
if (useGround) {
var texLoader = new THREE.TextureLoader();
//var groundTexture = texLoader.load( "textures/terrain/grasslight-big.jpg" );
//groundTexture.repeat.set( 25,... | random_line_split | |
simpleScene.js |
function report(str) {
console.log(str);
}
function vec3(x,y,z) { return new THREE.Vector3(x,y,z); }
SCENE = {};
SCENE.getCard = function(boxW, boxH, rotZ)
{
boxD = 0.1;
if (!rotZ)
rotZ = 0;
//report("getImageCard "+imageUrl);
var material = new THREE.MeshLambertMaterial(
{ color: 0xdd... |
function render() {
var timer = Date.now() * 0.0002;
//sphere.position.copy( ballPosition );
//camera.lookAt( scene.position );
}
| {
requestAnimationFrame( animate );
render();
var time = Date.now();
//arrow.setLength( windMag );
//arrow.setDirection( SKIRT.windForce );
var ct = new Date().getTime() / 1000;
// Adjust
renderer.render( scene, camera );
stats.update();
} | identifier_body |
simpleScene.js |
function report(str) {
console.log(str);
}
function vec3(x,y,z) { return new THREE.Vector3(x,y,z); }
SCENE = {};
SCENE.getCard = function(boxW, boxH, rotZ)
{
boxD = 0.1;
if (!rotZ)
rotZ = 0;
//report("getImageCard "+imageUrl);
var material = new THREE.MeshLambertMaterial(
{ color: 0xdd... |
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
//
function animate() {
requestAnimationFrame( animate );
render();
var time = Date.now();
//arrow.setLe... | {
//controls = new THREE.TrackballControls( camera, container );
//controls = new THREE.EditorControls( camera, container );
//controls = new THREE.OrthographicTrackballControls( camera, container );
//controls = new THREE.OrbitControls( camera, container );
controls = new THREE.PVControls( camera, container, scen... | conditional_block |
simpleScene.js |
function report(str) {
console.log(str);
}
function vec3(x,y,z) { return new THREE.Vector3(x,y,z); }
SCENE = {};
SCENE.getCard = function(boxW, boxH, rotZ)
{
boxD = 0.1;
if (!rotZ)
rotZ = 0;
//report("getImageCard "+imageUrl);
var material = new THREE.MeshLambertMaterial(
{ color: 0xdd... | () {
requestAnimationFrame( animate );
render();
var time = Date.now();
//arrow.setLength( windMag );
//arrow.setDirection( SKIRT.windForce );
var ct = new Date().getTime() / 1000;
// Adjust
renderer.render( scene, camera );
stats.update();
}
function render() {
var timer = Dat... | animate | identifier_name |
signals_testing.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the... |
self.handler = self.generator.register_cllbck(
self.signal_name, __signal_callback)
self.watchdog.__enter__()
return [self.signal_catched_event, self.signal_arguments]
def __exit__(self, err_type, value, traceback):
self.generator.deregister_cllbck(self.signal_name, sel... | elf.signal_catched_event.set()
| conditional_block |
signals_testing.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the... | ):
# we need to release the waiting thread
self.signal_catched_event.set()
self.missed = True
# then we notify the error
# if the error_code is set to None, we're expecting it to fail.
if error_code is not None:
print("An expected s... | on_failure( | identifier_name |
signals_testing.py | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------- | # 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 option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABIL... | # Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it under | random_line_split |
signals_testing.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Liblarch - a library to handle directed acyclic graphs
# Copyright (c) 2011-2012 - Lionel Dricot & Izidor Matušov
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the... | ef init_signals(self):
'''
Initializes the gobject main loop so that signals can be used.
This function returns only when the gobject main loop is running
'''
def gobject_main_loop():
self.main_loop = GLib.MainLoop()
self.main_loop.run()
threading.... | identifier_body | |
hero.service.ts | import { Injectable } from '@angular/core'; // import Injectable
import { Headers, Http } from '@angular/http'; // import Headers and Http
import 'rxjs/add/operator/toPromise'; //
import { Hero } from './hero';
//import { HEROES } from './mock-heroes';
@Injectable()
export class HeroService {
private heroesUrl ... | (error: any): Promise<any> {
console.error('An error occured', error);
return Promise.reject(error.message || error);
}
private headers = new Headers({
'Content-Type': 'application/json'
});
constructor(private http: Http) { }
getHeroes(): Promise<Hero[]> {
return t... | handleError | identifier_name |
hero.service.ts | import { Injectable } from '@angular/core'; // import Injectable
import { Headers, Http } from '@angular/http'; // import Headers and Http
import 'rxjs/add/operator/toPromise'; //
import { Hero } from './hero';
//import { HEROES } from './mock-heroes';
@Injectable()
export class HeroService {
private heroesUrl ... | 'Content-Type': 'application/json'
});
constructor(private http: Http) { }
getHeroes(): Promise<Hero[]> {
return this.http.get(this.heroesUrl)
.toPromise()
.then(response => response.json().data as Hero[])
.catch(this.handleError);
}
... | private handleError(error: any): Promise<any> {
console.error('An error occured', error);
return Promise.reject(error.message || error);
}
private headers = new Headers({ | random_line_split |
hero.service.ts | import { Injectable } from '@angular/core'; // import Injectable
import { Headers, Http } from '@angular/http'; // import Headers and Http
import 'rxjs/add/operator/toPromise'; //
import { Hero } from './hero';
//import { HEROES } from './mock-heroes';
@Injectable()
export class HeroService {
private heroesUrl ... |
update(hero: Hero): Promise<Hero> {
const url = `${this.heroesUrl}/${hero.id}`;
return this.http
.put(url, JSON.stringify(hero), {
headers: this.headers
})
.toPromise()
.then(() => hero)
.catch(this.handleError);
}
... | {
return this.getHeroes()
.then(heroes => heroes.find(hero => hero.id === id));
} | identifier_body |
class_interpolation.ts | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div class="A{{p1}}B"></div>
<div class="A{{p1}}B{{p2}}C"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{... | <div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E{{p5}}F{{p6}}G{{p7}}H{{p8}}I{{p9}}J"></div>
`,
})
export class MyComponent {
p1 = 100;
p2 = 100;
p3 = 100;
p4 = 100;
p5 = 100;
p6 = 100;
p7 = 100;
p8 = 100;
p9 = 100;
}
@NgModule({declarations: [MyComponent]})
export class MyModule {
} | <div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E{{p5}}F{{p6}}G"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E{{p5}}F{{p6}}G{{p7}}H"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E{{p5}}F{{p6}}G{{p7}}H{{p8}}I"></div> | random_line_split |
class_interpolation.ts | import {Component, NgModule} from '@angular/core';
@Component({
selector: 'my-component',
template: `
<div class="A{{p1}}B"></div>
<div class="A{{p1}}B{{p2}}C"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{{p4}}E"></div>
<div class="A{{p1}}B{{p2}}C{{p3}}D{... | {
p1 = 100;
p2 = 100;
p3 = 100;
p4 = 100;
p5 = 100;
p6 = 100;
p7 = 100;
p8 = 100;
p9 = 100;
}
@NgModule({declarations: [MyComponent]})
export class MyModule {
}
| MyComponent | identifier_name |
_express_route_ports_locations_operations.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}'} # type: ignore | deserialized = self._deserialize('ExpressRoutePortsLocation', pipeline_response) | random_line_split |
_express_route_ports_locations_operations.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
... | list_of_elem = cls(list_of_elem) | conditional_block |
_express_route_ports_locations_operations.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | (
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.ExpressRoutePortsLocationListResult"]
"""Retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each
location. Available bandwidths can only be obtained when retrieving a s... | list | identifier_name |
_express_route_ports_locations_operations.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
def extract_data(pipeline_response):
deserialized = self._deserialize('ExpressRoutePortsLocationListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter... | header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
... | identifier_body |
Entity.js |
/**
* A 32-bit unsigned bitfield that describes an entity's classification(s)
* @typedef {number} EntityClass
*/
/**
* Enumerate entity classes
*/
const ENTITY = {
NULL: 0x00,
// Base celestial classes
ASTEROID: 0x01, // floating rock in space, orbits star
COMET: 0x02, // an asteroid ... |
}
/**
* A table describing an entity's display properties
*
* @typedef {Object} DisplayProperties
* @property {number} radius - The entity's real radius, in km
* @property {number} [minRadius=0] - The entity's minimum draw radius, in pixels
* @property {string} [color=#ffffff] - The entity's draw co... | {
this.xPos = xPos;
this.yPos = yPos;
this.system = system || this.system;
} | identifier_body |
Entity.js |
/**
* A 32-bit unsigned bitfield that describes an entity's classification(s)
* @typedef {number} EntityClass
*/
/**
* Enumerate entity classes
*/
const ENTITY = {
NULL: 0x00,
// Base celestial classes
ASTEROID: 0x01, // floating rock in space, orbits star
COMET: 0x02, // an asteroid ... |
}
} | {
RenderM.addRenderEntity(this);
} | conditional_block |
Entity.js | /**
* A 32-bit unsigned bitfield that describes an entity's classification(s)
* @typedef {number} EntityClass
*/
/**
* Enumerate entity classes
*/
const ENTITY = {
NULL: 0x00,
// Base celestial classes
ASTEROID: 0x01, // floating rock in space, orbits star
COMET: 0x02, // an asteroid wi... | MILITARY: 0x10000, // a military vessel belongs to an empire's military
COLONY: 0x20000 // a colony is a ground-based civilian population
};
/**
* An Entity is any object representing something in the game world. This may include: planets, stars, starships,
* cultures, empires, etc.
*/
clas... | STATION: 0x8000, // a station is a large habitable vessel with reduced maneuverability (if any) - can be orbital or ground-based
| random_line_split |
Entity.js |
/**
* A 32-bit unsigned bitfield that describes an entity's classification(s)
* @typedef {number} EntityClass
*/
/**
* Enumerate entity classes
*/
const ENTITY = {
NULL: 0x00,
// Base celestial classes
ASTEROID: 0x01, // floating rock in space, orbits star
COMET: 0x02, // an asteroid ... | (name, coords, displayProps, eClass) {
super(name, coords, eClass);
/** Set to true if this entity can be rendered */
this.canRender = true;
/** Entity's draw radius */
this.radius = displayProps.radius || 0;
/** Entity's minimum radius */
this.minRadius = displayProps.minRadius || 0;
/*... | constructor | identifier_name |
test_blackjack.py | #!/usr/bin/env python
"""
Test code for blackjack game. Tests can be run with py.test or nosetests
"""
from __future__ import print_function
from unittest import TestCase
from card_games import blackjack
from card_games.blackjack import BlackJack
print(blackjack.__file__)
class TestRule(TestCase):
def setUp(se... |
self.assertEqual(len(mygame.player_hand), 12) # Twelve cards in Player's hand
self.assertEqual(mygame.game_result(), 'bust') # Definitely a bust
| mygame.draw_card_player() | conditional_block |
test_blackjack.py | Test code for blackjack game. Tests can be run with py.test or nosetests
"""
from __future__ import print_function
from unittest import TestCase
from card_games import blackjack
from card_games.blackjack import BlackJack
print(blackjack.__file__)
class TestRule(TestCase):
def setUp(self):
pass
def... | #!/usr/bin/env python
""" | random_line_split | |
test_blackjack.py | #!/usr/bin/env python
"""
Test code for blackjack game. Tests can be run with py.test or nosetests
"""
from __future__ import print_function
from unittest import TestCase
from card_games import blackjack
from card_games.blackjack import BlackJack
print(blackjack.__file__)
class TestRule(TestCase):
def setUp(se... |
def tearDown(self):
pass
def test_init(self):
mygame = BlackJack()
self.assertEqual(len(mygame.player_hand), 2) # Initial hand for Player
self.assertEqual(len(mygame.dealer_hand), 2) # Initial hand for Dealer
def test_player_bust(self):
mygame = BlackJack()
... | pass | identifier_body |
test_blackjack.py | #!/usr/bin/env python
"""
Test code for blackjack game. Tests can be run with py.test or nosetests
"""
from __future__ import print_function
from unittest import TestCase
from card_games import blackjack
from card_games.blackjack import BlackJack
print(blackjack.__file__)
class TestRule(TestCase):
def setUp(se... | (self):
mygame = BlackJack()
self.assertEqual(len(mygame.player_hand), 2) # Initial hand for Player
self.assertEqual(len(mygame.dealer_hand), 2) # Initial hand for Dealer
def test_player_bust(self):
mygame = BlackJack()
for cnt in range(10): # Draw 10 cards - Sure to loos... | test_init | identifier_name |
filters.py | from rest_framework.filters import (
FilterSet
)
from trialscompendium.trials.models import Treatment
class TreatmentListFilter(FilterSet):
"""
Filter query list from treatment database table
"""
class Meta:
model = Treatment
fields = {'id': ['exact', 'in'],
'no_r... | }
order_by = ['tillage_practice', 'cropping_system', 'crops_grown'] | random_line_split | |
filters.py | from rest_framework.filters import (
FilterSet
)
from trialscompendium.trials.models import Treatment
class TreatmentListFilter(FilterSet):
| """
Filter query list from treatment database table
"""
class Meta:
model = Treatment
fields = {'id': ['exact', 'in'],
'no_replicate': ['exact', 'in', 'gte', 'lte'],
'nitrogen_treatment': ['iexact', 'in', 'icontains'],
'phosphate_treatmen... | identifier_body | |
filters.py | from rest_framework.filters import (
FilterSet
)
from trialscompendium.trials.models import Treatment
class TreatmentListFilter(FilterSet):
"""
Filter query list from treatment database table
"""
class | :
model = Treatment
fields = {'id': ['exact', 'in'],
'no_replicate': ['exact', 'in', 'gte', 'lte'],
'nitrogen_treatment': ['iexact', 'in', 'icontains'],
'phosphate_treatment': ['iexact', 'in', 'icontains'],
'tillage_practice': ['iex... | Meta | identifier_name |
Port.py | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... | (self):
"""
Validate the port.
The port must be non-empty and type must a possible type.
"""
Element.validate(self)
try: assert self.get_type() in self.TYPES
except AssertionError: self.add_error_message('Type "%s" is not a possible type.'%self.get_type())
def __str__(self):
if self.is_source():
re... | validate | identifier_name |
Port.py | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... |
def is_sink(self): return self in self.get_parent().get_sinks()
def is_source(self): return self in self.get_parent().get_sources()
def get_type(self): return self.get_parent().resolve_dependencies(self._type)
def get_connections(self):
"""
Get all connections that use this port.
@return a list of connectio... | return self._key | identifier_body |
Port.py | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... |
if self.is_sink():
return 'Sink - %s(%s)'%(self.get_name(), self.get_key())
def is_port(self): return True
def get_color(self): return '#FFFFFF'
def get_name(self): return self._name
def get_key(self): return self._key
def is_sink(self): return self in self.get_parent().get_sinks()
def is_source(self): ret... | return 'Source - %s(%s)'%(self.get_name(), self.get_key()) | conditional_block |
Port.py | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any ... | """
Get all enabled connections that use this port.
@return a list of connection objects
"""
return filter(lambda c: c.get_enabled(), self.get_connections()) | random_line_split | |
utils.rs | use byteorder::BigEndian;
use byteorder::ByteOrder;
use fcp_cryptoauth::CAWrapper;
use operation::{BackwardPath, ForwardPath};
use packets::switch::Payload as SwitchPayload;
use packets::switch::SwitchPacket;
use session_manager::{SessionHandle, TheirSessionHandle};
/// Creates a switch packet from a raw payload.
///... |
}
}
/// Creates a reply switch packet to an other switch packet.
/// The content of the reply is given as a byte array (returned by CryptoAuth's
/// `wrap_messages`).
pub fn make_reply<PeerId: Clone>(
replied_to_packet: &SwitchPacket,
reply_content: Vec<u8>,
inner_conn: &CAWrapper<PeerId>,
) -> Switch... | {
// Otherwise, it is a CryptoAuth data packet. We have to prepend
// the session handle to the reply.
// This handle is used by the peer to know this packet is coming
// from us.
let peer_handle = handle.unwrap().0;
SwitchPacket::new(path, SwitchP... | conditional_block |
utils.rs | use byteorder::BigEndian;
use byteorder::ByteOrder;
use fcp_cryptoauth::CAWrapper;
use operation::{BackwardPath, ForwardPath};
use packets::switch::Payload as SwitchPayload;
use packets::switch::SwitchPacket;
use session_manager::{SessionHandle, TheirSessionHandle};
/// Creates a switch packet from a raw payload.
///... | // from us.
let peer_handle = handle.unwrap().0;
SwitchPacket::new(path, SwitchPayload::CryptoAuthData(peer_handle, content))
}
}
}
/// Creates a reply switch packet to an other switch packet.
/// The content of the reply is given as a byte array (returned by CryptoAuth... | {
let first_four_bytes = BigEndian::read_u32(&content[0..4]);
match first_four_bytes {
0 | 1 => {
// If it is a CryptoAuth handshake Hello packet, send it as is.
let payload = SwitchPayload::CryptoAuthHello(content);
SwitchPacket::new(path, payload)
}
... | identifier_body |
utils.rs | use byteorder::BigEndian;
use byteorder::ByteOrder;
use fcp_cryptoauth::CAWrapper;
use operation::{BackwardPath, ForwardPath};
use packets::switch::Payload as SwitchPayload;
use packets::switch::SwitchPacket;
use session_manager::{SessionHandle, TheirSessionHandle};
/// Creates a switch packet from a raw payload.
///... | <PeerId: Clone>(
replied_to_packet: &SwitchPacket,
reply_content: Vec<u8>,
inner_conn: &CAWrapper<PeerId>,
) -> SwitchPacket {
let path = BackwardPath::from(replied_to_packet.label()).reverse();
new_from_raw_content(
path,
reply_content,
inner_conn
.peer_session_h... | make_reply | identifier_name |
utils.rs | use byteorder::BigEndian;
use byteorder::ByteOrder;
use fcp_cryptoauth::CAWrapper;
use operation::{BackwardPath, ForwardPath};
use packets::switch::Payload as SwitchPayload;
use packets::switch::SwitchPacket;
use session_manager::{SessionHandle, TheirSessionHandle};
/// Creates a switch packet from a raw payload.
///... | // This handle is used by the peer to know this packet is coming
// from us.
let peer_handle = handle.unwrap().0;
SwitchPacket::new(path, SwitchPayload::CryptoAuthData(peer_handle, content))
}
}
}
/// Creates a reply switch packet to an other switch packet.
/... | unimplemented!()
}
_ => {
// Otherwise, it is a CryptoAuth data packet. We have to prepend
// the session handle to the reply. | random_line_split |
navigation.controller.js |
/**
* @ngdoc controller
* @name NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationController($scope,$rootScope, $location, $log, navigationService, di... | }
});
//this reacts to the options item in the tree
$scope.$on("treeOptionsClick", function (ev, args) {
$scope.currentNode = args.node;
args.scope = $scope;
navigationService.showMenu(ev, args);
});
//this reacts to tree items themselves being... |
//Put the navigation service on this scope so we can use it's methods/properties in the view.
// IMPORTANT: all properties assigned to this scope are generally available on the scope object on dialogs since
// when we create a dialog we pass in this scope to be used for the dialog's scope instead of ... | identifier_body |
navigation.controller.js |
/**
* @ngdoc controller
* @name NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function Na | scope,$rootScope, $location, $log, navigationService, dialogService, historyService, sectionResource, angularHelper) {
//Put the navigation service on this scope so we can use it's methods/properties in the view.
// IMPORTANT: all properties assigned to this scope are generally available on the scope object... | vigationController($ | identifier_name |
navigation.controller.js |
/**
* @ngdoc controller
* @name NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationController($scope,$rootScope, $location, $log, navigationService, di... | }
//register it
angular.module('umbraco').controller("NavigationController", NavigationController); | action: action,
section: currentSection
});
};
| random_line_split |
navigation.controller.js |
/**
* @ngdoc controller
* @name NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationController($scope,$rootScope, $location, $log, navigationService, di... | });
/** Opens a dialog but passes in this scope instance to be used for the dialog */
$scope.openDialog = function (currentNode, action, currentSection) {
navigationService.showDialog({
scope: $scope,
node: currentNode,
action: action,
... |
//add action to the history service
historyService.add({name: n.name, link: n.view, icon: n.icon});
//not legacy, lets just set the route value and clear the query string if there is one.
$location.path(n.view).search(null);
}
| conditional_block |
test_config.py | # SPDX-License-Identifier: LGPL-3.0-or-later
import os
import sys
from rbnics.utils.config import Config
def test_config(tempdir):
# Create a default configuration
config = Config()
# Write config to stdout
print("===============")
config.write(sys.stdout)
print("===============")
# Cha... | # Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
# | random_line_split | |
test_config.py | # Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import sys
from rbnics.utils.config import Config
def test_config(tempdir):
# Create a default configuration
| assert os.path.isfile(os.path.join(tempdir, ".rbnicsrc"))
# Read back in
config2 = Config()
config2.read(tempdir)
# Write config2 to stdout
print("===============")
config2.write(sys.stdout)
print("===============")
# Check that read was successful
assert config == config2
| config = Config()
# Write config to stdout
print("===============")
config.write(sys.stdout)
print("===============")
# Change options
config.set("backends", "online backend", "online")
config.set("problems", "cache", {"disk"})
# Write config to stdout
print("===============")
... | identifier_body |
test_config.py | # Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import sys
from rbnics.utils.config import Config
def | (tempdir):
# Create a default configuration
config = Config()
# Write config to stdout
print("===============")
config.write(sys.stdout)
print("===============")
# Change options
config.set("backends", "online backend", "online")
config.set("problems", "cache", {"disk"})
# Wri... | test_config | identifier_name |
form.module.js | /**
* @author maurobuselli@gmail.com
*/
(function () {
'use strict';
angular.module('AngularPanelsApp.pages.form', ['ui.select', 'ngSanitize'])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) | .state('form.layouts', {
url: '/layouts',
templateUrl: 'app/pages/form/layouts/layouts.html',
title: 'Form Layouts',
sidebarMeta: {
order: 100,
},
})
.state('form.wizard',
{
url: '/wizard',
templateUrl: 'ap... | {
$stateProvider
.state('form', {
url: '/form',
template : '<ui-view autoscroll="true" autoscroll-body-top></ui-view>',
abstract: true,
title: 'Form Elements',
sidebarMeta: {
icon: 'ion-compose',
order: 250,
},
})
... | identifier_body |
form.module.js | /**
* @author maurobuselli@gmail.com
*/
(function () {
'use strict';
angular.module('AngularPanelsApp.pages.form', ['ui.select', 'ngSanitize'])
.config(routeConfig);
/** @ngInject */
function | ($stateProvider) {
$stateProvider
.state('form', {
url: '/form',
template : '<ui-view autoscroll="true" autoscroll-body-top></ui-view>',
abstract: true,
title: 'Form Elements',
sidebarMeta: {
icon: 'ion-compose',
order: 250,
... | routeConfig | identifier_name |
form.module.js | /**
* @author maurobuselli@gmail.com
*/
(function () {
'use strict';
angular.module('AngularPanelsApp.pages.form', ['ui.select', 'ngSanitize'])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
$stateProvider
.state('form', {
url: '/form',
t... | })(); | random_line_split | |
i18n-language-code.service.ts | // Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... | /**
* @fileoverview Service for informing of the i18n language code changes.
*/
import { downgradeInjectable } from '@angular/upgrade/static';
import { Injectable, EventEmitter } from '@angular/core';
import { AppConstants } from 'app.constants';
@Injectable({
providedIn: 'root'
})
export class I18nLanguageCodeSe... | random_line_split | |
i18n-language-code.service.ts | // Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... | () {}
getCurrentI18nLanguageCode(): string {
// TODO(#9154): Change I18nLanguageCodeService to "this".
return I18nLanguageCodeService.languageCode;
}
isCurrentLanguageRTL(): boolean {
return (
I18nLanguageCodeService.rtlLanguageCodes.indexOf(
this.getCurrentI18nLanguageCode()) !== -1);... | constructor | identifier_name |
i18n-language-code.service.ts | // Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... |
get onI18nLanguageCodeChange(): EventEmitter<string> {
// TODO(#9154): Change I18nLanguageCodeService to "this".
return I18nLanguageCodeService.languageCodeChangeEventEmitter;
}
setI18nLanguageCode(code: string): void {
// TODO(#9154): Change I18nLanguageCodeService to "this".
I18nLanguageCodeS... | {
return (
I18nLanguageCodeService.rtlLanguageCodes.indexOf(
this.getCurrentI18nLanguageCode()) !== -1);
} | identifier_body |
tcp.rs | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | {
inner: Arc<AcceptorInner>,
deadline: u64,
}
struct AcceptorInner {
listener: TcpListener,
abort: Event,
accept: Event,
closed: AtomicBool,
}
unsafe impl Sync for AcceptorInner {}
impl TcpAcceptor {
pub fn socket(&self) -> sock_t { self.inner.listener.socket() }
pub fn accept(&mut ... | TcpAcceptor | identifier_name |
tcp.rs | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | c::WSAEventSelect(socket, events[1], 0)
};
if ret != 0 { return Err(last_net_error()) }
set_nonblocking(socket, false);
return Ok(stream)
}
}
}
Err(eof())
}
pub f... | // to blocking mode
socket => {
let stream = TcpStream::new(socket);
let ret = unsafe { | random_line_split |
IfcElectricGenerator.g.ts |
import {BaseIfc} from "./BaseIfc"
import {IfcGloballyUniqueId} from "./IfcGloballyUniqueId.g"
import {IfcOwnerHistory} from "./IfcOwnerHistory.g"
import {IfcLabel} from "./IfcLabel.g"
import {IfcText} from "./IfcText.g"
import {IfcRelAssigns} from "./IfcRelAssigns.g"
import {IfcRelNests} from "./IfcRelNests.g"
import ... | (globalId : IfcGloballyUniqueId) {
super(globalId)
}
getStepParameters() : string {
var parameters = new Array<string>();
parameters.push(BaseIfc.toStepValue(this.GlobalId))
parameters.push(BaseIfc.toStepValue(this.OwnerHistory))
parameters.push(BaseIfc.toStepValue(this.Name))
parameters... | constructor | identifier_name |
IfcElectricGenerator.g.ts | import {BaseIfc} from "./BaseIfc"
import {IfcGloballyUniqueId} from "./IfcGloballyUniqueId.g"
import {IfcOwnerHistory} from "./IfcOwnerHistory.g"
import {IfcLabel} from "./IfcLabel.g"
import {IfcText} from "./IfcText.g"
import {IfcRelAssigns} from "./IfcRelAssigns.g"
import {IfcRelNests} from "./IfcRelNests.g"
import {... | }
getStepParameters() : string {
var parameters = new Array<string>();
parameters.push(BaseIfc.toStepValue(this.GlobalId))
parameters.push(BaseIfc.toStepValue(this.OwnerHistory))
parameters.push(BaseIfc.toStepValue(this.Name))
parameters.push(BaseIfc.toStepValue(this.Description))
parameters.p... | super(globalId) | random_line_split |
IfcElectricGenerator.g.ts |
import {BaseIfc} from "./BaseIfc"
import {IfcGloballyUniqueId} from "./IfcGloballyUniqueId.g"
import {IfcOwnerHistory} from "./IfcOwnerHistory.g"
import {IfcLabel} from "./IfcLabel.g"
import {IfcText} from "./IfcText.g"
import {IfcRelAssigns} from "./IfcRelAssigns.g"
import {IfcRelNests} from "./IfcRelNests.g"
import ... |
getStepParameters() : string {
var parameters = new Array<string>();
parameters.push(BaseIfc.toStepValue(this.GlobalId))
parameters.push(BaseIfc.toStepValue(this.OwnerHistory))
parameters.push(BaseIfc.toStepValue(this.Name))
parameters.push(BaseIfc.toStepValue(this.Description))
parameters.push(B... | {
super(globalId)
} | identifier_body |
bottomup.py | '''
Main learner class.
@author: anze.vavpetic@ijs.si
'''
from collections import defaultdict
from hedwig.core import UnaryPredicate, Rule, Example
from hedwig.core.settings import logger
from hedwig.stats.significance import is_redundant
from hedwig.stats.scorefunctions import interesting
class BottomUpLearner:
... | (self):
pass
| bottom_clause | identifier_name |
bottomup.py | '''
Main learner class.
@author: anze.vavpetic@ijs.si
'''
from collections import defaultdict
from hedwig.core import UnaryPredicate, Rule, Example
from hedwig.core.settings import logger
from hedwig.stats.significance import is_redundant
from hedwig.stats.scorefunctions import interesting
class BottomUpLearner:
... |
def get_subclasses(self, pred):
return self.pruned_subclasses[pred.label]
def get_superclasses(self, pred):
return self.pruned_superclasses_closure[pred]
def is_implicit_root(self, pred):
return pred in self.implicit_roots
def induce(self):
'''
Induces rules ... | implicit_roots = set()
n_examples = self.kb.n_examples()
for pred in self.kb.predicates:
if self.kb.n_members(pred) == n_examples:
implicit_roots.add(pred)
return implicit_roots | identifier_body |
bottomup.py | '''
Main learner class.
@author: anze.vavpetic@ijs.si
'''
from collections import defaultdict
from hedwig.core import UnaryPredicate, Rule, Example
from hedwig.core.settings import logger
from hedwig.stats.significance import is_redundant
from hedwig.stats.scorefunctions import interesting
class BottomUpLearner:
... | min_sup = lambda pred: self.kb.n_members(pred) >= self.min_sup
pruned_superclasses = {}
for pred in self.kb.predicates:
superclasses = self.kb.super_classes(pred)
pruned_superclasses[pred] = filter(min_sup, superclasses)
return pruned_superclasses
def _impli... |
def _pruned_superclasses(self): | random_line_split |
bottomup.py | '''
Main learner class.
@author: anze.vavpetic@ijs.si
'''
from collections import defaultdict
from hedwig.core import UnaryPredicate, Rule, Example
from hedwig.core.settings import logger
from hedwig.stats.significance import is_redundant
from hedwig.stats.scorefunctions import interesting
class BottomUpLearner:
... |
return pruned_superclasses
def _implicit_roots(self):
implicit_roots = set()
n_examples = self.kb.n_examples()
for pred in self.kb.predicates:
if self.kb.n_members(pred) == n_examples:
implicit_roots.add(pred)
return implicit_roots
def get... | superclasses = self.kb.super_classes(pred)
pruned_superclasses[pred] = filter(min_sup, superclasses) | conditional_block |
java-ls-tasks.js | // @ts-check
const gulp = require('gulp');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');
const serverDir = '../../../eclipse.jdt.ls';
const extensionDir = '../../lib/java/node/server';
gulp.task('download_java_server', () => {
downloa... |
else if (isMac()) {
command += '-Denvironment.os=macosx -Denvironment.ws=cocoa -Denvironment.arch=x86_64';
}
else if (isWin()) {
command += '-Denvironment.os=win32 -Denvironment.ws=win32 -Denvironment.arch=x86_64';
}
console.log('executing ' + command);
cp.execSync(command, { cw... | {
command += '-Denvironment.os=linux -Denvironment.ws=gtk -Denvironment.arch=x86_64';
} | conditional_block |
java-ls-tasks.js | // @ts-check
const gulp = require('gulp');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');
const serverDir = '../../../eclipse.jdt.ls';
const extensionDir = '../../lib/java/node/server';
gulp.task('download_java_server', () => {
downloa... |
function mvnw() {
return "./mvnw" + (isWin() ? ".cmd" : "");
} | {
return /^linux/.test(process.platform);
} | identifier_body |
java-ls-tasks.js | // @ts-check
const gulp = require('gulp');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');
const serverDir = '../../../eclipse.jdt.ls';
const extensionDir = '../../lib/java/node/server';
gulp.task('download_java_server', () => {
downloa... | () {
return /^linux/.test(process.platform);
}
function mvnw() {
return "./mvnw" + (isWin() ? ".cmd" : "");
} | isLinux | identifier_name |
java-ls-tasks.js | // @ts-check
const gulp = require('gulp');
const cp = require('child_process');
const decompress = require('gulp-decompress');
const download = require('gulp-download');
const serverDir = '../../../eclipse.jdt.ls';
const extensionDir = '../../lib/java/node/server';
gulp.task('download_java_server', () => {
downloa... | cp.execSync(mvnw() + ' -Pserver-distro clean package', { cwd: serverDir, stdio: [0, 1, 2] });
gulp.src(serverDir + '/org.eclipse.jdt.ls.product/distro/*.tar.gz')
.pipe(decompress())
.pipe(gulp.dest(extensionDir))
});
gulp.task('dev_java_server', () => {
let command = mvnw() + ' -Pserver-dis... | gulp.task('build_java_server', () => { | random_line_split |
mutation_rates.py | 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, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do... | rates[columns] = 10 ** rates[columns]
# sort out the required columns and names.
rates["hgnc"] = rates["gene"]
gencode = load_gencode(gencode_url)
recode = dict(zip(gencode["hgnc"], gencode["chrom"]))
rates["chrom"] = rates["hgnc"].map(recode)
rates = rates[["hgnc", "chrom", "syn",... | """ obtain the table of mutation rates from the Samocha et al paper
Rates for all genes can be obtained from the supplementary material of
Samocha et al. Nature Genetics 2014 doi:10.1038/ng.3050
Args:
rates_url: url to supplementary mutation rates table
gencode_url: url to gencode,... | identifier_body |
mutation_rates.py | 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, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do... |
# get the number of expected mutations, given the number of transmissions
expected["lof_indel"] = rates["frameshift"] * autosomal
expected["lof_snv"] = (rates[["non", "splice_site"]].sum(axis=1, skipna=True, **kwargs)) * autosomal
expected["missense_indel"] = (rates["frameshift"] / 9) * autosomal
... | kwargs = {'min_count': 1} | conditional_block |
mutation_rates.py | 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, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to ... | rates["chrom"] = rates["hgnc"].map(recode)
rates = rates[["hgnc", "chrom", "syn", "mis", "splice_site", "frameshift", "non"]]
return rates
def load_gencode(path):
""" load gencode table with HGNC symbols and chromosome coordinates
Args:
path: path to gzipped tab-separated tab... | # sort out the required columns and names.
rates["hgnc"] = rates["gene"]
gencode = load_gencode(gencode_url)
recode = dict(zip(gencode["hgnc"], gencode["chrom"])) | random_line_split |
mutation_rates.py | 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, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do... | (expected):
""" adapt indel rates for lower rate estimate from validated de novos
The indel mutation rates from Samocha et al., Nature Genetics 46:944-950
assume that the overall indel mutation rate is 1.25-fold greater than the
overall nonsense mutation rate, ie there are 1.25 times as many frames... | adjust_indel_rates | identifier_name |
index.tsx | import React from 'react';
import RcTree, { TreeNode } from 'rc-tree';
import animation from '../_util/openAnimation';
export interface AntTreeNodeProps {
disabled?: boolean;
disableCheckbox?: boolean;
title?: string | React.ReactNode;
key?: string;
isLeaf?: boolean;
}
export class AntTreeNode extends React... | onDrop?: (options: AntTreeNodeMouseEvent) => void;
style?: React.CSSProperties;
prefixCls?: string;
filterTreeNode?: (node: AntTreeNode) => boolean;
}
export default class Tree extends React.Component<TreeProps, any> {
static TreeNode = TreeNode;
static defaultProps = {
prefixCls: 'ant-tree',
chec... | /** drop 触发时调用 */ | random_line_split |
index.tsx | import React from 'react';
import RcTree, { TreeNode } from 'rc-tree';
import animation from '../_util/openAnimation';
export interface AntTreeNodeProps {
disabled?: boolean;
disableCheckbox?: boolean;
title?: string | React.ReactNode;
key?: string;
isLeaf?: boolean;
}
export class AntTreeNode extends React... | () {
return <AntTreeNode {...this.props} />;
}
}
export interface AntTreeNodeEvent {
event: 'check' | 'select';
node: AntTreeNode;
checked?: boolean;
checkedNodes?: Array<AntTreeNode>;
selected?: boolean;
selectedNodes?: Array<AntTreeNode>;
}
export interface AntTreeNodeMouseEvent {
node: AntTreeN... | render | identifier_name |
validate-xml.js | 'use strict';
/**
* Validate that a given XML document conforms to a given XML schema. XML Schema Definition (XSD) is the expected schema format.
*
* @param {document} xmlDocument xml to validate
* @param {document} schemaDocument schema to enforce
* @param {string} schemaFolderId if your schema utilizes <import>... | if (!xmlDocument) {
throw nlapiCreateError('SSS_DOCUMENT_ARG_REQD');
} else if (!schemaDocument) {
throw nlapiCreateError('SSS_SCHEMA_ARG_REQD');
} else {
// FIXME validate XML generate by xmldom
return true;
}
}; | * @since 2014.1
*/
exports.nlapiValidateXML = (xmlDocument, schemaDocument, schemaFolderId) => { | random_line_split |
validate-xml.js | 'use strict';
/**
* Validate that a given XML document conforms to a given XML schema. XML Schema Definition (XSD) is the expected schema format.
*
* @param {document} xmlDocument xml to validate
* @param {document} schemaDocument schema to enforce
* @param {string} schemaFolderId if your schema utilizes <import>... | else {
// FIXME validate XML generate by xmldom
return true;
}
};
| {
throw nlapiCreateError('SSS_SCHEMA_ARG_REQD');
} | conditional_block |
pm_test.py |
"""
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net
Copyright (c) 2010 OSTIS
OSTIS is free software: you can redistribute it and/or modify
it under the ter... |
class TestOp(pm.ScOperationActSetMember):
def __init__(self, aset):
pm.ScOperationActSetMember.__init__(self, "Test", aset)
def activateImpl(self, arc, el):
print "Hello"
Processor({'repo_path': '../repo/fs_repo'})
#call = Callback()
#time.sleep(5)
#print "Open segment"
#seg ... | int str(params)
| identifier_body |
pm_test.py |
"""
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net
Copyright (c) 2010 OSTIS
OSTIS is free software: you can redistribute it and/or modify
it under the ter... | hreading.Thread):
def __init__(self, params = {}):
"""Constuructor
@param params: dictionary with parameters to start processor module
Available parameters:
repo_path - path to repository folder
@type params: dict
"""
threading.Thread.__init__(s... | ocessor(t | identifier_name |
pm_test.py |
"""
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net
Copyright (c) 2010 OSTIS
OSTIS is free software: you can redistribute it and/or modify
it under the ter... |
self.start()
def run(self):
try:
pm.do_init(False, True, self.__repo_path, False)
pm.do_dedicated(False)
except:
print "Error:", sys.exc_info()[0]
traceback.print_exc(file=sys.stdout)
return
self.st... | lf.__repo_path = params['repo_path']
| conditional_block |
pm_test.py |
"""
-----------------------------------------------------------------------------
This source file is part of OSTIS (Open Semantic Technology for Intelligent Systems)
For the latest info, see http://www.ostis.net
Copyright (c) 2010 OSTIS
OSTIS is free software: you can redistribute it and/or modify
it under the ter... | #oper.registerOperation()
#
#node1 = pm.get_session().create_el(seg, pm.SC_N_CONST)
#line = pm.get_session().create_el(seg, pm.SC_A_CONST)
#
#pm.get_session().set_beg(line, node)
#pm.get_session().set_end(line, node1)
#line = pm.get_session().gen3_f_a_f(node, line, seg, pm.SC_A_CONST, node1) | #print "Attach event"
##call.attach_to(pm.get_session(), pm.SC_WAIT_HACK_SET_MEMBER, pm.ADDR_AS_PAR(node), 1)
#
#oper = TestOp(node) | random_line_split |
github_repositorypermissions.rs | /* | * Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct GithubRepositorypermissions {... | * Swaggy Jenkins
* | random_line_split |
github_repositorypermissions.rs | /*
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Githu... |
}
| {
GithubRepositorypermissions {
admin: None,
push: None,
pull: None,
_class: None,
}
} | identifier_body |
github_repositorypermissions.rs | /*
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct | {
#[serde(rename = "admin", skip_serializing_if = "Option::is_none")]
pub admin: Option<bool>,
#[serde(rename = "push", skip_serializing_if = "Option::is_none")]
pub push: Option<bool>,
#[serde(rename = "pull", skip_serializing_if = "Option::is_none")]
pub pull: Option<bool>,
#[serde(rename... | GithubRepositorypermissions | identifier_name |
AcgnzSpider01.py | # -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy.utils.project import get_project_settings
from time import sleep
from AcgnzSpider.items import AcgnzItem
class AcgnzSpider(scrapy.Spider):
name = 'acgnz.cc'
start_urls = ['http://www.acgnz.cc/sign']
allowed_domains = ['acgnz.cc']
def... | item = response.meta['item']
item['download_link'] = response.selector.xpath('//div[@class="post-download"]').xpath(
'.//a[@class="btn btn-lg btn-success btn-block"]/@href')[-1].extract()
if response.selector.xpath(
'//div[@class="post-download"]').xpath('.//input[@id="them... | identifier_body | |
AcgnzSpider01.py | # -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy.utils.project import get_project_settings
from time import sleep
from AcgnzSpider.items import AcgnzItem
class AcgnzSpider(scrapy.Spider):
name = 'acgnz.cc'
start_urls = ['http://www.acgnz.cc/sign']
allowed_domains = ['acgnz.cc']
def... | (self, response):
item = response.meta['item']
item['download_link'] = response.selector.xpath('//div[@class="post-download"]').xpath(
'.//a[@class="btn btn-lg btn-success btn-block"]/@href')[-1].extract()
if response.selector.xpath(
'//div[@class="post-download"]')... | parse_download_page | identifier_name |
AcgnzSpider01.py | # -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy.utils.project import get_project_settings
from time import sleep
from AcgnzSpider.items import AcgnzItem
class AcgnzSpider(scrapy.Spider):
name = 'acgnz.cc'
start_urls = ['http://www.acgnz.cc/sign']
allowed_domains = ['acgnz.cc']
def... | yield scrapy.Request(download_page_href, meta={'item': item}, callback=self.parse_download_page)
else:
item['download_link'] = ''
item['download_code'] = ''
item['unarchive_password'] = ''
yield item
def parse_download_page... | item['image_urls'] = response.selector.xpath(
'//div[@class="entry-content content-reset"]').xpath('.//img/@src').extract()
if response.selector.xpath('//div[@class="entry-circle"]/a[@class="meta meta-post-storage"]/@href'):
download_page_href = response.selector.... | random_line_split |
AcgnzSpider01.py | # -*- coding: utf-8 -*-
import scrapy
import logging
from scrapy.utils.project import get_project_settings
from time import sleep
from AcgnzSpider.items import AcgnzItem
class AcgnzSpider(scrapy.Spider):
name = 'acgnz.cc'
start_urls = ['http://www.acgnz.cc/sign']
allowed_domains = ['acgnz.cc']
def... |
def parse_page(self, response):
if response.status == 302:
pass
else:
item = AcgnzItem()
item['url'] = response.url
item['title'] = (response.selector.xpath('//div[@class="entry-content content-reset"]').xpath(
'.//a/@title').extract(... | yield scrapy.Request(
'http://www.acgnz.cc/{index}'.format(index=i),
meta={'dont_redirect': True,
'handle_httpstatus_list': [302]},
callback=self.parse_page) | conditional_block |
EventList.tsx | import * as React from 'react';
import * as Kurve from 'kurvejs';
import * as Utilities from './Utilities';
import Combine = Utilities.Combine;
import EventSummary from './EventSummary';
const summaryStyle: React.CSSProperties = {
padding: 0,
paddingTop: 10,
paddingBottom: 10,
paddingRight: 15,
pa... | interface EventListProps extends React.Props<EventList> {
events: Kurve.EventDataModel[];
selectedEvent?: Kurve.EventDataModel;
onSelect(eventId: string);
}
export default class EventList extends React.Component<EventListProps, any> {
render() {
var lastDate = "";
var eventSummaries = t... |
const informationStyle = Combine(summaryStyle, {
backgroundColor: "LightGrey"
});
| random_line_split |
dynamodb.rs | #![cfg(feature = "dynamodb")]
extern crate rusoto;
use rusoto::dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;
#[test]
fn | () {
let credentials = DefaultCredentialsProvider::new().unwrap();
let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);
// limit of -1 should generate a validation error
let request = ListTablesInput { limit: Some(-1), ..Default::default() };
let response ... | should_parse_error_type | identifier_name |
dynamodb.rs | #![cfg(feature = "dynamodb")]
extern crate rusoto;
use rusoto::dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;
#[test]
fn should_parse_error_type() {
let credentials = DefaultCredentialsProvider::new().unwra... |
_ => panic!("Should have been a Validation error"),
};
}
#[test]
fn should_list_tables() {
let credentials = DefaultCredentialsProvider::new().unwrap();
let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);
let request = ListTablesInput::default();
... | {
assert!(msg.contains("Member must have value greater than or equal to 1"))
} | conditional_block |
dynamodb.rs | #![cfg(feature = "dynamodb")]
extern crate rusoto;
use rusoto::dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;
#[test]
fn should_parse_error_type() {
let credentials = DefaultCredentialsProvider::new().unwra... | fn should_list_tables() {
let credentials = DefaultCredentialsProvider::new().unwrap();
let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);
let request = ListTablesInput::default();
client.list_tables(&request).unwrap();
} | random_line_split | |
dynamodb.rs | #![cfg(feature = "dynamodb")]
extern crate rusoto;
use rusoto::dynamodb::{DynamoDb, DynamoDbClient, ListTablesInput, ListTablesError};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::default_tls_client;
#[test]
fn should_parse_error_type() {
let credentials = DefaultCredentialsProvider::new().unwra... | {
let credentials = DefaultCredentialsProvider::new().unwrap();
let client = DynamoDbClient::new(default_tls_client().unwrap(), credentials, Region::UsEast1);
let request = ListTablesInput::default();
client.list_tables(&request).unwrap();
} | identifier_body | |
__init__.py | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
tokens.append(key[s:i])
_reverse_aggs(tokens)
# tokens.reverse()
source = {
"id": format_id(tokens[0])
}
for i in range(2, len(tokens), 2):
source = {
"id": format_id(tokens[i]),
"source": source,
"type": "join" if tokens[i - 1] == "." else "... | tokens.append(key[s:i])
tokens.append(key[i])
s = i + 1
i = strings.find(key, [":", "."], s) | conditional_block |
__init__.py | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... | (key):
"""
CONVERT S3 KEY TO ETL HEADER
S3 NAMING CONVENTION: a.b.c WHERE EACH IS A STEP IN THE ETL PROCESS
HOW TO DEAL WITH a->b AS AGGREGATION? b:a.c? b->c is agg: a.c:b
"""
key = s3.strip_extension(key)
tokens = []
s = 0
i = strings.find(key, [":", "."])
while i < len(key... | _key2etl | identifier_name |
__init__.py | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... | while i < len(key):
tokens.append(key[s:i])
tokens.append(key[i])
s = i + 1
i = strings.find(key, [":", "."], s)
tokens.append(key[s:i])
_reverse_aggs(tokens)
# tokens.reverse()
source = {
"id": format_id(tokens[0])
}
for i in range(2, len(tokens), 2)... | random_line_split | |
__init__.py | # encoding: utf-8
#
#
# 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import
from __... |
def format_id(value):
"""
:param value:
:return: int() IF POSSIBLE
"""
try:
return int(value)
except Exception:
return unicode(value)
def lt(l, r):
"""
:param l: left key
:param r: right key
:return: True if l<r
"""
if r is None or l is None:
... | for i in range(1, len(seq), 2):
if seq[i] == ":":
seq[i - 1], seq[i + 1] = seq[i + 1], seq[i - 1] | identifier_body |
gama_data_fun.py | # gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
"""
module with functions for
gama-data-obs.py and gama-data-adj.py scripts
"""
import sys
def read_configuration_file(configFile, localSystem2D, localSyst... | if localSystem2D:
if "localSystem2D" not in configDict:
print >>sys.stderr, \
"No localSystem2D section in config file %s" % configFile
sys.exit(1)
else:
from gizela.util.CoordSystemLocal2D import CoordSystemLocal2D
... | """
reads configuration file
returns: configuration dictionary
localSystem
"""
configDict = []
localSystem = None
if configFile is not None:
from gizela.util.parse_config_file import parse_config_file
try:
configDict = parse_config_file(configFile)
... | identifier_body |
gama_data_fun.py | # gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
"""
module with functions for
gama-data-obs.py and gama-data-adj.py scripts
"""
import sys
def | (configFile, localSystem2D, localSystem3D):
"""
reads configuration file
returns: configuration dictionary
localSystem
"""
configDict = []
localSystem = None
if configFile is not None:
from gizela.util.parse_config_file import parse_config_file
try:
... | read_configuration_file | identifier_name |
gama_data_fun.py | # gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$ | """
module with functions for
gama-data-obs.py and gama-data-adj.py scripts
"""
import sys
def read_configuration_file(configFile, localSystem2D, localSystem3D):
"""
reads configuration file
returns: configuration dictionary
localSystem
"""
configDict = []
localSystem = None
... | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.