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
Dragon.js
var babylon = require('babylonjs'); const TEXTURE_PATH = 'textures/dragon.png'; export default class Dragon { constructor(options)
curSpeed = maxSpeed; } else if (distance <= 20) { curSpeed = (20-distance)/20 * player.camera.speed; if (player.crazy) { curSpeed *= 0.5; } else { curSpeed *= 1.5; } } this.sprite.position.z += curSpeed; }); } }
{ // First animated player this.sprite = new babylon.Sprite("player", new babylon.SpriteManager('dragonManager', TEXTURE_PATH, 2, 128, options.scene)); this.sprite.playAnimation(12, 16, true, 100); this.sprite.position.z = 2; this.sprite.position.y = 2; this.sprite.size = 1; this.sprite.isPi...
identifier_body
Dragon.js
var babylon = require('babylonjs'); const TEXTURE_PATH = 'textures/dragon.png'; export default class Dragon { constructor(options) { // First animated player this.sprite = new babylon.Sprite("player", new babylon.SpriteManager('dragonManager', TEXTURE_PATH, 2, 128, options.scene)); this.sprite.playAnimat...
}
}); }
random_line_split
Dragon.js
var babylon = require('babylonjs'); const TEXTURE_PATH = 'textures/dragon.png'; export default class Dragon { constructor(options) { // First animated player this.sprite = new babylon.Sprite("player", new babylon.SpriteManager('dragonManager', TEXTURE_PATH, 2, 128, options.scene)); this.sprite.playAnimat...
else if (distance <= 20) { curSpeed = (20-distance)/20 * player.camera.speed; if (player.crazy) { curSpeed *= 0.5; } else { curSpeed *= 1.5; } } this.sprite.position.z += curSpeed; }); } }
{ curSpeed = maxSpeed; }
conditional_block
Dragon.js
var babylon = require('babylonjs'); const TEXTURE_PATH = 'textures/dragon.png'; export default class Dragon {
(options) { // First animated player this.sprite = new babylon.Sprite("player", new babylon.SpriteManager('dragonManager', TEXTURE_PATH, 2, 128, options.scene)); this.sprite.playAnimation(12, 16, true, 100); this.sprite.position.z = 2; this.sprite.position.y = 2; this.sprite.size = 1; this.s...
constructor
identifier_name
capture-analysis-2.rs
// edition:2021 #![feature(rustc_attrs)] #[derive(Debug)]
x: String, y: i32, } fn main() { let mut p = Point { x: String::new(), y: 10 }; let c = #[rustc_capture_analysis] //~^ ERROR: attributes on expressions are experimental //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> || { //~^ First Pass analysis includes: ...
struct Point {
random_line_split
capture-analysis-2.rs
// edition:2021 #![feature(rustc_attrs)] #[derive(Debug)] struct
{ x: String, y: i32, } fn main() { let mut p = Point { x: String::new(), y: 10 }; let c = #[rustc_capture_analysis] //~^ ERROR: attributes on expressions are experimental //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> || { //~^ First Pass analysis include...
Point
identifier_name
user.repository.ts
import { IApiConfig } from '../../api.config'; import { RepositoryBase, IRepository, IGetAllCriteria } from '../../lib'; import { IUser, UserValidator } from '../../../public/shared/models'; import { ObjectID, Collection, MongoError } from 'mongodb'; import { Observable, Subject } from 'rxjs/Rx'; export interface IUse...
extends RepositoryBase<IUser> implements IUserRepository { constructor(config: IApiConfig, validator: UserValidator) { super(config, 'users', validator); } // // db.users.insert({ forename: 'Nick', surname: 'Morton', dob: new Date(1959, 9, 20) }) // // db.users.insert({ forename: 'Liz', surname: 'Morton', dob: ...
UserRepository
identifier_name
user.repository.ts
import { IApiConfig } from '../../api.config'; import { RepositoryBase, IRepository, IGetAllCriteria } from '../../lib'; import { IUser, UserValidator } from '../../../public/shared/models'; import { ObjectID, Collection, MongoError } from 'mongodb'; import { Observable, Subject } from 'rxjs/Rx'; export interface IUse...
subject.next(users); subject.complete(); }); }); } }
{ throw new Error(err.message); }
conditional_block
user.repository.ts
import { IApiConfig } from '../../api.config'; import { RepositoryBase, IRepository, IGetAllCriteria } from '../../lib'; import { IUser, UserValidator } from '../../../public/shared/models'; import { ObjectID, Collection, MongoError } from 'mongodb'; import { Observable, Subject } from 'rxjs/Rx'; export interface IUse...
} }
random_line_split
shader.rs
// Copyright 2015 Ilkka Rauta // // 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 ...
ShaderType::VertexShader => gl::VERTEX_SHADER, ShaderType::FragmentShader => gl::FRAGMENT_SHADER } }
fn shader_type_to_enum(shader_type: ShaderType) -> GLenum { match shader_type {
random_line_split
shader.rs
// Copyright 2015 Ilkka Rauta // // 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 ...
(&self) -> bool { let mut compile_status = 0; unsafe { gl::GetShaderiv(self.id, gl::COMPILE_STATUS, &mut compile_status); check_error!(); } compile_status == (gl::TRUE as i32) } fn get_info_length(&self) -> GLsizei { let mut info_length = 0; ...
get_compile_status
identifier_name
shader.rs
// Copyright 2015 Ilkka Rauta // // 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 ...
fn get_info_log(&self) -> String { let info_length = self.get_info_length(); let mut actual_info_length = 0; let mut info_vec: Vec<u8> = repeat(0u8).take(info_length as usize).collect(); unsafe { let info_vec_ptr = info_vec.as_mut_ptr() as *mut i8; gl::GetSh...
{ self.id }
identifier_body
__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
(Test): endpoints = ['app', 'task', 'taskrun', 'user']
TestAPI
identifier_name
__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
endpoints = ['app', 'task', 'taskrun', 'user']
identifier_body
__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
from default import Test, with_context from factories import reset_all_pk_sequences class TestAPI(Test): endpoints = ['app', 'task', 'taskrun', 'user']
random_line_split
test_qc.py
from __future__ import division from dask.array import from_array from numpy.random import RandomState from numpy.testing import assert_allclose, assert_equal from limix.qc import compute_maf, indep_pairwise def test_qc_indep_pairwise(): random = RandomState(0) X = random.randn(3, 100) head = [True, T...
(): random = RandomState(0) X = random.randint(0, 3, size=(100, 10)) assert_allclose( compute_maf(X), [0.49, 0.49, 0.445, 0.495, 0.5, 0.45, 0.48, 0.48, 0.47, 0.435] )
test_qc_maf
identifier_name
test_qc.py
from __future__ import division from dask.array import from_array from numpy.random import RandomState from numpy.testing import assert_allclose, assert_equal from limix.qc import compute_maf, indep_pairwise def test_qc_indep_pairwise(): random = RandomState(0) X = random.randn(3, 100) head = [True, T...
compute_maf(X), [0.49, 0.49, 0.445, 0.495, 0.5, 0.45, 0.48, 0.48, 0.47, 0.435] )
X = random.randint(0, 3, size=(100, 10)) assert_allclose(
random_line_split
test_qc.py
from __future__ import division from dask.array import from_array from numpy.random import RandomState from numpy.testing import assert_allclose, assert_equal from limix.qc import compute_maf, indep_pairwise def test_qc_indep_pairwise():
def test_qc_maf(): random = RandomState(0) X = random.randint(0, 3, size=(100, 10)) assert_allclose( compute_maf(X), [0.49, 0.49, 0.445, 0.495, 0.5, 0.45, 0.48, 0.48, 0.47, 0.435] )
random = RandomState(0) X = random.randn(3, 100) head = [True, True, False, True, False] tail = [True, True, False, False] assert_equal(indep_pairwise(X, 4, 2, 0.5, verbose=False)[:5], head) assert_equal(indep_pairwise(X, 4, 2, 0.5, verbose=False)[-4:], tail) X = from_array(X, chunks=(2, 10)...
identifier_body
DropdownMenu.d.ts
import * as React from "react"; import Overlay = require("./Overlay"); declare class
extends React.Component< DropdownMenu.DropdownMenuProps > {} export = DropdownMenu; declare namespace DropdownMenu { interface DropdownMenuRenderProps extends Overlay.OverlayRenderProps { alignEnd: boolean; close(event: React.SyntheticEvent<any>): void; } interface DropdownMenuProps {...
DropdownMenu
identifier_name
DropdownMenu.d.ts
import * as React from "react"; import Overlay = require("./Overlay"); declare class DropdownMenu extends React.Component< DropdownMenu.DropdownMenuProps > {} export = DropdownMenu; declare namespace DropdownMenu { interface DropdownMenuRenderProps extends Overlay.OverlayRenderProps { alignEnd: boole...
/** * A set of popper options and props passed directly to react-popper's Popper component. */ popperConfig?: object; /** * Override the default event used by RootCloseWrapper. */ rootCloseEvent?: string; } }
random_line_split
app-routing.module.ts
import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {HomeComponent} from './home/home.component'; import {ProductComponent} from './product/product.component'; import {Code404Component} from './code404/code404.component'; import {ProductDescComponent} from './product-des...
/*{ path: 'product/:id', component: ProductComponent, children: [{path: '', component: ProductDescComponent}, {path: 'seller/:id', component: SellerInfoComponent}] },*/ // 演示路由守卫 canActivate、canDeactivate /*{ path: 'product/:id', component: ProductComponent, children: [{path: '', compon...
random_line_split
app-routing.module.ts
import {NgModule} from '@angular/core'; import {RouterModule, Routes} from '@angular/router'; import {HomeComponent} from './home/home.component'; import {ProductComponent} from './product/product.component'; import {Code404Component} from './code404/code404.component'; import {ProductDescComponent} from './product-des...
identifier_name
validate_json_format.py
import codecs import json import re RE_LINE_PRESERVE = re.compile(r'\r?\n', re.MULTILINE) RE_COMMENT = re.compile( r'''(?x) (?P<comments> /\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comments | [ \t]*//(?:[^\r\n])* # single line comments ) | (?P<code> ...
(self, code, line=None): """Log failure. Log failure code, line number (if available) and message. """ if line: print("%s: Line %d - %s" % (code, line, VIOLATION_MSG[code])) else: print("%s: %s" % (code, VIOLATION_MSG[code])) self.fail = True ...
log_failure
identifier_name
validate_json_format.py
import codecs import json import re RE_LINE_PRESERVE = re.compile(r'\r?\n', re.MULTILINE) RE_COMMENT = re.compile( r'''(?x) (?P<comments> /\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comments | [ \t]*//(?:[^\r\n])* # single line comments ) | (?P<code> ...
f.seek(0) text = f.read() self.index_lines(text) text = self.check_comments(text) self.index_lines(text) text = self.check_dangling_commas(text) try: json.loads(text) except Exception as e: self.log_failure(E_MALFORMED) ...
if count == 1 and line.strip() == '': self.log_failure(W_NL_START, count) if not line.endswith('\n'): self.log_failure(W_NL_END, count) if RE_TRAILING_SPACES.match(line): self.log_failure(W_TRAILING_SPACE, count) ...
conditional_block
validate_json_format.py
import codecs import json import re RE_LINE_PRESERVE = re.compile(r'\r?\n', re.MULTILINE) RE_COMMENT = re.compile( r'''(?x) (?P<comments> /\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comments | [ \t]*//(?:[^\r\n])* # single line comments ) | (?P<code> ...
def log_failure(self, code, line=None): """Log failure. Log failure code, line number (if available) and message. """ if line: print("%s: Line %d - %s" % (code, line, VIOLATION_MSG[code])) else: print("%s: %s" % (code, VIOLATION_MSG[code])) s...
map(lambda m: evaluate(m), RE_TRAILING_COMMA.finditer(text)))
random_line_split
validate_json_format.py
import codecs import json import re RE_LINE_PRESERVE = re.compile(r'\r?\n', re.MULTILINE) RE_COMMENT = re.compile( r'''(?x) (?P<comments> /\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comments | [ \t]*//(?:[^\r\n])* # single line comments ) | (?P<code> ...
def check_format(self, file_name): """Initiate the check.""" self.fail = False with codecs.open(file_name, encoding='utf-8') as f: count = 1 for line in f: if count == 1 and line.strip() == '': self.log_failure(W_NL_START, count) ...
"""Log failure. Log failure code, line number (if available) and message. """ if line: print("%s: Line %d - %s" % (code, line, VIOLATION_MSG[code])) else: print("%s: %s" % (code, VIOLATION_MSG[code])) self.fail = True
identifier_body
users.py
# -*- coding: utf-8 -*- """" ProjectName: pydemi Repo: https://github.com/chrisenytc/pydemi Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # Dependencies import uuid from api import app from hashlib import sha1 from flask import request from flask import jsonify as JSON from api.models.user ...
else: return JSON(message='User not found')
return JSON(token=user_info.get().token, roles=user_info.get().roles)
conditional_block
users.py
# -*- coding: utf-8 -*- """" ProjectName: pydemi Repo: https://github.com/chrisenytc/pydemi Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # Dependencies import uuid from api import app from hashlib import sha1 from flask import request from flask import jsonify as JSON from api.models.user ...
@app.route('/signin', methods=['POST']) @cors(origin='*', methods=['POST']) def signin(): # Retorna a user data user_info = User.objects(email=request.form['email'], password=sha1( request.form['password']).hexdigest()) if user_info.count(): return JSON(token=user_info.get().token, roles=...
new_user = User() new_user.name = request.form['name'] new_user.email = request.form['email'] new_user.password = sha1(request.form['password']).hexdigest() new_user.token = str(uuid.uuid4()) new_user.save() return JSON(message='User created successfully')
identifier_body
users.py
# -*- coding: utf-8 -*- """" ProjectName: pydemi Repo: https://github.com/chrisenytc/pydemi Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # Dependencies import uuid from api import app from hashlib import sha1 from flask import request from flask import jsonify as JSON from api.models.user ...
@cors(origin='*', methods=['POST']) def signin(): # Retorna a user data user_info = User.objects(email=request.form['email'], password=sha1( request.form['password']).hexdigest()) if user_info.count(): return JSON(token=user_info.get().token, roles=user_info.get().roles) else: re...
@app.route('/signin', methods=['POST'])
random_line_split
users.py
# -*- coding: utf-8 -*- """" ProjectName: pydemi Repo: https://github.com/chrisenytc/pydemi Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # Dependencies import uuid from api import app from hashlib import sha1 from flask import request from flask import jsonify as JSON from api.models.user ...
(): # Create new user new_user = User() new_user.name = request.form['name'] new_user.email = request.form['email'] new_user.password = sha1(request.form['password']).hexdigest() new_user.token = str(uuid.uuid4()) new_user.save() return JSON(message='User created successfully') @app.ro...
signup
identifier_name
contstants.test.js
var assert = require('assert'), math = require('../index')(), approx = require('../tools/approx'); describe('constants', function() { it('should have PI', function() { approx.equal(math.pi, 3.14159265358979); approx.equal(math.sin(math.pi / 2), 1); approx.equal(math.PI, math.pi); approx.equa...
approx.equal(math.eval('e'), 2.71828182845905); assert.equal(math.round(math.add(1,math.pow(math.e, math.multiply(math.pi, math.i))), 5), 0); assert.equal(math.round(math.eval('1+e^(pi*i)'), 5), 0); }); it('should have i', function() { assert.equal(math.i.re, 0); assert.equal(math.i.im, 1); ...
approx.equal(math.eval('tau'), 6.28318530717959); }); it('should have euler constant', function() { approx.equal(math.e, 2.71828182845905);
random_line_split
mod.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 https://mozilla.org/MPL/2.0/. */ //! Generic types that share their serialization implementations //! for both specified and computed values. use...
input.expect_function_matching("symbols")?; input.parse_nested_block(|input| { let symbols_type = input .try_parse(SymbolsType::parse) .unwrap_or(SymbolsType::Symbolic); let symbols = Symbols::parse(context, input)?; // There must be a...
{ return Ok(CounterStyle::Name(name)); }
conditional_block
mod.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 https://mozilla.org/MPL/2.0/. */ //! Generic types that share their serialization implementations //! for both specified and computed values. use...
(&self) -> bool { matches!(*self, ClipRectOrAuto::Auto) } } pub use page::PageSize;
is_auto
identifier_name
mod.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 https://mozilla.org/MPL/2.0/. */ //! Generic types that share their serialization implementations //! for both specified and computed values. use...
impl CounterStyle { /// disc value pub fn disc() -> Self { CounterStyle::Name(CustomIdent(atom!("disc"))) } /// decimal value pub fn decimal() -> Self { CounterStyle::Name(CustomIdent(atom!("decimal"))) } } impl Parse for CounterStyle { fn parse<'i, 't>( context: ...
{ *symbols_type == SymbolsType::Symbolic }
identifier_body
mod.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 https://mozilla.org/MPL/2.0/. */ //! Generic types that share their serialization implementations //! for both specified and computed values. use...
/// A wrapper of greater-than-or-equal-to-one values. #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))] #[derive( Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf, PartialEq, PartialOrd, SpecifiedValueInfo, ToAnimatedZero, ToComputedValue, To...
NonNegative(T::zero()) } }
random_line_split
Backpack.js
import _ from 'lodash'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import * as actions from '../actions/backpackActions'; class Backpack extends Component { componentDidMount() { this.props.recalcutateTotalPrice(); } handleAddItem(id) { this.props.addItemToBackpack(id); } ...
handleDiscard(id) { this.props.discardBackpack(id); } handleSave(backpack) { this.props.saveBackpack(backpack); } handleCheckout(id) { this.props.checkoutBackpack(id); } handleDate(e) { this.props.changeRentalDuration(e.target.value); } renderItems() { if (!this.props.backpack) { return ( <tr...
{ this.props.recalcutateTotalPrice(); }
identifier_body
Backpack.js
import _ from 'lodash'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import * as actions from '../actions/backpackActions'; class Backpack extends Component { componentDidMount() { this.props.recalcutateTotalPrice(); }
(id) { this.props.addItemToBackpack(id); } handleDelItem(id) { this.props.delItemFromBackpack(id); } handleRemoveItem(id) { this.props.removeItemFromBackpack(id); } handleRecalculate() { this.props.recalcutateTotalPrice(); } handleDiscard(id) { this.props.discardBackpack(id); } handleSave(backpack) ...
handleAddItem
identifier_name
Backpack.js
import _ from 'lodash'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import * as actions from '../actions/backpackActions'; class Backpack extends Component { componentDidMount() { this.props.recalcutateTotalPrice(); } handleAddItem(id) { this.props.addItemToBackpack(id); } ...
className="btn btn-warning dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" > <span className="sr-only">Toggle Dropdown</span> </button> <div className="dropdown-menu"> <a className="dro...
</button> <button type="button"
random_line_split
Backpack.js
import _ from 'lodash'; import React, { Component } from 'react'; import { connect } from 'react-redux'; import * as actions from '../actions/backpackActions'; class Backpack extends Component { componentDidMount() { this.props.recalcutateTotalPrice(); } handleAddItem(id) { this.props.addItemToBackpack(id); } ...
if (!this.props.backpack.items) { return ( <tr> <td>Loading Items...</td> </tr> ); } return this.props.backpack.items.map(item => { return this.renderItem(item); }); } renderItem(item) { const i = _.findIndex(this.props.items, ['_id', item._id]); const { name, price } = this.props.i...
{ return ( <tr> <td>Empty Items DB...</td> </tr> ); }
conditional_block
__manifest__.py
# Copyright 2014-2015 Tecnativa S.L. - Jairo Llopis # Copyright 2016 Tecnativa S.L. - Vicent Cubells # Copyright 2017 Tecnativa S.L. - David Vidal # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Partner Contact Department", "summary": "Assign contacts to departments", "vers...
"views/res_partner_department_view.xml", "views/res_partner_view.xml", ], "installable": True, }
"depends": ["contacts"], "data": [ "security/ir.model.access.csv",
random_line_split
setup_jruby.py
import subprocess import sys import os import setup_util def start(args, logfile, errfile): setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host) try: subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=l...
subprocess.check_call("rm Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) return 0 except subprocess.CalledProcessError: return 1
os.kill(pid, 15)
random_line_split
setup_jruby.py
import subprocess import sys import os import setup_util def start(args, logfile, errfile): setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host) try: subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=...
subprocess.check_call("rm Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) subprocess.check_call("rm Gemfile.lock", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) return 0 except subprocess.CalledProcessError: return 1
if 'torqbox' in line: pid = int(line.split(None, 2)[1]) os.kill(pid, 15)
conditional_block
setup_jruby.py
import subprocess import sys import os import setup_util def
(args, logfile, errfile): setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host) try: subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lo...
start
identifier_name
setup_jruby.py
import subprocess import sys import os import setup_util def start(args, logfile, errfile):
def stop(logfile, errfile): try: p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE) out, err = p.communicate() for line in out.splitlines(): if 'torqbox' in line: pid = int(line.split(None, 2)[1]) os.kill(pid, 15) subprocess.check_call("rm Gemfile", shell=True, cwd="rai...
setup_util.replace_text("rails-stripped/config/database.yml", "host: .*", "host: " + args.database_host) try: subprocess.check_call("cp Gemfile-jruby Gemfile", shell=True, cwd="rails-stripped", stderr=errfile, stdout=logfile) subprocess.check_call("cp Gemfile-jruby.lock Gemfile.lock", shell=True, cwd="rails-...
identifier_body
setup.py
#!/usr/bin/env python from distutils.util import convert_path from django_email_multibackend import __version__, __maintainer__, __email__ from fnmatch import fnmatchcase import os import sys try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages s...
(where='.', package='', exclude=standard_exclude, exclude_directories=standard_exclude_directories, only_in_packages=True, show_ignored=False): """ Return a dictionary suitable for use in ``package_data`` in a distutils ``setup.py`` file. The dictionary looks...
find_package_data
identifier_name
setup.py
#!/usr/bin/env python from distutils.util import convert_path from django_email_multibackend import __version__, __maintainer__, __email__ from fnmatch import fnmatchcase import os import sys try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages s...
Directories matching any pattern in ``exclude_directories`` will be ignored; by default directories with leading ``.``, ``CVS``, and ``_darcs`` will be ignored. If ``show_ignored`` is true, then all the files that aren't included in package data are shown on stderr (for debugging purposes). ...
are not packages won't be included (but directories under packages will).
random_line_split
setup.py
#!/usr/bin/env python from distutils.util import convert_path from django_email_multibackend import __version__, __maintainer__, __email__ from fnmatch import fnmatchcase import os import sys try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages s...
included in package data are shown on stderr (for debugging purposes). Note patterns use wildcards, or can be exact paths (including leading ``./``), and all searching is case-insensitive. """ out = {} stack = [(convert_path(where), '', package, only_in_packages)] while stack: ...
""" Return a dictionary suitable for use in ``package_data`` in a distutils ``setup.py`` file. The dictionary looks like:: {'package': [files]} Where ``files`` is a list of all the files in that package that don't match anything in ``exclude``. If ``only_in_packages`` is true, then t...
identifier_body
setup.py
#!/usr/bin/env python from distutils.util import convert_path from django_email_multibackend import __version__, __maintainer__, __email__ from fnmatch import fnmatchcase import os import sys try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages s...
out.setdefault(package, []).append(prefix + name) return out excluded_directories = standard_exclude_directories package_data = find_package_data(exclude_directories=excluded_directories) CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', ...
continue
conditional_block
lib.rs
-byte values. BitReader supports reading maximum //! of 64 bits at a time (with read_u64). Reading signed values directly is not supported at the //! moment. //! //! The reads do not need to be aligned in any particular way. //! //! Reading zero bits is a no-op. //! //! You can also skip over a number of bits, in which...
(&mut self, bit_count: u64) -> Result<()> { let end_position = self.position + bit_count; if end_position > self.bytes.len() as u64 * 8 { return Err(BitReaderError::NotEnoughData { position: self.position, length: (self.bytes.len() * 8) as u64, ...
skip
identifier_name
lib.rs
-byte values. BitReader supports reading maximum //! of 64 bits at a time (with read_u64). Reading signed values directly is not supported at the //! moment. //! //! The reads do not need to be aligned in any particular way. //! //! Reading zero bits is a no-op. //! //! You can also skip over a number of bits, in which...
relative_offset: self.position, } } /// Read at most 8 bits into a u8. pub fn read_u8(&mut self, bit_count: u8) -> Result<u8> { let value = try!(self.read_value(bit_count, 8)); Ok((value & 0xff) as u8) } /// Read at most 16 bits into a u16. pub fn read_u16(&...
pub fn relative_reader(&self) -> BitReader<'a> { BitReader { bytes: self.bytes, position: self.position,
random_line_split
lib.rs
's complement format. pub fn read_i8(&mut self, bit_count: u8) -> Result<i8> { let value = try!(self.read_signed_value(bit_count, 8)); Ok((value & 0xff) as i8) } /// Read at most 16 bits into a i16. /// Assumes the bits are stored in two's complement format. pub fn read_i16(&mut sel...
{ match try!(reader.read_u8(bits)) { 0 => Ok(false), _ => Ok(true), } }
identifier_body
lib.rs
values. BitReader supports reading maximum //! of 64 bits at a time (with read_u64). Reading signed values directly is not supported at the //! moment. //! //! The reads do not need to be aligned in any particular way. //! //! Reading zero bits is a no-op. //! //! You can also skip over a number of bits, in which case...
let start_position = self.position; let end_position = self.position + bit_count as u64; if end_position > self.bytes.len() as u64 * 8 { return Err(BitReaderError::NotEnoughData { position: self.position, length: (self.bytes.len() * 8) as u64, ...
{ return Err(BitReaderError::TooManyBitsForType { position: self.position, requested: bit_count, allowed: maximum_count, }); }
conditional_block
test_custom_lists.py
#!/usr/bin/python
from testutils import setup_test_env setup_test_env() from softwarecenter.enums import XapianValues, ActionButtons TIMEOUT=300 class TestCustomLists(unittest.TestCase): def _debug(self, index, model, needle): print ("Expected '%s' at index '%s', " + "and custom list contained: '%s'") % ( ...
from gi.repository import Gtk, GObject import time import unittest
random_line_split
test_custom_lists.py
#!/usr/bin/python from gi.repository import Gtk, GObject import time import unittest from testutils import setup_test_env setup_test_env() from softwarecenter.enums import XapianValues, ActionButtons TIMEOUT=300 class TestCustomLists(unittest.TestCase): def _debug(self, index, model, needle): print ("...
import logging logging.basicConfig(level=logging.INFO) unittest.main()
conditional_block
test_custom_lists.py
#!/usr/bin/python from gi.repository import Gtk, GObject import time import unittest from testutils import setup_test_env setup_test_env() from softwarecenter.enums import XapianValues, ActionButtons TIMEOUT=300 class TestCustomLists(unittest.TestCase): def _debug(self, index, model, needle): print ("...
(self, index, model, needle): doc = model[index][0] self.assertEqual(doc.get_value(XapianValues.PKGNAME), needle, self._debug(index, model, needle)) def test_custom_lists(self): from softwarecenter.ui.gtk3.panes.availablepane import get_test_window win = ge...
assertPkgInListAtIndex
identifier_name
test_custom_lists.py
#!/usr/bin/python from gi.repository import Gtk, GObject import time import unittest from testutils import setup_test_env setup_test_env() from softwarecenter.enums import XapianValues, ActionButtons TIMEOUT=300 class TestCustomLists(unittest.TestCase): def _debug(self, index, model, needle): print ("...
GObject.timeout_add(TIMEOUT, lambda: win.destroy()) Gtk.main() def _p(self): for i in range(10): time.sleep(0.1) while Gtk.events_pending(): Gtk.main_iteration() if __name__ == "__main__": import logging logging.basicConfig(level=lo...
from softwarecenter.ui.gtk3.panes.availablepane import get_test_window win = get_test_window() pane = win.get_data("pane") self._p() pane.on_search_terms_changed(None, "ark,artha,software-center") self._p() model = pane.app_view.tree_view.get_model() # cu...
identifier_body
toArray.ts
import { IOBuffer } from '../IOBuffer'; describe('test toArray', () => { it('from scratch', () => { const io1 = new IOBuffer(); expect(io1.toArray().byteLength).toBe(0); io1.writeUint32(100); io1.skip(10); io1.writeChars('abc'); io1.seek(4); io1.writeUint32(200); const arr1 = io1.toAr...
expect(io2.toArray().byteLength).toBe(11); const io3 = new IOBuffer(new IOBuffer(9)); expect(io3.toArray().byteLength).toBe(9); { const io = new IOBuffer(new IOBuffer(13), { offset: 5 }); expect(io.toArray().byteLength).toBe(8); } }); });
const io2 = new IOBuffer(new Uint8Array(11));
random_line_split
middleware.py
# # Copyright 2013 IBM Corp. # Copyright 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.com> # # 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 # # ...
] # Save the headers in case we need to modify them. state['headers'] = headers return start_response(status, headers, exc_info) app_iter = self.app(environ, replacement_start_response) if (state['status_code'] / 100) not in...
state = {} def replacement_start_response(status, headers, exc_info=None): """Overrides the default response to make errors parsable.""" try: status_code = int(status.split(' ')[0]) state['status_code'] = status_code except (ValueError, TypeEr...
identifier_body
middleware.py
# # Copyright 2013 IBM Corp. # Copyright 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.com> # # 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 # # ...
(self, app): self.app = app def __call__(self, environ, start_response): # Request for this state, modified by replace_start_response() # and used when an error is being reported. state = {} def replacement_start_response(status, headers, exc_info=None): """Over...
__init__
identifier_name
middleware.py
# # Copyright 2013 IBM Corp. # Copyright 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.com> # # 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 # # ...
else: try: fault = json.loads('\n'.join(app_iter)) if error is not None and 'faultstring' in fault: fault['faultstring'] = ( gettextutils.translate( error, user_locale...
try: # simple check xml is valid fault = etree.fromstring('\n'.join(app_iter)) # Add the translated error to the xml data if error is not None: for fault_string in fault.findall('faultstring'): ...
conditional_block
middleware.py
# # Copyright 2013 IBM Corp. # Copyright 2012 New Dream Network, LLC (DreamHost) # # Author: Doug Hellmann <doug.hellmann@dreamhost.com> # # 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 # # ...
'ErrorDocumentMiddleware received an invalid ' 'status %s' % status )) else: if (state['status_code'] / 100) not in (2, 3): # Remove some headers so we can replace them later # when we have the fu...
except (ValueError, TypeError): # pragma: nocover raise Exception((
random_line_split
main.js
ace.require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true }); editor.setTheme("ace/theme/eclipse"); editor.getSession().setMode("ace/mode/java"); document.getElementById('editor').style.fontSize = '18px'; editor.setAutoScrollEditorIntoView(true); ...
function loadLangs() { $('#btn-run').prop('disabled', true); $.ajax({ type: "GET", url: '/apis/langs' }).done(function (data) { showLangs(data); $('#btn-run').prop('disabled', false); }).fail(function (data) { alert("error"); $('#btn-run').prop('disabled',...
windowResized(); }
random_line_split
main.js
ace.require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true }); editor.setTheme("ace/theme/eclipse"); editor.getSession().setMode("ace/mode/java"); document.getElementById('editor').style.fontSize = '18px'; editor.setAutoScrollEditorIntoView(true); ...
$('#lang').val(langs.supportedLangs[0].id); onLangChanged(); } $(document).ready(function () { $('#btn-output').click(function () { $('#output-data').toggle(); $('#bottom-pane').toggleClass('opened'); windowResized(); }); $('#btn-run').click(function () { onRunn...
{ var supportedLang = langs.supportedLangs[i]; $('#lang').append($('<option>', { value: supportedLang.id, text: supportedLang.name })); codeTemplates[supportedLang.id] = supportedLang.template; }
conditional_block
main.js
ace.require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true }); editor.setTheme("ace/theme/eclipse"); editor.getSession().setMode("ace/mode/java"); document.getElementById('editor').style.fontSize = '18px'; editor.setAutoScrollEditorIntoView(true); ...
connect();
{ $('#btn-run').prop('disabled', false); $('#icon-running').hide(); $('#icon-run').show(); }
identifier_body
main.js
ace.require("ace/ext/language_tools"); var editor = ace.edit("editor"); editor.setOptions({ enableBasicAutocompletion: true }); editor.setTheme("ace/theme/eclipse"); editor.getSession().setMode("ace/mode/java"); document.getElementById('editor').style.fontSize = '18px'; editor.setAutoScrollEditorIntoView(true); ...
() { var lang = $('#lang').find(":selected").val(); if (prevLang) { codeTemplates[prevLang] = editor.getValue(); } editor.setValue(codeTemplates[lang], -1); prevLang = lang; if (lang === 'java7') { editor.getSession().setMode("ace/mode/java"); } else if (lang === 'python3...
onLangChanged
identifier_name
easy-waypoints.js
/*------------------------------------- EASY WAYPOINT FUNCTIONS -------------------------------------*/ // Creates a standerd waypoint with the option of custom logic. To pass in // the custom logic, just create a function with all the logic you would // like to call when the waypoint is activated, then pass just the...
// place waypoints here }); }(jQuery));
// This will be invoked when the page loads ;(function($){ $(function() {
random_line_split
easy-waypoints.js
/*------------------------------------- EASY WAYPOINT FUNCTIONS -------------------------------------*/ // Creates a standerd waypoint with the option of custom logic. To pass in // the custom logic, just create a function with all the logic you would // like to call when the waypoint is activated, then pass just the...
}, { offset: offset }); } // A loop for standerd waypoint creation. Also has the ability to pass in custom // logic, and classToToggle. Both are optional. // Example Multiple Waypoints: waypointer(['.that', '#that', '#this'], 'resolved', '10%', animate); function waypointer(elementArray, classToToggle, offset, cb) ...
{ cb(element, classToToggle, offset, direction); }
conditional_block
easy-waypoints.js
/*------------------------------------- EASY WAYPOINT FUNCTIONS -------------------------------------*/ // Creates a standerd waypoint with the option of custom logic. To pass in // the custom logic, just create a function with all the logic you would // like to call when the waypoint is activated, then pass just the...
// This will be invoked when the page loads ;(function($){ $(function() { // place waypoints here }); }(jQuery));
{ for (var i=0; i < elementArray.length; i++) { createWaypoint(elementArray[i], classToToggle, offset, cb); } return true; }
identifier_body
easy-waypoints.js
/*------------------------------------- EASY WAYPOINT FUNCTIONS -------------------------------------*/ // Creates a standerd waypoint with the option of custom logic. To pass in // the custom logic, just create a function with all the logic you would // like to call when the waypoint is activated, then pass just the...
(elementArray, classToToggle, offset, cb) { for (var i=0; i < elementArray.length; i++) { createWaypoint(elementArray[i], classToToggle, offset, cb); } return true; } // This will be invoked when the page loads ;(function($){ $(function() { // place waypoints here }); }(jQuery));
waypointer
identifier_name
Stormpath.js
import 'isomorphic-fetch' import base64 from 'base-64' import utf8 from 'utf8' import Request from './Request' function encodeAccount(username, password) { let bytes = utf8.encode(`${ username }:${ password }`) return base64.encode(bytes) } export default class Stormpath { constructor({ application, authenticat...
retrieveAccount(account) { let url = `https://api.stormpath.com/v1/accounts/${ account }` let options = { authentication: this.authentication } return Request.get(url, options) } authenticateAccount({ username, password } = {}) { let url = `https://api.stormpath.com/v1/applications/${...
{ let url = `https://api.stormpath.com/v1/applications/${ this.application }/accounts` let options = { authentication: this.authentication, payload: payload } return Request.post(url, options) }
identifier_body
Stormpath.js
import 'isomorphic-fetch' import base64 from 'base-64' import utf8 from 'utf8' import Request from './Request' function encodeAccount(username, password) { let bytes = utf8.encode(`${ username }:${ password }`)
export default class Stormpath { constructor({ application, authentication } = {}) { this.application = application this.authentication = authentication } retrieveApplication() { let url = `https://api.stormpath.com/v1/applications/${ this.application }/accounts` let options = { authentication: th...
return base64.encode(bytes) }
random_line_split
Stormpath.js
import 'isomorphic-fetch' import base64 from 'base-64' import utf8 from 'utf8' import Request from './Request' function encodeAccount(username, password) { let bytes = utf8.encode(`${ username }:${ password }`) return base64.encode(bytes) } export default class
{ constructor({ application, authentication } = {}) { this.application = application this.authentication = authentication } retrieveApplication() { let url = `https://api.stormpath.com/v1/applications/${ this.application }/accounts` let options = { authentication: this.authentication } return...
Stormpath
identifier_name
Stormpath.js
import 'isomorphic-fetch' import base64 from 'base-64' import utf8 from 'utf8' import Request from './Request' function encodeAccount(username, password) { let bytes = utf8.encode(`${ username }:${ password }`) return base64.encode(bytes) } export default class Stormpath { constructor({ application, authenticat...
stormpath.authenticateAccount(account) stormpath.retrieveAccount('3NElH12QutCmRSi3e6PAmI') .then( data => console.log(data), error => console.log(error) ) }
{ const credentials = { application: 'zDhRIszpk93AwssJDXuPs', authentication: { username: '1HU99B538PG3SW50K5M2NPJBW', password: '7ukbB9oDRjgyMEX/057SKtAwwLtOR3fbKvNQOp4i/uI' } } const account = { givenName: 'Denis', surname: 'Storm', username: 'DenisCarriere', email: 'foo....
conditional_block
import_localities.py
""" Usage: import_localities < Localities.csv """ from django.contrib.gis.geos import GEOSGeometry from django.utils.text import slugify from ..import_from_csv import ImportFromCSVCommand from ...utils import parse_nptg_datetime from ...models import Locality class Command(ImportFromCSVCommand): """ Impo...
if row['NptgDistrictCode'] == '310': # bogus code seemingly used for localities with no district locality.district_id = None else: locality.district_id = row['NptgDistrictCode'] if locality.id: to_update.append(locality) ...
random_line_split
import_localities.py
""" Usage: import_localities < Localities.csv """ from django.contrib.gis.geos import GEOSGeometry from django.utils.text import slugify from ..import_from_csv import ImportFromCSVCommand from ...utils import parse_nptg_datetime from ...models import Locality class
(ImportFromCSVCommand): """ Imports localities from the NPTG """ def handle_rows(self, rows): existing_localities = Locality.objects.defer('search_vector', 'latlong').in_bulk() slugs = { locality.slug: locality for locality in existing_localities.values() } to...
Command
identifier_name
import_localities.py
""" Usage: import_localities < Localities.csv """ from django.contrib.gis.geos import GEOSGeometry from django.utils.text import slugify from ..import_from_csv import ImportFromCSVCommand from ...utils import parse_nptg_datetime from ...models import Locality class Command(ImportFromCSVCommand): """ Impo...
if locality.id: to_update.append(locality) else: locality.id = locality_code slug = slugify(locality.get_qualified_name()) locality.slug = slug i = 0 while locality.slug in slugs: ...
locality.district_id = row['NptgDistrictCode']
conditional_block
import_localities.py
""" Usage: import_localities < Localities.csv """ from django.contrib.gis.geos import GEOSGeometry from django.utils.text import slugify from ..import_from_csv import ImportFromCSVCommand from ...utils import parse_nptg_datetime from ...models import Locality class Command(ImportFromCSVCommand):
locality = Locality() created_at = parse_nptg_datetime(row["CreationDateTime"]) locality.modified_at = modified_at locality.created_at = created_at locality.name = row['LocalityName'].replace('\'', '\u2019') locality.short_name = row['ShortN...
""" Imports localities from the NPTG """ def handle_rows(self, rows): existing_localities = Locality.objects.defer('search_vector', 'latlong').in_bulk() slugs = { locality.slug: locality for locality in existing_localities.values() } to_update = [] to_crea...
identifier_body
utilities.module.ts
import { CommonModule } from '@angular/common'; import { ComponentFactoryResolver, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { AccessibilityModule, AccordionModule, CheckboxModule, FocusIfModule, TabsetModule } from '@ux-aspects/ux-aspects'; import { DocumentationComponents...
ComponentsColorServiceComponent, ComponentsPersistentDataServiceComponent, ComponentsTabbableListComponent, ComponentsFocusComponent, ComponentsFocusIndicatorComponent ]; const ROUTES = [ { path: '**', component: DocumentationCategoryComponent, data: { catego...
import { ComponentsTabbableListComponent } from './tabbable-list/tabbable-list.component'; const SECTIONS = [ ComponentsFocusIfComponent,
random_line_split
utilities.module.ts
import { CommonModule } from '@angular/common'; import { ComponentFactoryResolver, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { AccessibilityModule, AccordionModule, CheckboxModule, FocusIfModule, TabsetModule } from '@ux-aspects/ux-aspects'; import { DocumentationComponents...
}
{ resolverService.registerResolver(componentFactoryResolver, SECTIONS); }
identifier_body
utilities.module.ts
import { CommonModule } from '@angular/common'; import { ComponentFactoryResolver, NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { AccessibilityModule, AccordionModule, CheckboxModule, FocusIfModule, TabsetModule } from '@ux-aspects/ux-aspects'; import { DocumentationComponents...
{ constructor(componentFactoryResolver: ComponentFactoryResolver, resolverService: ResolverService) { resolverService.registerResolver(componentFactoryResolver, SECTIONS); } }
ComponentsUtilitiesModule
identifier_name
scmProvider.ts
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
(): void { this._sourceControl.statusBarCommands = this.statusBarCommands.commands; } dispose(): void { this.disposables.forEach(d => d.dispose()); this.disposables = []; } }
onDidStatusBarCommandsChange
identifier_name
scmProvider.ts
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
dispose(): void { this.disposables.forEach(d => d.dispose()); this.disposables = []; } }
private onDidStatusBarCommandsChange(): void { this._sourceControl.statusBarCommands = this.statusBarCommands.commands; }
random_line_split
scmProvider.ts
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---------------------------------------------------------------...
private mergeGroup: SourceControlResourceGroup; private indexGroup: SourceControlResourceGroup; private workingTreeGroup: SourceControlResourceGroup; constructor( private model: Model, private commandCenter: CommandCenter, private statusBarCommands: StatusBarCommands ) { this._sourceControl = scm.create...
{ return this._sourceControl; }
identifier_body
properties_render_layer.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
(self, box, rl, pass_type): # property names use_pass_type = "use_pass_" + pass_type exclude_pass_type = "exclude_" + pass_type # draw pass type buttons row = box.row() row.prop(rl, use_pass_type) row.prop(rl, exclude_pass_type, text="") def draw(self, contex...
draw_pass_type_buttons
identifier_name
properties_render_layer.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
row.prop(rd, "use_single_layer", text="", icon_only=True) class RENDERLAYER_PT_layer_options(RenderLayerButtonsPanel, Panel): bl_label = "Layer" COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): layout = self.layout scene = context.scene rd = scene.render ...
row.prop(rl, "name")
random_line_split
properties_render_layer.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
class RENDERLAYER_PT_layer_options(RenderLayerButtonsPanel, Panel): bl_label = "Layer" COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): layout = self.layout scene = context.scene rd = scene.render rl = rd.layers.active split = layout.split() ...
layout = self.layout scene = context.scene rd = scene.render row = layout.row() row.template_list("RENDERLAYER_UL_renderlayers", "", rd, "layers", rd.layers, "active_index", rows=2) col = row.column(align=True) col.operator("scene.render_layer_add", icon='ZOOMIN', text...
identifier_body
properties_render_layer.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
class RENDERLAYER_PT_layers(RenderLayerButtonsPanel, Panel): bl_label = "Layer List" bl_options = {'HIDE_HEADER'} COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): layout = self.layout scene = context.scene rd = scene.render row = layout.row() row...
layout.alignment = 'CENTER' layout.label("", icon_value=icon)
conditional_block
MediaTable.tsx
import * as React from "react"; import { connect } from 'react-redux' import { searchSubTitle } from '../actions' function natcmp(a, b) { var ra = a.match(/\D+|\d+/g); var rb = b.match(/\D+|\d+/g); var r = 0; while (!r && ra.length && rb.length) { var x = ra.shift(), y = rb.shift(), ...
<table className="hover"> <thead> <tr> <th>视频名称</th> <th width="60">字幕</th> <th width="60">操作</th> </tr> </thead> <tbody> {this....
}) return resultHtml; } render() { return (
random_line_split
MediaTable.tsx
import * as React from "react"; import { connect } from 'react-redux' import { searchSubTitle } from '../actions' function natcmp(a, b) { var ra = a.match(/\D+|\d+/g); var rb = b.match(/\D+|\d+/g); var r = 0; while (!r && ra.length && rb.length) { var x = ra.shift(), y = rb.shift(), ...
(mediaObj) { this.props.dispatch(searchSubTitle(mediaObj)) } renderMediaFilesList() { let {mediaPath} = this.props.setting; let resultHtml = []; // console.log(this.props.files) let files = this.props.files.sort((a, b) => { if (a.subs.length === 0 || b.subs.le...
clickDownloadHandler
identifier_name
MediaTable.tsx
import * as React from "react"; import { connect } from 'react-redux' import { searchSubTitle } from '../actions' function natcmp(a, b)
class MediaTable extends React.Component<{ dispatch: Function, files: Array<MediaFileObject>, setting: any, filterWrods: string }, undefined> { clickDownloadHandler(mediaObj) { this.props.dispatch(searchSubTitle(mediaObj)) } renderMediaFilesList() { let {mediaPath} = this.props.setting; ...
{ var ra = a.match(/\D+|\d+/g); var rb = b.match(/\D+|\d+/g); var r = 0; while (!r && ra.length && rb.length) { var x = ra.shift(), y = rb.shift(), nx = parseInt(x), ny = parseInt(y); if (isNaN(nx) || isNaN(ny)) r = x > y ? 1 : (x < y ? -1 : 0); else ...
identifier_body
__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################### # # # Copyright (C) 2009-2013 Renato Lima - Akretion # # ...
'demo/account_financial_demo.xml', 'demo/account_fiscal_demo.xml', 'demo/base_demo.xml', ], 'test': [], 'installable': False, 'auto_install': True, }
'demo': [ 'demo/account.account.csv', 'demo/account_tax_code.xml',
random_line_split
videotrack.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::VideoTrackBinding::Video...
pub fn add_track_list(&self, track_list: &VideoTrackList) { *self.track_list.borrow_mut() = Some(Dom::from_ref(track_list)); } pub fn remove_track_list(&self) { *self.track_list.borrow_mut() = None; } } impl VideoTrackMethods for VideoTrack { // https://html.spec.whatwg.org/multi...
{ self.selected.set(value); }
identifier_body
videotrack.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::VideoTrackBinding::Video...
} pub fn id(&self) -> DOMString { self.id.clone() } pub fn kind(&self) -> DOMString { self.kind.clone() } pub fn selected(&self) -> bool { self.selected.get().clone() } pub fn set_selected(&self, value: bool) { self.selected.set(value); } pub ...
random_line_split
videotrack.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::VideoTrackBinding::Video...
(&self, value: bool) { self.selected.set(value); } pub fn add_track_list(&self, track_list: &VideoTrackList) { *self.track_list.borrow_mut() = Some(Dom::from_ref(track_list)); } pub fn remove_track_list(&self) { *self.track_list.borrow_mut() = None; } } impl VideoTrackMeth...
set_selected
identifier_name
videotrack.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::VideoTrackBinding::Video...
} self.set_selected(value); } }
{ list.set_selected(idx, value); }
conditional_block
point.ts
import * as Base from './base'; export class PmzPoint{ x:number; y:number; constructor(x:number,y:number){ this.x = x; this.y = y; }
():boolean { return this.x === 0 && this.y === 0; } static parse(text:string): PmzPoint { var values = Base.asIntArray(text); return new PmzPoint(values[0], values[1]); } static parseArray(text:string): PmzPoint[] { var values = Base.asIntArray(text); ...
isEmpty
identifier_name
point.ts
import * as Base from './base'; export class PmzPoint{ x:number; y:number; constructor(x:number,y:number){ this.x = x; this.y = y; } isEmpty():boolean { return this.x === 0 && this.y === 0; } static parse(text:string): PmzPoint { var values...
static parseArray(text:string): PmzPoint[] { var values = Base.asIntArray(text); var points: PmzPoint[] = []; for (var i = 0; i < (values.length - 1); i += 2) { points.push(new PmzPoint(values[i], values[i + 1])); } return points; } static format(poi...
random_line_split
point.ts
import * as Base from './base'; export class PmzPoint{ x:number; y:number; constructor(x:number,y:number){ this.x = x; this.y = y; } isEmpty():boolean { return this.x === 0 && this.y === 0; } static parse(text:string): PmzPoint { var values...
static format(point: PmzPoint): string { return [point.x, point.y].join(','); } static formatArray(points: PmzPoint[]): string{ return points.map(PmzPoint.format).join(', '); } }
{ var values = Base.asIntArray(text); var points: PmzPoint[] = []; for (var i = 0; i < (values.length - 1); i += 2) { points.push(new PmzPoint(values[i], values[i + 1])); } return points; }
identifier_body
point.ts
import * as Base from './base'; export class PmzPoint{ x:number; y:number; constructor(x:number,y:number){ this.x = x; this.y = y; } isEmpty():boolean { return this.x === 0 && this.y === 0; } static parse(text:string): PmzPoint { var values...
return points; } static format(point: PmzPoint): string { return [point.x, point.y].join(','); } static formatArray(points: PmzPoint[]): string{ return points.map(PmzPoint.format).join(', '); } }
{ points.push(new PmzPoint(values[i], values[i + 1])); }
conditional_block
variables_a.js
var searchData= [ ['lambda',['lambda',['../de/df6/namespacebbb_1_1function_1_1lambda__symbol.html#abeec683e4c2770f82c60e84a36c1ec74',1,'bbb::function::lambda_symbol']]], ['land',['land',['../d3/d4d/namespacebbb_1_1function_1_1direct__lambda.html#af078f98db5b749c9eb5c029c409b925a',1,'bbb::function::direct_lambda::la...
];
['logger_5fstream',['logger_stream',['../d2/dbf/structbbb_1_1loggers_1_1custom__logger.html#a7bae3b3ca57b07124eee320860e534c0',1,'bbb::loggers::custom_logger']]]
random_line_split