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
bithdtv.py
# # This file is part of Sick Beard. # # Sick Beard is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Sick Beard is distributed in t...
################################################################################################### def _doSearch(self, search_params, show=None): self.search_results = [] logger.log("[" + self.name + "] Performing Search: {0}".format(search_params)) search_params = search_params...
search_string = [] if not ep_obj: return [] if ep_obj.show.air_by_date: for show_name in set(show_name_helpers.allPossibleShowNames(ep_obj.show)): ep_string = show_name_helpers.sanitizeSceneName(show_name) +' '+ str(ep_obj.airdate).replace('-', '.') ...
identifier_body
bithdtv.py
Sick Beard is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along wi...
return xml
random_line_split
scrollbar.js
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import {createElementWithClassName} from 'chrome://resources/js/util.m.js'; /** * Create by |LineChart.LineChart|. * Create a dummy scrollbar to show t...
* float point number. * @return {number} */ getPosition() { return Math.round(this.position_); } /** * Change the size of the outer div and update the scrollbar position. * @param {number} width */ resize(width) { if (this.width_ == width) return; this.width_ = width; th...
/** * Position may be float point number because |document.scrollLeft| may be
random_line_split
scrollbar.js
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import {createElementWithClassName} from 'chrome://resources/js/util.m.js'; /** * Create by |LineChart.LineChart|. * Create a dummy scrollbar to show t...
() { return Math.round(this.position_); } /** * Change the size of the outer div and update the scrollbar position. * @param {number} width */ resize(width) { if (this.width_ == width) return; this.width_ = width; this.updateOuterDivWidth_(); } updateOuterDivWidth_() { thi...
getPosition
identifier_name
scrollbar.js
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import {createElementWithClassName} from 'chrome://resources/js/util.m.js'; /** * Create by |LineChart.LineChart|. * Create a dummy scrollbar to show t...
/** * Set the scrollable range to |range|. Use the inner div's width to control * the scrollable range. If position go out of range after range update, set * it to the boundary value. * @param {number} range */ setRange(range) { this.range_ = range; this.updateInnerDivWidth_(); if (rang...
{ this.constructor.setNodeWidth(this.outerDiv_, this.width_); }
identifier_body
action_handler.js
/** @module ember @submodule ember-runtime */ import Ember from 'ember-metal/core'; import { Mixin } from 'ember-metal/mixin'; import { get } from 'ember-metal/property_get'; import { deprecateProperty } from 'ember-metal/deprecate_property'; /** `Ember.ActionHandler` is available on some familiar classes including ...
(actionName, ...args) { var target; if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } if (target = get(this, 'target')) { Ember.assert('The `target` for ' + this + ' (' + target + ...
send
identifier_name
action_handler.js
/** @module ember @submodule ember-runtime */ import Ember from 'ember-metal/core'; import { Mixin } from 'ember-metal/mixin'; import { get } from 'ember-metal/property_get'; import { deprecateProperty } from 'ember-metal/deprecate_property'; /** `Ember.ActionHandler` is available on some familiar classes including ...
{ deprecateProperty(factory.prototype, '_actions', 'actions', { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); }
identifier_body
action_handler.js
/** @module ember @submodule ember-runtime */ import Ember from 'ember-metal/core'; import { Mixin } from 'ember-metal/mixin'; import { get } from 'ember-metal/property_get'; import { deprecateProperty } from 'ember-metal/deprecate_property'; /** `Ember.ActionHandler` is available on some familiar classes including ...
return true; } } } }); ``` @property actions @type Object @default null @public */ /** Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target func...
if (actionShouldAlsoBeTriggeredOnParentRoute) {
random_line_split
action_handler.js
/** @module ember @submodule ember-runtime */ import Ember from 'ember-metal/core'; import { Mixin } from 'ember-metal/mixin'; import { get } from 'ember-metal/property_get'; import { deprecateProperty } from 'ember-metal/deprecate_property'; /** `Ember.ActionHandler` is available on some familiar classes including ...
} }); export default ActionHandler; export function deprecateUnderscoreActions(factory) { deprecateProperty(factory.prototype, '_actions', 'actions', { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); }
{ Ember.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); target.send(...arguments); }
conditional_block
return.js
/*! * Stylus - Return * Copyright (c) Automattic <developer.wordpress.com> * MIT Licensed */ /** * Module dependencies. */ var Node = require('./node') , nodes = require('./'); /** * Initialize a new `Return` node with the given `expr`. * * @param {Expression} expr * @api public */ var Return = module....
clone.filename = this.filename; return clone; }; /** * Return a JSON representation of this node. * * @return {Object} * @api public */ Return.prototype.toJSON = function(){ return { __type: 'Return', expr: this.expr, lineno: this.lineno, column: this.column, filename: this.filename }...
clone.lineno = this.lineno; clone.column = this.column;
random_line_split
15.2.3.7-6-a-307.js
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-307.js * @description Object.defineProperties - 'O' is an Arguments object, 'P' is generic own data property of 'O', test TypeError is thrown when updating the [[Writable]] attribute value of 'P' which...
() { var arg = (function () { return arguments; }(1, 2, 3)); Object.defineProperty(arg, "genericProperty", { writable: false, configurable: false }); try { Object.defineProperties(arg, { "genericProperty": { ...
testcase
identifier_name
15.2.3.7-6-a-307.js
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-307.js * @description Object.defineProperties - 'O' is an Arguments object, 'P' is generic own data property of 'O', test TypeError is thrown when updating the [[Writable]] attribute value of 'P' which...
dataPropertyAttributesAreCorrect(arg, "genericProperty", undefined, false, false, false); } } runTestCase(testcase);
{ var arg = (function () { return arguments; }(1, 2, 3)); Object.defineProperty(arg, "genericProperty", { writable: false, configurable: false }); try { Object.defineProperties(arg, { "genericProperty": { ...
identifier_body
15.2.3.7-6-a-307.js
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.2/15.2.3/15.2.3.7/15.2.3.7-6-a-307.js * @description Object.defineProperties - 'O' is an Arguments object, 'P' is generic own data property of 'O', test TypeError is thrown when updating the [[Writable]] attribute value of 'P' which...
return false; } catch (ex) { return ex instanceof TypeError && dataPropertyAttributesAreCorrect(arg, "genericProperty", undefined, false, false, false); } } runTestCase(testcase);
});
random_line_split
borrowed-unique-basic.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
{()}
identifier_body
borrowed-unique-basic.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
// gdb-command:print *f32_ref // gdb-check:$13 = 2.5 // gdb-command:print *f64_ref // gdb-check:$14 = 3.5 // === LLDB TESTS ================================================================================== // lldb-command:type format add -f decimal char // lldb-command:type format add -f decimal 'unsigned char' /...
// gdb-command:print *u64_ref // gdb-check:$12 = 64
random_line_split
borrowed-unique-basic.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
() {()}
zzz
identifier_name
demo_multiple_scenes.py
# # cocos2d # http://python.cocos2d.org # from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import directo...
child2_scene.scale = 1.5 child2_scene.position = (160, 120) child2_scene.transform_anchor = (320, 240) child3_scene.add(ColorLayer(255, 0, 0, 255)) child3_scene.add(sprites) child3_scene.scale = 1.5 child3_scene.position = (-160, 120) child3_scene.transform_anchor = (320, 240) chil...
director.init(resizable=True) main_scene = cocos.scene.Scene() main_scene.transform_anchor = (320, 240) child1_scene = cocos.scene.Scene() child2_scene = cocos.scene.Scene() child3_scene = cocos.scene.Scene() child4_scene = cocos.scene.Scene() sprites = TestLayer() sprites.transform_an...
conditional_block
demo_multiple_scenes.py
# # cocos2d # http://python.cocos2d.org # from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import directo...
(self): super(TestLayer, self).__init__() x, y = director.get_window_size() sprite1 = Sprite('grossini.png') sprite2 = Sprite('grossinis_sister1.png') sprite3 = Sprite('grossinis_sister2.png') sprite1.position = (x // 2, y // 2) sprite2.position = (x // 4, y //...
__init__
identifier_name
demo_multiple_scenes.py
# # cocos2d # http://python.cocos2d.org # from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import directo...
child4_scene.scale = 1.5 child4_scene.position = (160, -120) child4_scene.transform_anchor = (320, 240) main_scene.add(child1_scene) main_scene.add(child2_scene) main_scene.add(child3_scene) main_scene.add(child4_scene) rot = RotateBy(-360, 2) rot2 = RotateBy(360, 4) sleep = D...
random_line_split
demo_multiple_scenes.py
# # cocos2d # http://python.cocos2d.org # from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import directo...
if __name__ == "__main__": director.init(resizable=True) main_scene = cocos.scene.Scene() main_scene.transform_anchor = (320, 240) child1_scene = cocos.scene.Scene() child2_scene = cocos.scene.Scene() child3_scene = cocos.scene.Scene() child4_scene = cocos.scene.Scene() sprites = Tes...
super(TestLayer, self).__init__() x, y = director.get_window_size() sprite1 = Sprite('grossini.png') sprite2 = Sprite('grossinis_sister1.png') sprite3 = Sprite('grossinis_sister2.png') sprite1.position = (x // 2, y // 2) sprite2.position = (x // 4, y // 2) spri...
identifier_body
NetworkWifiRounded.js
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M12 4C7.7 4 3.78 5.6.79 8.24.35 8.63.32 9.3.73 9.71l10.56 10.58c.39.39 1.02.39 1.42 0L23.27 9.71c.41-.41.38-1.08-.06-1.47C20.22 5.6 16.3 4 12 4zm0 4c-2.86 0-5.5.94-7.65 2.51L2.92 9.07C5.51 7.08 8.67 6 12 6s6...
random_line_split
csv2geojson.js
/* */ "format cjs"; (function(e){if("function"==typeof bootstrap)bootstrap("csv2geojson",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCsv2geojson=e}else"undefined"!=typeof window?window.csv2ge...
} }; for (var i = 0; i < features.length; i++) { line.geometry.coordinates.push(features[i].geometry.coordinates); } line.properties = features[0].properties; return { type: 'FeatureSet', features: [line] }; } function topolygon(gj) { var features = gj.featur...
var line = { type: 'Feature', geometry: { type: 'LineString', coordinates: []
random_line_split
csv2geojson.js
/* */ "format cjs"; (function(e){if("function"==typeof bootstrap)bootstrap("csv2geojson",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCsv2geojson=e}else"undefined"!=typeof window?window.csv2ge...
while (i++ < text.length) { if (text.charCodeAt(i) === 34) { if (text.charCodeAt(i + 1) !== 34) break; i++; } } re.lastIndex = i + 2; var c = text.charCodeAt(i + 1); ...
{ var EOL = {}, // sentinel value for end-of-line EOF = {}, // sentinel value for end-of-file rows = [], // output rows re = /\r\n|[,\r\n]/g, // field separator regex n = 0, // the current line number t, // the current token eol; // is the current token followed b...
identifier_body
csv2geojson.js
/* */ "format cjs"; (function(e){if("function"==typeof bootstrap)bootstrap("csv2geojson",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeCsv2geojson=e}else"undefined"!=typeof window?window.csv2ge...
() { if (re.lastIndex >= text.length) return EOF; // special case: end of file if (eol) { eol = false; return EOL; } // special case: end of line // special case: quotes var j = re.lastIndex; if (text.charCodeAt(j) === 34) { var i = j; ...
token
identifier_name
7 Reverse Integer.py
def reverse(self, x): """ :type x: int :rtype: int """ # Op1: isNegative = False if x < 0: isNegative = True x *= -1 x = int(str(x)[::-1]) if isNegative: x *= -1 return x if abs(x) < 2**31-1 else 0 ...
class Solution(object):
random_line_split
7 Reverse Integer.py
class Solution(object): def reverse(self, x):
def reverse2(self, x): sign = 1 if x < 0: sign = -1 x *= -1 num = 0 while x: if abs(num) > 214748364: return 0 num = num * 10 + x % 10 x //= 10 return num * sign test = Solution() print(test.rever...
""" :type x: int :rtype: int """ # Op1: isNegative = False if x < 0: isNegative = True x *= -1 x = int(str(x)[::-1]) if isNegative: x *= -1 return x if abs(x) < 2**31-1 else 0
identifier_body
7 Reverse Integer.py
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ # Op1: isNegative = False if x < 0: isNegative = True x *= -1 x = int(str(x)[::-1]) if isNegative: x *= -1 return x if ab...
num = 0 while x: if abs(num) > 214748364: return 0 num = num * 10 + x % 10 x //= 10 return num * sign test = Solution() print(test.reverse(1000000003)) print(test.reverse2(-1000000003))
sign = -1 x *= -1
conditional_block
7 Reverse Integer.py
class Solution(object): def reverse(self, x): """ :type x: int :rtype: int """ # Op1: isNegative = False if x < 0: isNegative = True x *= -1 x = int(str(x)[::-1]) if isNegative: x *= -1 return x if ab...
(self, x): sign = 1 if x < 0: sign = -1 x *= -1 num = 0 while x: if abs(num) > 214748364: return 0 num = num * 10 + x % 10 x //= 10 return num * sign test = Solution() print(test.reverse(1000000003)) pr...
reverse2
identifier_name
circd.rs
/////////////////////////////////////////////////////////////////////////////// #![feature(phase)] extern crate circ_comms; extern crate irc; #[phase(plugin, link)] extern crate log; extern crate time; /////////////////////////////////////////////////////////////////////////////// use irc::data::config::Config; use s...
() { let config = process_args(); let connection = connection::Connection::new(config); let socket = Path::new(circ_comms::address()); if socket.exists() { match fs::unlink(&socket) { Ok(_) => (), Err(e) => panic!("Unable to remove {}: {}", circ_comms::...
main
identifier_name
circd.rs
/////////////////////////////////////////////////////////////////////////////// #![feature(phase)] extern crate circ_comms; extern crate irc; #[phase(plugin, link)] extern crate log; extern crate time; /////////////////////////////////////////////////////////////////////////////// use irc::data::config::Config; use s...
Config::load(filename).unwrap() }, _ => panic!("Configuration file must be specified") } } /////////////////////////////////////////////////////////////////////////////// fn main() { let config = process_args(); let connection = connection::Connection::new(config); le...
panic!("File {} doesn't exist", arg); }
random_line_split
circd.rs
/////////////////////////////////////////////////////////////////////////////// #![feature(phase)] extern crate circ_comms; extern crate irc; #[phase(plugin, link)] extern crate log; extern crate time; /////////////////////////////////////////////////////////////////////////////// use irc::data::config::Config; use s...
/////////////////////////////////////////////////////////////////////////////// fn main() { let config = process_args(); let connection = connection::Connection::new(config); let socket = Path::new(circ_comms::address()); if socket.exists() { match fs::unlink(&socket) { ...
{ match os::args().tail() { [ref arg] => { let filename = Path::new(arg.as_slice()); if !filename.exists() { panic!("File {} doesn't exist", arg); } Config::load(filename).unwrap() }, _ => p...
identifier_body
image_decoder_d.rs
/*! A application that uses the `image-decoder` feature to load resources and display them. Requires the following features: `cargo run --example image_decoder_d --features "image-decoder file-dialog"` */ extern crate native_windows_gui as nwg; extern crate native_windows_derive as nwd; use nwd::NwgUi; use ...
{ nwg::init().expect("Failed to init Native Windows GUI"); nwg::Font::set_global_family("Segoe UI").expect("Failed to set default font"); let _app = ImageDecoderApp::build_ui(Default::default()).expect("Failed to build UI"); nwg::dispatch_thread_events(); }
identifier_body
image_decoder_d.rs
/*! A application that uses the `image-decoder` feature to load resources and display them. Requires the following features: `cargo run --example image_decoder_d --features "image-decoder file-dialog"` */ extern crate native_windows_gui as nwg; extern crate native_windows_derive as nwd; use nwd::NwgUi; use ...
if let Ok(directory) = self.dialog.get_selected_item() { let dir = directory.into_string().unwrap(); self.file_name.set_text(&dir); self.read_file(); } } } fn read_file(&self) { println!("{}", self.file_name.text()); ...
} } if self.dialog.run(Some(&self.window)) { self.file_name.set_text("");
random_line_split
image_decoder_d.rs
/*! A application that uses the `image-decoder` feature to load resources and display them. Requires the following features: `cargo run --example image_decoder_d --features "image-decoder file-dialog"` */ extern crate native_windows_gui as nwg; extern crate native_windows_derive as nwd; use nwd::NwgUi; use ...
() { nwg::init().expect("Failed to init Native Windows GUI"); nwg::Font::set_global_family("Segoe UI").expect("Failed to set default font"); let _app = ImageDecoderApp::build_ui(Default::default()).expect("Failed to build UI"); nwg::dispatch_thread_events(); }
main
identifier_name
htmldatalistelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLDataListElementBinding; use dom::bindings::codegen::Bindings::HTMLDataLi...
} let node = NodeCast::from_ref(self); let filter = box HTMLDataListOptionsFilter; let window = window_from_node(node); HTMLCollection::create(window.r(), node, filter) } }
{ elem.is_htmloptionelement() }
identifier_body
htmldatalistelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLDataListElementBinding; use dom::bindings::codegen::Bindings::HTMLDataLi...
} } impl HTMLDataListElementMethods for HTMLDataListElement { // https://html.spec.whatwg.org/multipage/#dom-datalist-options fn Options(&self) -> Root<HTMLCollection> { #[derive(JSTraceable, HeapSizeOf)] struct HTMLDataListOptionsFilter; impl CollectionFilter for HTMLDataListOption...
let element = HTMLDataListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDataListElementBinding::Wrap)
random_line_split
htmldatalistelement.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::Bindings::HTMLDataListElementBinding; use dom::bindings::codegen::Bindings::HTMLDataLi...
(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> Root<HTMLDataListElement> { let element = HTMLDataListElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLDataListElementBinding::Wrap) } } impl HTM...
new
identifier_name
view.js
/*global qs, qsa, $on, $parent, $delegate */ (function (window) { 'use strict'; /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, handler) * Takes a todo application event and registers the handler *...
View.prototype._removeItem = function (id) { var elem = qs('[data-id="' + id + '"]'); if (elem) { this.$todoList.removeChild(elem); } }; View.prototype._clearCompletedButton = function (completedCount, visible) { this.$clearCompleted.innerHTML = this.template.clearCompletedButton(complet...
{ this.template = template; this.ENTER_KEY = 13; this.ESCAPE_KEY = 27; this.$todoList = qs('.todo-list'); this.$todoItemCounter = qs('.todo-count'); this.$clearCompleted = qs('.clear-completed'); this.$main = qs('.main'); this.$footer = qs('.footer'); this.$toggleAll = qs('.toggle-...
identifier_body
view.js
/*global qs, qsa, $on, $parent, $delegate */ (function (window) { 'use strict'; /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, handler) * Takes a todo application event and registers the handler *...
(template) { this.template = template; this.ENTER_KEY = 13; this.ESCAPE_KEY = 27; this.$todoList = qs('.todo-list'); this.$todoItemCounter = qs('.todo-count'); this.$clearCompleted = qs('.clear-completed'); this.$main = qs('.main'); this.$footer = qs('.footer'); this.$toggleAll = q...
View
identifier_name
view.js
/*global qs, qsa, $on, $parent, $delegate */ (function (window) { 'use strict'; /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, handler) * Takes a todo application event and registers the handler *...
else if (event === 'itemToggle') { $delegate(self.$todoList, '.toggle', 'click', function () { handler({ id: self._itemId(this), completed: this.checked }); }); } else if (event === 'itemEditDone') { self._bindItemEditDone(handler); } else if (event === '...
{ $delegate(self.$todoList, '.destroy', 'click', function () { handler({id: self._itemId(this)}); }); }
conditional_block
view.js
/*global qs, qsa, $on, $parent, $delegate */ (function (window) { 'use strict'; /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, handler) * Takes a todo application event and registers the handler *...
this.$main = qs('.main'); this.$footer = qs('.footer'); this.$toggleAll = qs('.toggle-all'); this.$newTodo = qs('.new-todo'); } View.prototype._removeItem = function (id) { var elem = qs('[data-id="' + id + '"]'); if (elem) { this.$todoList.removeChild(elem); } }; View.proto...
random_line_split
hbase_setup.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
(self, api, cluster_name): try: api.createTable(cluster_name, 'analytics_demo', [{'properties': {'name': 'hour'}}, {'properties': {'name': 'day'}}, {'properties': {'name': 'total'}}]) except AlreadyExists: pass def load_analytics_table(self, api, cluster_name): table_data = os.path.join(get_a...
create_analytics_table
identifier_name
hbase_setup.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
try: api.createTable(cluster_name, 'analytics_demo', [{'properties': {'name': 'hour'}}, {'properties': {'name': 'day'}}, {'properties': {'name': 'total'}}]) except AlreadyExists: pass def load_analytics_table(self, api, cluster_name): table_data = os.path.join(get_apps_root(), 'hbase', 'examp...
self.create_binary_table(api, cluster_name) self.load_binary_table(api, cluster_name) def create_analytics_table(self, api, cluster_name):
random_line_split
hbase_setup.py
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
today = datetime.now().strftime('%Y%m%d') tomorrow = (datetime.now() + timedelta(days=1)).strftime('%Y%m%d') api.putRow(cluster_name, 'document_demo', today, {'doc:txt': 'Hue is awesome!'}) api.putRow(cluster_name, 'document_demo', today, {'doc:json': '{"user": "hue", "coolness": "extra"}'}) api.putRow...
identifier_body
feedback-msq-question-details.impl.ts
// tslint:disable-next-line:max-line-length import { MsqQuestionStatisticsCalculation } from '../../app/components/question-types/question-statistics/question-statistics-calculation/msq-question-statistics-calculation'; import { FeedbackMsqQuestionDetails, FeedbackParticipantType, FeedbackQuestionType, QuestionOu...
} }
isInstructorCommentsOnResponsesAllowed(): boolean { return true;
random_line_split
feedback-msq-question-details.impl.ts
// tslint:disable-next-line:max-line-length import { MsqQuestionStatisticsCalculation } from '../../app/components/question-types/question-statistics/question-statistics-calculation/msq-question-statistics-calculation'; import { FeedbackMsqQuestionDetails, FeedbackParticipantType, FeedbackQuestionType, QuestionOu...
isInstructorCommentsOnResponsesAllowed(): boolean { return true; } }
{ return false; }
identifier_body
feedback-msq-question-details.impl.ts
// tslint:disable-next-line:max-line-length import { MsqQuestionStatisticsCalculation } from '../../app/components/question-types/question-statistics/question-statistics-calculation/msq-question-statistics-calculation'; import { FeedbackMsqQuestionDetails, FeedbackParticipantType, FeedbackQuestionType, QuestionOu...
statsRows.push(...this.getQuestionCsvStatsFrom(statsCalculation, statsCalculation.question.hasAssignedWeights)); return statsRows; } isParticipantCommentsOnResponsesAllowed(): boolean { return false; } isInstructorCommentsOnResponsesAllowed(): boolean { return true; } }
{ // skip stats for no response return []; }
conditional_block
feedback-msq-question-details.impl.ts
// tslint:disable-next-line:max-line-length import { MsqQuestionStatisticsCalculation } from '../../app/components/question-types/question-statistics/question-statistics-calculation/msq-question-statistics-calculation'; import { FeedbackMsqQuestionDetails, FeedbackParticipantType, FeedbackQuestionType, QuestionOu...
extends AbstractFeedbackMcqMsqQuestionDetails implements FeedbackMsqQuestionDetails { msqChoices: string[] = []; otherEnabled: boolean = false; generateOptionsFor: FeedbackParticipantType = FeedbackParticipantType.NONE; maxSelectableChoices: number = Number.MIN_VALUE; minSelectableChoices: number = Numb...
FeedbackMsqQuestionDetailsImpl
identifier_name
Partier.ts
import { AchievementType, AchievementRewardType, Achievement, PermanentUpgrade } from '../../../../shared/interfaces'; import { Player } from '../../../../shared/models'; export class Partier extends Achievement { static readonly statWatches = ['Character/Movement/Steps/Party']; static readonly type = Achievement...
static calculateTier(player: Player): number { const steps = player.$statistics.get('Character/Movement/Steps/Party'); if(steps >= 1000000) return 3; if(steps >= 100000) return 2; if(steps >= 10000) return 1; return 0; } static rewardsForTier(tier: number): any[] { const baseRewards: any...
return baseStr; }
random_line_split
Partier.ts
import { AchievementType, AchievementRewardType, Achievement, PermanentUpgrade } from '../../../../shared/interfaces'; import { Player } from '../../../../shared/models'; export class Partier extends Achievement { static readonly statWatches = ['Character/Movement/Steps/Party']; static readonly type = Achievement...
if(tier >= 3) { baseStr = `${baseStr} Title: Party Parakeet.`; } return baseStr; } static calculateTier(player: Player): number { const steps = player.$statistics.get('Character/Movement/Steps/Party'); if(steps >= 1000000) return 3; if(steps >= 100000) return 2; if(steps >= 100...
{ baseStr = `${baseStr} Title: Synergistic. Personality: Telesheep. +5 max stamina.`; }
conditional_block
Partier.ts
import { AchievementType, AchievementRewardType, Achievement, PermanentUpgrade } from '../../../../shared/interfaces'; import { Player } from '../../../../shared/models'; export class
extends Achievement { static readonly statWatches = ['Character/Movement/Steps/Party']; static readonly type = AchievementType.Event; static descriptionForTier(tier: number): string { let baseStr = `Gain three personalities (Solo, Leader, Follower) for party-stepping 10,000 times.`; if(tier >= 2) { ...
Partier
identifier_name
test_v1beta1_deployment_rollback.py
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
if __name__ == '__main__': unittest.main()
""" V1beta1DeploymentRollback unit test stubs """ def setUp(self): pass def tearDown(self): pass def testV1beta1DeploymentRollback(self): """ Test V1beta1DeploymentRollback """ model = lib_openshift.models.v1beta1_deployment_rollback.V1beta1DeploymentRollba...
identifier_body
test_v1beta1_deployment_rollback.py
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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): pass def tearDown(self): pass def testV1beta1DeploymentRollback(self): """ Test V1beta1DeploymentRollback """ model = lib_openshift.models.v1beta1_deployment_rollback.V1beta1DeploymentRollback() if __name__ == '__main__': unittest.main()
setUp
identifier_name
test_v1beta1_deployment_rollback.py
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
unittest.main()
conditional_block
test_v1beta1_deployment_rollback.py
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
pass def testV1beta1DeploymentRollback(self): """ Test V1beta1DeploymentRollback """ model = lib_openshift.models.v1beta1_deployment_rollback.V1beta1DeploymentRollback() if __name__ == '__main__': unittest.main()
def setUp(self): pass def tearDown(self):
random_line_split
person.js
'use strict'; Object.defineProperty(exports, "__esModule", { value: true
var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin'); var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin); var _svgIcon = require('../../svg-icon'); var _svgIcon2 = _interopRequir...
});
random_line_split
person.js
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin'); var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMi...
var SocialPerson = _react2.default.createClass({ displayName: 'SocialPerson', mixins: [_reactAddonsPureRenderMixin2.default], render: function render() { return _react2.default.createElement( _svgIcon2.default, this.props, _react2.default.createElement('path', { d: 'M12 12c2.21 0 4-1.79 ...
{ return obj && obj.__esModule ? obj : { default: obj }; }
identifier_body
person.js
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin'); var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMi...
(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SocialPerson = _react2.default.createClass({ displayName: 'SocialPerson', mixins: [_reactAddonsPureRenderMixin2.default], render: function render() { return _react2.default.createElement( _svgIcon2.default, this.props, _...
_interopRequireDefault
identifier_name
registry.rs
the default url for the registry pub fn default_url() -> String { DEFAULT.to_string() } /// Decode the configuration stored within the registry. /// /// This requires that the index has been at least checked out. pub fn config(&self) -> CargoResult<RegistryConfig> { let content...
y `{}`", self.source_id.url()))); let repo = try!(self.open()); // git fetch origin let url = self.source_id.url().to_string(); let refspec = "refs/heads/*:refs/remotes/origin/*"; try!(git::fetch(&repo, &url, refspec).chain_error(|| { internal(format!("failed to fetc...
identifier_body
registry.rs
is sharded by the first //! letter of the crate name. //! //! Otherwise the top-level directory contains many two-letter directory names, //! each of which has many sub-folders with two letters. At the end of all these //! are the actual crate files themselves. //! //! The purpose of this layout is to hopefully cut do...
ig.index.unwrap_or(DEFAULT.to_string()); url.to_url().map_err(human) } /// Get the default url for the registry pub fn default_url() -> String { DEFAULT.to_string() } /// Decode the configuration stored within the registry. /// /// This requires that the index has been at l...
onf
identifier_name
registry.rs
, url: &Url) -> CargoResult<PathBuf> { // TODO: should discover filename from the S3 redirect let filename = format!("{}-{}.crate", pkg.name(), pkg.version()); let dst = self.cache_path.join(&filename); if fs::metadata(&dst).is_ok() { return Ok(dst) } try!...
Some(p) if p.starts_with(dep.name()) => {
random_line_split
ve.ce.View.js
/*! * VisualEditor ContentEditable View class. * * @copyright 2011-2014 VisualEditor Team and others; see http://ve.mit-license.org */ /** * Generic base class for CE views. * * @abstract * @extends OO.ui.Element * @mixins OO.EventEmitter * * @constructor * @param {ve.dm.Model} model Model to observe * @p...
ve.ce.View.prototype.isInContentEditable = function () { var node = this.$element[0].parentNode; while ( node && node.contentEditable === 'inherit' ) { node = node.parentNode; } return !!( node && node.contentEditable === 'true' ); }; /** * Render an HTML attribute list onto this.$element * * If no attributeL...
* @return {boolean} Node is inside a contentEditable node */
random_line_split
ve.ce.View.js
/*! * VisualEditor ContentEditable View class. * * @copyright 2011-2014 VisualEditor Team and others; see http://ve.mit-license.org */ /** * Generic base class for CE views. * * @abstract * @extends OO.ui.Element * @mixins OO.EventEmitter * * @constructor * @param {ve.dm.Model} model Model to observe * @p...
}; /** * Check if the node is inside a contentEditable node * * @return {boolean} Node is inside a contentEditable node */ ve.ce.View.prototype.isInContentEditable = function () { var node = this.$element[0].parentNode; while ( node && node.contentEditable === 'inherit' ) { node = node.parentNode; } return ...
{ this.emit( 'teardown' ); }
conditional_block
transcribe.rs
#[derive(Clone)] struct TtFrame { forest: TokenTree, idx: uint, dotdotdoted: bool, sep: Option<Token>, } #[derive(Clone)] pub struct TtReader<'a> { pub sp_diag: &'a SpanHandler, /// the unzipped tree: stack: Vec<TtFrame>, /* for MBE-style macro transcription */ interpolations: Hash...
TtToken(..) => LisUnconstrained, } } /// Return the next token from the TtReader. /// EFFECT: advances the reader's token field pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan { // FIXME(pcwalton): Bad copy? let ret_val = TokenAndSpan { tok: r.cur_tok.clone(), sp: r.cur_span...
{ match *t { TtDelimited(_, ref delimed) => { delimed.tts.iter().fold(LisUnconstrained, |size, tt| { size + lockstep_iter_size(tt, r) }) }, TtSequence(_, ref seq) => { seq.tts.iter().fold(LisUnconstrained, |size, tt| { size ...
identifier_body
transcribe.rs
#[derive(Clone)] struct TtFrame { forest: TokenTree, idx: uint, dotdotdoted: bool, sep: Option<Token>, } #[derive(Clone)] pub struct TtReader<'a> { pub sp_diag: &'a SpanHandler, /// the unzipped tree: stack: Vec<TtFrame>, /* for MBE-style macro transcription */ interpolations: Hash...
(self, other: LockstepIterSize) -> LockstepIterSize { match self { LisUnconstrained => other, LisContradiction(_) => self, LisConstraint(l_len, ref l_id) => match other { LisUnconstrained => self.clone(), LisContradiction(_) => other, ...
add
identifier_name
transcribe.rs
#[derive(Clone)] struct TtFrame { forest: TokenTree, idx: uint, dotdotdoted: bool, sep: Option<Token>, } #[derive(Clone)] pub struct TtReader<'a> { pub sp_diag: &'a SpanHandler, /// the unzipped tree: stack: Vec<TtFrame>, /* for MBE-style macro transcription */ interpolations: Hash...
None => {} } } } loop { /* because it's easiest, this handles `TtDelimited` not starting with a `TtToken`, even though it won't happen */ let t = { let frame = r.stack.last().unwrap(); // FIXME(pcwalton): Bad copy. fr...
{ r.cur_tok = tk; /* repeat same span, I guess */ return ret_val; }
conditional_block
transcribe.rs
_idx: Vec::new(), repeat_len: Vec::new(), desugar_doc_comments: desugar_doc_comments, /* dummy values, never read: */ cur_tok: token::Eof, cur_span: DUMMY_SP, }; tt_next_token(&mut r); /* get cur_tok and cur_span set up */ r } fn lookup_cur_matched_by_matched(r: &TtR...
} } }
random_line_split
narglatch_sick.py
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
templates = Vector() templates.add('object/mobile/shared_narglatch_hue.iff') mobileTemplate.setTemplates(templates) weaponTemplates = Vector() weapontemplate = WeaponTemplate('object/weapon/melee/unarmed/shared_unarmed_default.iff', WeaponType.UNARMED, 1.0, 6, 'kinetic') weaponTemplates.add(weapontemplate) mob...
mobileTemplate.setStalker(False)
random_line_split
narglatch_sick.py
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core):
templates = Vector() templates.add('object/mobile/shared_narglatch_hue.iff') mobileTemplate.setTemplates(templates) weaponTemplates = Vector() weapontemplate = WeaponTemplate('object/weapon/melee/unarmed/shared_unarmed_default.iff', WeaponType.UNARMED, 1.0, 6, 'kinetic') weaponTemplates.add(weapontemplate) m...
mobileTemplate = MobileTemplate() mobileTemplate.setCreatureName('narglatch_sick') mobileTemplate.setLevel(21) mobileTemplate.setDifficulty(Difficulty.NORMAL) mobileTemplate.setMinSpawnDistance(4) mobileTemplate.setMaxSpawnDistance(8) mobileTemplate.setDeathblow(False) mobileTemplate.setScale(1) mobileTempla...
identifier_body
narglatch_sick.py
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def
(core): mobileTemplate = MobileTemplate() mobileTemplate.setCreatureName('narglatch_sick') mobileTemplate.setLevel(21) mobileTemplate.setDifficulty(Difficulty.NORMAL) mobileTemplate.setMinSpawnDistance(4) mobileTemplate.setMaxSpawnDistance(8) mobileTemplate.setDeathblow(False) mobileTemplate.setScale(1) mob...
addTemplate
identifier_name
base.py
out[k] = v return out def _add_linking_libs(context, call): """ Add the required libs for the callable to allow inlining. """ libs = getattr(call, "libs", ()) if libs: context.add_linking_libs(libs) def register_class_type(cls, spec, class_ctor, builder): """ Interna...
key = (self.key, attr) def generic(self, args, kws): args = (instance,) + tuple(args) sig = disp_type.get_call_type(self.context, args, kws) return sig.as_method()
identifier_body
base.py
# get postitional and keyword arguments # offset by one to exclude the `self` arg args = _getargs(init_sig)[1:] cls._ctor_sig = init_sig ctor_source = _ctor_template.format(args=', '.join(args)) glbls = {"__numba_cls_": cls} exec(ctor_source, glbls) ctor = glbls[...
elif isinstance(spec, Sequence): spec = OrderedDict(spec) # Extend spec with class annotations. for attr, py_type in pt.get_type_hints(cls).items(): if attr not in spec: spec[attr] = as_numba_type(py_type) _validate_spec(spec) # Fix up private attribute names spec...
spec = OrderedDict()
conditional_block
base.py
# get postitional and keyword arguments # offset by one to exclude the `self` arg args = _getargs(init_sig)[1:] cls._ctor_sig = init_sig ctor_source = _ctor_template.format(args=', '.join(args)) glbls = {"__numba_cls_": cls} exec(ctor_source, glbls) ctor = glbls[...
(cls, instance): if isinstance(instance, _box.Box): return instance._numba_type_.class_type is cls.class_type return False def __call__(cls, *args, **kwargs): # The first argument of _ctor_sig is `cls`, which here # is bound to None and then skipped when invoking the con...
__instancecheck__
identifier_name
base.py
): # Redirect resolution to __init__ instance_type = self.key.instance_type ctor = instance_type.jit_methods['__init__'] boundargs = (instance_type.get_reference_type(),) + args disp_type = types.Dispatcher(ctor) sig = disp_type.get_call_type(self.context, boundargs, kws)...
call = context.get_function(disp_type, sig) call(builder, (target, val)) _add_linking_libs(context, call)
random_line_split
event_serializer.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const MOUSE_EVENT_PROPERTIES = [ 'altKey', 'button', 'clientX', 'clientY', 'metaKey', 'movementX', 'movementY', 'of...
} return serializedEvent; } function serializeEvent(e: any, properties: string[]): {[key: string]: any} { const serialized: {[k: string]: any} = {}; for (let i = 0; i < properties.length; i++) { const prop = properties[i]; serialized[prop] = e[prop]; } return serialized; }
{ serializedEvent['target']['files'] = target.files; }
conditional_block
event_serializer.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const MOUSE_EVENT_PROPERTIES = [ 'altKey', 'button', 'clientX', 'clientY', 'metaKey', 'movementX', 'movementY', 'of...
(e: Event): {[key: string]: any} { return serializeEvent(e, EVENT_PROPERTIES); } // TODO(jteplitz602): Allow users to specify the properties they need rather than always // adding value and files #3374 export function serializeEventWithTarget(e: Event): {[key: string]: any} { const serializedEvent = serializeEvent...
serializeGenericEvent
identifier_name
event_serializer.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ const MOUSE_EVENT_PROPERTIES = [ 'altKey', 'button', 'clientX', 'clientY', 'metaKey', 'movementX', 'movementY', 'of...
function serializeEvent(e: any, properties: string[]): {[key: string]: any} { const serialized: {[k: string]: any} = {}; for (let i = 0; i < properties.length; i++) { const prop = properties[i]; serialized[prop] = e[prop]; } return serialized; }
{ if (NODES_WITH_VALUE.has((<HTMLElement>e.target).tagName.toLowerCase())) { const target = <HTMLInputElement>e.target; serializedEvent['target'] = {'value': target.value}; if (target.files) { serializedEvent['target']['files'] = target.files; } } return serializedEvent; }
identifier_body
event_serializer.ts
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */
'offsetY', 'region', 'screenX', 'screenY', 'shiftKey' ]; const KEYBOARD_EVENT_PROPERTIES = [ 'altkey', 'charCode', 'code', 'ctrlKey', 'isComposing', 'key', 'keyCode', 'location', 'metaKey', 'repeat', 'shiftKey', 'which' ]; const TRANSITION_EVENT_PROPERTIES = ['propertyName', 'elapsedTime', 'pseudoElement']; co...
const MOUSE_EVENT_PROPERTIES = [ 'altKey', 'button', 'clientX', 'clientY', 'metaKey', 'movementX', 'movementY', 'offsetX',
random_line_split
zh-tw.py
py 已發行: %s', 'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': '注意: 登入管理帳號需要安全連線(HTTPS)或是在本機連線(localhost).', 'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': '注意: 因為在測試模式不保證多執行緒安全性,也就是說不可以同時執行多個測試案例', 'ATTENTION: you cannot edit the running applicat...
random_line_split
collada.rs
PrimitiveIndicesCount { primitive_count: usize, stride: usize, index_count: usize, }, /// Indicates an error in loading or parsing the original collada document (i.e. the error /// ocurred within the parse-collada library). ParseColladaError(collada::Error), /// Indicates t...
(from: collada::Error) -> Error { Error::ParseColladaError(from) } } pub type Result<T> = ::std::result::Result<T, Error>; pub enum VertexSemantic { Position, Normal, TexCoord, } /// Loads all resources from a COLLADA document and adds them to the resource manager. pub fn load_resources<T: In...
from
identifier_name
collada.rs
PrimitiveIndicesCount { primitive_count: usize, stride: usize, index_count: usize, }, /// Indicates an error in loading or parsing the original collada document (i.e. the error /// ocurred within the parse-collada library). ParseColladaError(collada::Error), /// Indicates t...
mesh_builder .set_indices(&*indices) .build() .map_err(|err| Error::BuildMeshError(err)) } struct IndexMapper<'a> { offset: usize, semantic: &'a str, data: &'a [f32], }
let indices: Vec<u32> = (0..vertex_count).collect();
random_line_split
collada.rs
While this is technically allowed by the standard I'm not really sure what /// to do with that? Like how do you define a mesh without indices? MissingPrimitiveIndices, /// Indicates that a uri referenced an asset outside the document. NonLocalUri(String), UnsupportedGeometricElement, Unsuppor...
{ if self.next == self.end { return None; } let next = self.next; self.next = unsafe { self.next.offset(self.stride as isize) }; Some(unsafe { ::std::slice::from_raw_parts(next, self.stride) }) }
identifier_body
pow.js
/* Copyright (c) 2012 Greg Reimer ( http://obadger.com/ ) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
DEALINGS IN THE SOFTWARE. */ (function(w, d, $){ // defaults var defaultArgs = { rays: 16, originX: '50%', originY: '50%', bgColorStart: 'rgba(0,0,0,0.1)', bgColorEnd: 'rgba(0,0,0,0.2)', rayColorStart: 'hsla(0,0%,100%,0.2)', rayColorEnd: 'hsla(0,0%,100%,0.3)', sizingRatio: 1 }; ...
random_line_split
pow.js
/* Copyright (c) 2012 Greg Reimer ( http://obadger.com/ ) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
// convert to absolute lengths originX = width * originX; originY = height * originY; // find maximum distance to a corner var radius = Math.max.apply(Math, [ {x:0,y:0}, {x:width,y:0}, {x:0,y:height}, {x:width,y:height} ].map(function(c){ //...
{ var $oel = $(args.originEl); if ($oel.length) { var oOffset = $oel.offset(); var oWidth = $oel.outerWidth(); var oHeight = $oel.outerHeight(); originX = (((oOffset.left - offset.left) + (oWidth / 2)) / width); originY = (((oOffset.top - offset.top) + (...
conditional_block
mutref.rs
#[derive(Debug)] enum List { Cons(Rc<RefCell<i32>>, Rc<List>), Nil, } use self::List::{Cons, Nil}; use std::rc::Rc; use std::cell::RefCell; pub fn run()
{ let value = Rc::new(RefCell::new(5)); let a = Rc::new(Cons(Rc::clone(&value), Rc::new(Nil))); let b = Cons(Rc::new(RefCell::new(6)), Rc::clone(&a)); let c = Cons(Rc::new(RefCell::new(10)), Rc::clone(&a)); println!("a before = {:?}", a); println!("b before = {:?}", b); println!("c before = ...
identifier_body
mutref.rs
#[derive(Debug)] enum
{ Cons(Rc<RefCell<i32>>, Rc<List>), Nil, } use self::List::{Cons, Nil}; use std::rc::Rc; use std::cell::RefCell; pub fn run() { let value = Rc::new(RefCell::new(5)); let a = Rc::new(Cons(Rc::clone(&value), Rc::new(Nil))); let b = Cons(Rc::new(RefCell::new(6)), Rc::clone(&a)); let c = Cons(Rc:...
List
identifier_name
mutref.rs
#[derive(Debug)] enum List { Cons(Rc<RefCell<i32>>, Rc<List>), Nil, } use self::List::{Cons, Nil}; use std::rc::Rc; use std::cell::RefCell;
let value = Rc::new(RefCell::new(5)); let a = Rc::new(Cons(Rc::clone(&value), Rc::new(Nil))); let b = Cons(Rc::new(RefCell::new(6)), Rc::clone(&a)); let c = Cons(Rc::new(RefCell::new(10)), Rc::clone(&a)); println!("a before = {:?}", a); println!("b before = {:?}", b); println!("c before = {:...
pub fn run() {
random_line_split
client.py
from datetime import datetime import functools import os import uuid from time import time from django.conf import settings from django_statsd.clients import statsd from mock import Mock from requests import post from suds import client as sudsclient from suds.transport import Reply from suds.transport.http import Ht...
log = getLogger('s.bango') class Client(object): def __getattr__(self, attr): for name, methods in (['exporter', exporter], ['billing', billing], ['direct', direct]): if attr in methods: return functools.partial(se...
return name + 'Result'
identifier_body
client.py
from datetime import datetime import functools import os import uuid from time import time from django.conf import settings from django_statsd.clients import statsd from mock import Mock from requests import post from suds import client as sudsclient from suds.transport import Reply from suds.transport.http import Ht...
'eventNotificationURL': '', 'status': 'LIC', 'sbiAgreementAccepted': True, 'acceptedSBIAgreement': datetime.today, 'sbiAgreementExpires': datetime.today, } } class ClientMock(Client): def mock_results(self, key, data=None): """ Returns result for a key....
'eventNotificationEnabled': False,
random_line_split
client.py
from datetime import datetime import functools import os import uuid from time import time from django.conf import settings from django_statsd.clients import statsd from mock import Mock from requests import post from suds import client as sudsclient from suds.transport import Reply from suds.transport.http import Ht...
(self, key, data=None): """ Returns result for a key. Data can be passed in to override mock_data. """ result = data or mock_data.get(key, {}).copy() for key, value in (['responseCode', 'OK'], ['responseMessage', '']): if key not in result: result[key]...
mock_results
identifier_name
client.py
from datetime import datetime import functools import os import uuid from time import time from django.conf import settings from django_statsd.clients import statsd from mock import Mock from requests import post from suds import client as sudsclient from suds.transport import Reply from suds.transport.http import Ht...
raise AttributeError('Unknown request: %s' % attr) def call(self, name, data, wsdl='exporter'): client = self.client(wsdl) package = client.factory.create(get_request(name)) for k, v in data.iteritems(): setattr(package, k, v) package.username = settings.BANGO_A...
if attr in methods: return functools.partial(self.call, attr, wsdl=str(name))
conditional_block
authproxy.py
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
(self): http_response = self.__conn.getresponse() if http_response is None: raise JSONRPCException({ 'code': -342, 'message': 'missing HTTP response from server'}) responsedata = http_response.read().decode('utf8') response = json.loads(responsedata, parse_fl...
_get_response
identifier_name
authproxy.py
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
responsedata = http_response.read().decode('utf8') response = json.loads(responsedata, parse_float=decimal.Decimal) if "error" in response and response["error"] is None: log.debug("<-%s- %s"%(response["id"], json.dumps(response["result"], default=EncodeDecimal))) else: ...
raise JSONRPCException({ 'code': -342, 'message': 'missing HTTP response from server'})
conditional_block
authproxy.py
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
'id': AuthServiceProxy.__id_count}, default=EncodeDecimal) self.__conn.request('POST', self.__url.path, postdata, {'Host': self.__url.hostname, 'User-Agent': USER_AGENT, 'Authorization': self.__a...
log.debug("-%s-> %s %s"%(AuthServiceProxy.__id_count, self.__service_name, json.dumps(args, default=EncodeDecimal))) postdata = json.dumps({'version': '1.1', 'method': self.__service_name, 'params': args,
random_line_split
authproxy.py
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
def _get_response(self): http_response = self.__conn.getresponse() if http_response is None: raise JSONRPCException({ 'code': -342, 'message': 'missing HTTP response from server'}) responsedata = http_response.read().decode('utf8') response = json.loads...
postdata = json.dumps(list(rpc_call_list), default=EncodeDecimal) log.debug("--> "+postdata) self.__conn.request('POST', self.__url.path, postdata, {'Host': self.__url.hostname, 'User-Agent': USER_AGENT, 'Authorization...
identifier_body
TransactionDetailsSummaryItem.tsx
import { TransactionDetailsSummaryItem_order } from "v2/__generated__/TransactionDetailsSummaryItem_order.graphql" import React from "react" import { createFragmentContainer, graphql } from "react-relay" import { Flex, Sans, Serif, Spacer } from "@artsy/palette" import { StepSummaryItem, StepSummaryItemProps, } fr...
getOffer(): TransactionDetailsSummaryItem_order["lastOffer"] | null { return this.props.useLastSubmittedOffer ? this.props.order.lastOffer : this.props.order.myLastOffer } shippingDisplayAmount = () => { const { order } = this.props switch (order.mode) { case "BUY": return o...
const { showOfferNote, offerOverride, order, ...others } = this.props return ( <StepSummaryItem {...others}> {this.renderPriceEntry()} <Spacer mb={2} /> <Entry label="Shipping" value={this.shippingDisplayAmount()} /> <Entry label="Tax" value={this.taxDisplayAmount()} /> ...
identifier_body
TransactionDetailsSummaryItem.tsx
import { TransactionDetailsSummaryItem_order } from "v2/__generated__/TransactionDetailsSummaryItem_order.graphql" import React from "react" import { createFragmentContainer, graphql } from "react-relay" import { Flex, Sans, Serif, Spacer } from "@artsy/palette" import { StepSummaryItem, StepSummaryItemProps, } fr...
{ const { showOfferNote, offerOverride, order, ...others } = this.props return ( <StepSummaryItem {...others}> {this.renderPriceEntry()} <Spacer mb={2} /> <Entry label="Shipping" value={this.shippingDisplayAmount()} /> <Entry label="Tax" value={this.taxDisplayAmount()} />...
nder()
identifier_name
TransactionDetailsSummaryItem.tsx
import { TransactionDetailsSummaryItem_order } from "v2/__generated__/TransactionDetailsSummaryItem_order.graphql" import React from "react" import { createFragmentContainer, graphql } from "react-relay" import { Flex, Sans, Serif, Spacer } from "@artsy/palette" import { StepSummaryItem, StepSummaryItemProps, } fr...
<Serif size={["2", "3t"]} color="black60"> {offer.note} </Serif> </> ) } } } interface SecondaryEntryProps { label: React.ReactNode value: React.ReactNode } interface EntryProps extends SecondaryEntryProps { final?: boolean } const Entry: React.SFC<EntryProps...
<> <Spacer mb={[2, 3]} /> <Serif size={["2", "3t"]} weight="semibold" color="black100"> Your note </Serif>
random_line_split
generate_blink_resource_map.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from string import Template import optparse import os import sys try: grit_module_path = os.path.join( os.path.dirname(__file__), '..', '..', '..'...
(): parser = optparse.OptionParser( usage='Usage: %prog --pak-file PAK_FILE --header HEADER --cpp CPP\n') parser.add_option('-i', '--pak-file', action='store', dest='pak_file', help='The .pak file to be extracted.') parser.add_option('', '--header', action='store', dest='header_file', ...
main
identifier_name
generate_blink_resource_map.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from string import Template import optparse import os import sys try: grit_module_path = os.path.join( os.path.dirname(__file__), '..', '..', '..'...
resourceIds.append(resId) hex_values = ['0x{0:02x}'.format(ord(char)) for char in data] f = lambda A, n=12: [A[i:i+n] for i in range(0, len(A), n)] hex_values_string = ',\n '.join(', '.join(x) for x in f(hex_values)) cpp_definition = \ 'const char kResource%s[%d] = {\n %s \n};' % \ ...
continue
conditional_block