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
osc_writer.rs
use std::convert::TryInto; use std::io::Write; use byteorder::{BigEndian, WriteBytesExt}; use error::ResultE; /// auto-implemented trait to write OSC data to a Write object. pub trait OscWriter: Write { fn osc_write_i32(&mut self, value: i32) -> ResultE<()> { Ok(self.write_i32::<BigEndian>(value)?) } ...
/// Write the OSC timetag, characterized by a (u32, u32) pair. /// The first u32 is the seconds, second is fraction of seconds. fn osc_write_timetag(&mut self, tag: (u32, u32)) -> ResultE<()> { self.write_u32::<BigEndian>(tag.0)?; self.write_u32::<BigEndian>(tag.1)?; Ok(()) } } ...
{ Ok(self.write_u8(b'b')?) }
identifier_body
osc_writer.rs
use std::convert::TryInto; use std::io::Write; use byteorder::{BigEndian, WriteBytesExt}; use error::ResultE; /// auto-implemented trait to write OSC data to a Write object. pub trait OscWriter: Write { fn osc_write_i32(&mut self, value: i32) -> ResultE<()> { Ok(self.write_i32::<BigEndian>(value)?) } ...
(&mut self, value: &str) -> ResultE<()> { self.write_all(value.as_bytes())?; // pad to 4-byte boundary, PLUS ensure we have at least one null terminator. let pad_bytes = 4 - (value.len() % 4); let zeros = b"\0\0\0\0"; Ok(self.write_all(&zeros[..pad_bytes])?) } fn write_st...
osc_write_str
identifier_name
env.py
from alembic import context from sqlalchemy import create_engine, pool from warehouse import db def run_migrations_offline(): """ Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine ...
if context.is_offline_mode(): run_migrations_offline() else: run_migrations_online()
""" Run migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context. """ options = context.config.get_section(context.config.config_ini_section) url = options.pop("url") engine = create_engine(url, poolclass=pool.NullPool) conne...
identifier_body
env.py
from alembic import context from sqlalchemy import create_engine, pool from warehouse import db def run_migrations_offline(): """ Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine ...
run_migrations_offline() else: run_migrations_online()
random_line_split
env.py
from alembic import context from sqlalchemy import create_engine, pool from warehouse import db def run_migrations_offline(): """ Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine ...
(): """ Run migrations in 'online' mode. In this scenario we need to create an Engine and associate a connection with the context. """ options = context.config.get_section(context.config.config_ini_section) url = options.pop("url") engine = create_engine(url, poolclass=pool.NullPool) ...
run_migrations_online
identifier_name
env.py
from alembic import context from sqlalchemy import create_engine, pool from warehouse import db def run_migrations_offline(): """ Run migrations in 'offline' mode. This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine ...
run_migrations_online()
conditional_block
bginit.rs
// Copyright 2021 The Evcxr Authors. // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
// The inititalization state. The states here more-or-less directly correspond // to different states of the `Once` inside the parent. // // - when `BgInitMutex::init` is in `OnceState::New`, the state should be // `BgInitState::Pending` // - when `BgInitMutex::init` is in `OnceState::Done`, the state should be // ...
self.ensure_ready(); let state = self.state.lock(); parking_lot::MutexGuard::map(state, |state| match state { BgInitState::Ready(v) => v, st => wrong_state(st, "Ready"), }) } }
identifier_body
bginit.rs
// Copyright 2021 The Evcxr Authors. // // 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 //
// See the License for the specific language governing permissions and // limitations under the License. use parking_lot::{MappedMutexGuard, Mutex, Once}; use std::thread::JoinHandle; // We're using `parking_lot`'s mutex so that we can get the mapped guards — it's // already in our dependency tree, and this lets us hi...
// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
random_line_split
bginit.rs
// Copyright 2021 The Evcxr Authors. // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
> { // guards us `join()`ing the background thread, and transitioning from // `BgInitState::Pending` to `BgInitState::Ready`. init: Once, // Call `ensure_ready()` before accessing. state: Mutex<BgInitState<T>>, } impl<T> BgInitMutex<T> { pub fn new<F>(f: F) -> Self where F: Send + '...
InitMutex<T
identifier_name
expressions.py
have a __lt__ method). opfunc = getattr(operator, "__%s__" % opname) @ophelper def operation(self, other): if reversed: self, other = other, self if allConstantNodes([self, other]): return ConstantNode(opfunc(self.value, other.value)) else: return...
leafNode = True
identifier_body
expressions.py
to boolean values is not tried because # ``bool(1) == True`` (same for 0 and False), so 0 and 1 would be # interpreted as booleans when ``False`` and ``True`` are already # supported. if isinstance(x, (bool, numpy.bool_)): return bool # ``long`` is not explicitly needed since ``int`` automa...
__neg__
identifier_name
expressions.py
def isConstant(ex): "Returns True if ex is a constant scalar of an allowed type." return isinstance(ex, (bool, int, long, float, double, complex, str)) def commonKind(nodes): node_kinds = [node.astKind for node in nodes] str_count = node_kinds.count('str') if 0 < str_count < len(node_kinds): # som...
random_line_split
expressions.py
axis = axis.value if axis is None: axis = interpreter.allaxes else: if axis < 0: axis = interpreter.maxdims - axis if axis > 254: raise ValueError("cannot encode axis") return RawNode(axis) def sum_func(a, axis=-1): axis = encode_axis(axis) if...
kind = commonKind(args)
conditional_block
delegation_tools.py
## ## func delegation tools ## These are some helper methods to make dealing with delegation ## dictionary trees a little more sane when dealing with delegation ## and related functions. ## ## Copyright 2008, Red Hat, Inc. ## Steve Salevan <ssalevan@redhat.com> ## ## This software may be freely redistributed under the ...
(object): """ Borrowing the groupby iterator class directly from the Python API as it does not exist in Pythons < 2.4 """ def __init__(self, iterable, key=None): if key is None: key = lambda x: x self.keyfunc = key self.it = iter(iterable) self.tgtke...
groupby
identifier_name
delegation_tools.py
## ## func delegation tools ## These are some helper methods to make dealing with delegation ## dictionary trees a little more sane when dealing with delegation ## and related functions. ## ## Copyright 2008, Red Hat, Inc. ## Steve Salevan <ssalevan@redhat.com> ## ## This software may be freely redistributed under the ...
self.keyfunc = key self.it = iter(iterable) self.tgtkey = self.currkey = self.currvalue = xrange(0) def __iter__(self): return self def next(self): while self.currkey == self.tgtkey: self.currvalue = self.it.next() # Exit on StopIteration self.cu...
key = lambda x: x
conditional_block
delegation_tools.py
## ## func delegation tools ## These are some helper methods to make dealing with delegation ## dictionary trees a little more sane when dealing with delegation ## and related functions. ## ## Copyright 2008, Red Hat, Inc. ## Steve Salevan <ssalevan@redhat.com> ## ## This software may be freely redistributed under the ...
for branchlet in get_all_paths(minion, v): branch_list.append(branchlet) single_branch = flatten_list(branch_list) if minion in single_branch: seq_list.append(single_branch) return seq_list if __name__ == "__main__": mymap = {'anthony':{'longpat...
""" Given a minion that exists in the given tree, this method returns all paths that exist from the top node to the minion in the delegation dictionary tree """ #This is an ugly kludge of franken-code. If someone with #more knowledge of graph theory than myself can improve this #module...
identifier_body
delegation_tools.py
## ## func delegation tools ## These are some helper methods to make dealing with delegation ## dictionary trees a little more sane when dealing with delegation ## and related functions. ## ## Copyright 2008, Red Hat, Inc. ## Steve Salevan <ssalevan@redhat.com> ## ## This software may be freely redistributed under the ...
print "Element: %s, best path: %s" % (elem, get_shortest_path(elem,mymap)) print "- OK, now the whole thing:" for elem in match_glob_in_tree('*',mymap): print "Element: %s, best path: %s" % (elem, get_shortest_path(elem,mymap)) print "- And finally, with all duplicates remo...
print "Element: %s, all paths: %s" % (elem, get_all_paths(elem,mymap)) print "best path: %s" % get_shortest_path(elem, mymap) print "- Testing an element that is simply a minion and has no sub-nodes:" for elem in match_glob_in_tree('*minion',mymap):
random_line_split
archiva-request.service.ts
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
if (message.message==null || message.message=='') { message.message = this.translateError(message); } } } return errorResult; } }
{ console.log("Error " + httpError); if (httpError == null) { return new ErrorResult([]); } let errorResult if (httpError.error) { errorResult = new ErrorResult(httpError.error); } else { if (httpError.statusText!=null) { ...
identifier_body
archiva-request.service.ts
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
}
} } return errorResult; }
random_line_split
archiva-request.service.ts
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
() { this.accessToken = null; } private getToken(): string { if (this.accessToken != null) { return this.accessToken; } else { let token = localStorage.getItem("access_token"); if (token != null && token != "") { this.accessToken = tok...
resetToken
identifier_name
common.py
"""Provide common test tools for Z-Wave JS.""" AIR_TEMPERATURE_SENSOR = "sensor.multisensor_6_air_temperature" HUMIDITY_SENSOR = "sensor.multisensor_6_humidity" ENERGY_SENSOR = "sensor.smart_plug_with_two_usb_ports_value_electric_consumed_2" POWER_SENSOR = "sensor.smart_plug_with_two_usb_ports_value_electric_consumed" ...
"binary_sensor.multisensor_6_home_security_motion_detection" ) NOTIFICATION_MOTION_SENSOR = "sensor.multisensor_6_home_security_motion_sensor_status" PROPERTY_DOOR_STATUS_BINARY_SENSOR = ( "binary_sensor.august_smart_lock_pro_3rd_gen_the_current_status_of_the_door" ) CLIMATE_RADIO_THERMOSTAT_ENTITY = "climate.z...
NOTIFICATION_MOTION_BINARY_SENSOR = (
random_line_split
patrol_smach_iterator.py
a robot using SMACH to patrol a square area a specified number of times Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2013 Patrick Goebel. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public L...
with self.sm_patrol_iterator: # Initialize the patrol state machine self.sm_patrol = StateMachine(outcomes=['succeeded','aborted','preempted','continue']) # Add the states to the state machine with the appropriate transitions ...
it = lambda: range(0, self.n_patrols), output_keys = [], it_label = 'index', exhausted_outcome = 'succeeded')
random_line_split
patrol_smach_iterator.py
Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.5 This program 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 ...
try: main() except rospy.ROSInterruptException: rospy.loginfo("SMACH test finished.")
conditional_block
patrol_smach_iterator.py
a robot using SMACH to patrol a square area a specified number of times Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2013 Patrick Goebel. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public L...
self.n_succeeded = 0 self.n_aborted = 0 self.n_preempted = 0 self.n_patrols = 2 # Turn the waypoints into SMACH states nav_states = list() for waypoint in self.waypoints: nav_goal = MoveBaseGoal() nav_goal.targe...
def __init__(self): rospy.init_node('patrol_smach', anonymous=False) # Set the shutdown function (stop the robot) rospy.on_shutdown(self.shutdown) # Initialize a number of parameters and variables self.init() # Subscribe to the move_base action ...
identifier_body
patrol_smach_iterator.py
area a specified number of times Created for the Pi Robot Project: http://www.pirobot.org Copyright (c) 2013 Patrick Goebel. All rights reserved. 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 Sof...
shutdown
identifier_name
member.rs
use super::client::{MemberClient, ObserverClient}; use super::heartbeat_rpc::*; use super::raft::client::SMClient; use super::DEFAULT_SERVICE_ID; use bifrost_hasher::hash_str; use raft::client::RaftClient; use raft::state_machine::master::ExecError; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use...
thread::sleep(time::Duration::from_millis(PING_INTERVAL)) } }); return service; } pub fn close(&self) { self.closed.store(true, Ordering::Relaxed); } pub fn leave(&self) -> impl Future<Item = Result<(), ()>, Error = ExecError> { se...
{ let heartbeat_client = AsyncServiceClient::new(DEFAULT_SERVICE_ID, &rpc_client); heartbeat_client.ping(service_clone.id); }
conditional_block
member.rs
use super::client::{MemberClient, ObserverClient}; use super::heartbeat_rpc::*; use super::raft::client::SMClient; use super::DEFAULT_SERVICE_ID; use bifrost_hasher::hash_str; use raft::client::RaftClient; use raft::state_machine::master::ExecError; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use...
(&self) -> impl Future<Item = Result<(), ()>, Error = ExecError> { self.close(); self.sm_client.leave(&self.id) } pub fn join_group( &self, group: &String, ) -> impl Future<Item = Result<(), ()>, Error = ExecError> { self.member_client.join_group(group) } pub ...
leave
identifier_name
member.rs
use super::client::{MemberClient, ObserverClient}; use super::heartbeat_rpc::*; use super::raft::client::SMClient; use super::DEFAULT_SERVICE_ID; use bifrost_hasher::hash_str; use raft::client::RaftClient; use raft::state_machine::master::ExecError; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use...
use futures::prelude::*; static PING_INTERVAL: u64 = 100; pub struct MemberService { member_client: MemberClient, sm_client: Arc<SMClient>, raft_client: Arc<RaftClient>, address: String, closed: AtomicBool, id: u64, } impl MemberService { pub fn new(server_address: &String, raft_client: &...
random_line_split
member.rs
use super::client::{MemberClient, ObserverClient}; use super::heartbeat_rpc::*; use super::raft::client::SMClient; use super::DEFAULT_SERVICE_ID; use bifrost_hasher::hash_str; use raft::client::RaftClient; use raft::state_machine::master::ExecError; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use...
pub fn client(&self) -> ObserverClient { ObserverClient::new_from_sm(&self.sm_client) } pub fn get_server_id(&self) -> u64 { self.id } } impl Drop for MemberService { fn drop(&mut self) { self.leave(); } }
{ self.member_client.leave_group(group) }
identifier_body
topo2ViewController.js
/* * Copyright 2016-present Open Networking Laboratory * * 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 appli...
ViewController.prototype = { initialize: function () { } }; angular.module('ovTopo2') .factory('Topo2ViewController', [ 'FnService', function (fn) { ViewController.extend = fn.extend; return ViewController; } ...
{ this.initialize.apply(this, arguments); }
identifier_body
topo2ViewController.js
/* * Copyright 2016-present Open Networking Laboratory * * 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 appli...
} ]); })();
ViewController.extend = fn.extend; return ViewController;
random_line_split
topo2ViewController.js
/* * Copyright 2016-present Open Networking Laboratory * * 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 appli...
(options) { this.initialize.apply(this, arguments); } ViewController.prototype = { initialize: function () { } }; angular.module('ovTopo2') .factory('Topo2ViewController', [ 'FnService', function (fn) { ViewController.extend = fn...
ViewController
identifier_name
fr.js
// This file was generated by silverstripe/cow from javascript/lang/src/fr.js. // See https://github.com/tractorcow/cow for details if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') { if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined'); } else { ss.i18n.addDictionary('fr', {
"Workflow.DeleteQuestion": "Are you sure you want to permanently delete this?", "Workflow.EMBARGOMESSAGETIME": "Saved drafts of this page will auto publish today at <a>%s</a>", "Workflow.EMBARGOMESSAGEDATE": "Saved drafts of this page will auto publish on <a>%s</a>", "Workflow.EMBARGOMESSAGEDATETIME": "...
random_line_split
diagnostic.rs
pub fn fileline_note(&self, sp: Span, msg: &str) { self.handler.custom_emit(&self.cm, FileLine(sp), msg, Note); } pub fn fileline_help(&self, sp: Span, msg: &str) { self.handler.custom_emit(&self.cm, FileLine(sp), msg, Help); } pub fn span_bug(&self, sp: Span, msg: &str) -> ! { ...
{ self.handler.custom_emit(&self.cm, Suggestion(sp, suggestion), msg, Help); }
identifier_body
diagnostic.rs
self.handler.bump_err_count(); } pub fn span_warn(&self, sp: Span, msg: &str) { self.handler.emit(Some((&self.cm, sp)), msg, Warning); } pub fn span_warn_with_code(&self, sp: Span, msg: &str, code: &str) { self.handler.emit_with_code(Some((&self.cm, sp)), msg, code, Warning); ...
self.handler.emit(Some((&self.cm, sp)), msg, Error); self.handler.bump_err_count(); } pub fn span_err_with_code(&self, sp: Span, msg: &str, code: &str) { self.handler.emit_with_code(Some((&self.cm, sp)), msg, code, Error);
random_line_split
diagnostic.rs
, msg: &str) -> ! { self.handler.emit(Some((&self.cm, sp)), msg, Bug); panic!(ExplicitBug); } pub fn span_unimpl(&self, sp: Span, msg: &str) -> ! { self.span_bug(sp, &format!("unimplemented {}", msg)); } pub fn handler<'a>(&'a self) -> &'a Handler { &self.handler } } ...
(&self) { self.err_count.set(self.err_count.get() + 1); } pub fn err_count(&self) -> usize { self.err_count.get() } pub fn has_errors(&self) -> bool { self.err_count.get() > 0 } pub fn abort_if_errors(&self) { let s; match self.err_count.get() { ...
bump_err_count
identifier_name
diagnostic.rs
EndSpan(_) = rsp { let span_end = Span { lo: sp.hi, hi: sp.hi, expn_id: sp.expn_id}; cm.span_to_string(span_end) } else { cm.span_to_string(sp) }; try!(print_diagnostic(dst, &ss[..], lvl, msg, code)); match rsp { FullSpan(_) => { try!(highlight_lines(dst, c...
{ try!(write!(&mut w.dst, "{}:{} {}\n", fm.name, line_info.line_index + 1, line)); }
conditional_block
trajectory_batch_stats_test.py
# coding=utf-8 # Copyright 2018 The Google Research Authors. # # 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 applicab...
(self): """Checks if the length of each trajectory in the batch is correct.""" # pylint: disable=invalid-name TF_TEST_MASK = tf.constant(NP_TEST_MASK) TF_TEST_MASK_TF_F64 = tf.cast(TF_TEST_MASK, tf.float64) NP_TEST_MASK_NP_F64 = NP_TEST_MASK.astype(np.float64) ALL_MASKS = [ TF_TEST_MASK...
test_get_trajectory_lengths
identifier_name
trajectory_batch_stats_test.py
# coding=utf-8 # Copyright 2018 The Google Research Authors. # # 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 applicab...
dict( testcase_name='entropies', raw_batch=np.array([[1, 2, 3, 4]] * 5).astype(np.float32), statistic_function=tbs.entropy_summaries, expected_results_with_traj={ 'mean_step_entropy': (3. / 3 + 10. / 5 + 6. / 2 + 4. / 1) / 4.0, 'mean_trajectory_e...
}, expected_results_no_traj={ 'mean_trajectory_reward': (5 + 10 + 15 + 20) / 4.0, 'mean_step_reward': (1 + 2 + 3 + 4) / 4.0 }),
random_line_split
trajectory_batch_stats_test.py
# coding=utf-8 # Copyright 2018 The Google Research Authors. # # 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 applicab...
if __name__ == '__main__': tf.enable_eager_execution() tf.test.main()
test_returns = np.array([[0.125, 1.875, 0.25, 1.5], [0.25, 1.75, 0.5, 1.0], [0.5, 1.5, 1.0, 0.0]]) stats = tbs.return_summaries(test_returns) expected_mean_return = (0.125 + 1.875 + 0.25 + 1.5) / 4.0 self.assertEqual(stats['mean_trajectory_return'].numpy(), ...
identifier_body
trajectory_batch_stats_test.py
# coding=utf-8 # Copyright 2018 The Google Research Authors. # # 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 applicab...
if expected_results_no_traj is not None: stat = self.run_without_lengths(statistic_function, (raw_batch,)) for expected_key in expected_results_no_traj.keys(): self.assertAllClose(stat[expected_key].numpy(), expected_results_no_traj[expected_key]) def test_reward...
self.assertAllClose(stat[expected_key].numpy(), expected_results_with_traj[expected_key])
conditional_block
left-nav.js
var React = require('react'); var KeyCode = require('./utils/key-code'); var StylePropable = require('./mixins/style-propable'); var AutoPrefix = require('./styles/auto-prefix'); var Transitions = require('./styles/transitions'); var WindowListenable = require('./mixins/window-listenable'); var Overlay = require('./ove...
render: function() { var selectedIndex = this.props.selectedIndex; var overlay; var styles = this.getStyles(); if (!this.props.docked) { overlay = React.createElement(Overlay, {ref: "overlay", show: this.state.open, transitionEnabled: !this.st...
return styles; },
random_line_split
MeshFunctions.js
/* Copyright (C) 2011-2014 Mattias Ekendahl. Used under MIT license, see full details at https://github.com/developedbyme/dbm/blob/master/LICENSE.txt */ dbm.registerClass("dbm.utils.geometry.MeshFunctions", null, function(objectFunctions, staticFunctions, ClassReference) { //console.log("dbm.utils.geometry.MeshFunctio...
} return returnIndex; }; });
{ maxValue = xValue; returnIndex = i; }
conditional_block
MeshFunctions.js
/* Copyright (C) 2011-2014 Mattias Ekendahl. Used under MIT license, see full details at https://github.com/developedbyme/dbm/blob/master/LICENSE.txt */ dbm.registerClass("dbm.utils.geometry.MeshFunctions", null, function(objectFunctions, staticFunctions, ClassReference) { //console.log("dbm.utils.geometry.MeshFunctio...
//Constants staticFunctions.getMaxPoint2d = function(aPointsArray, aAngle) { var returnIndex = -1; var maxValue = NaN; var sinValue = Math.sin(aAngle); var cosValue = Math.cos(aAngle); var currentArray = aPointsArray; var currentArrayLength = currentArray.length; for(var i = 0; i < currentA...
//Dependencies //Utils
random_line_split
pysupport.py
# -*- coding: iso-8859-1 -*- """ MoinMoin - Supporting function for Python magic @copyright: 2002 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ ############################################################################# ### Module import / Plugins ##########################...
matches = [pyre.match(fn) for fn in dirlist] modules = [match.group(1) for match in matches if match] modules.sort() return modules def importName(modulename, name): """ Import name dynamically from module Used to do dynamic import of modules and names that you know their names only in...
pyre = re.compile(r"^([^_].*)\.py$") dirlist = os.listdir(packagedir)
conditional_block
pysupport.py
# -*- coding: iso-8859-1 -*-
""" MoinMoin - Supporting function for Python magic @copyright: 2002 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ ############################################################################# ### Module import / Plugins #######################################################...
random_line_split
pysupport.py
# -*- coding: iso-8859-1 -*- """ MoinMoin - Supporting function for Python magic @copyright: 2002 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ ############################################################################# ### Module import / Plugins ##########################...
matches = [pyre.match(fn) for fn in dirlist] modules = [match.group(1) for match in matches if match] modules.sort() return modules def importName(modulename, name): """ Import name dynamically from module Used to do dynamic import of modules and names that you know their names only in...
""" Return a list of modules for a package, omitting any modules starting with an underscore. """ import os, re packagedir = os.path.dirname(packagefile) in_plugin_dir = lambda dir, ops=os.path.split: ops(ops(dir)[0])[1] == "plugin" moinmodule = __import__('MoinMoin') # Is it in a .z...
identifier_body
pysupport.py
# -*- coding: iso-8859-1 -*- """ MoinMoin - Supporting function for Python magic @copyright: 2002 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ ############################################################################# ### Module import / Plugins ##########################...
(packagefile): """ Return a list of modules for a package, omitting any modules starting with an underscore. """ import os, re packagedir = os.path.dirname(packagefile) in_plugin_dir = lambda dir, ops=os.path.split: ops(ops(dir)[0])[1] == "plugin" moinmodule = __import__('MoinMoin') ...
getPackageModules
identifier_name
monomorphize.rs
(ccx, fn_id.node), mono_ty, true); } } debug!("mono_ty = {} (post-substitution)", mono_ty.repr(ccx.tcx())); let mono_ty = normalize_associated_type(ccx.tcx(), &mono_ty); debug!("mono_ty = {} (post-normalization)", mono_ty.repr(ccx.tcx())); ccx.stats().n_monos.set(ccx.stats().n_monos.get()...
{ debug!("normalize_associated_type(t={})", value.repr(tcx)); let value = erase_regions(tcx, value); if !value.has_projection_types() { return value; } // FIXME(#20304) -- cache let infcx = infer::new_infer_ctxt(tcx); let typer = NormalizingClosureTyper::new(tcx); let mut sel...
identifier_body
monomorphize.rs
// file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file...
random_line_split
monomorphize.rs
::ast_util::local_def; use syntax::attr; use syntax::codemap::DUMMY_SP; use std::hash::{Hasher, Hash, SipHasher}; pub fn
<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_id: ast::DefId, psubsts: &'tcx subst::Substs<'tcx>, ref_id: Option<ast::NodeId>) -> (ValueRef, Ty<'tcx>, bool) { debug!("monomorphic_fn(\ fn_id={}, \ ...
monomorphic_fn
identifier_name
require.d.ts
require-2.1.8.d.ts may be freely distributed under the MIT license. Copyright (c) 2013 Josh Baldwin https://github.com/jbaldwin/require.d.ts 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 withou...
map?: { [id: string]: { [id: string]: string; }; }; /** * Allows pointing multiple module IDs to a module ID that contains a bundle of modules. * * @example * requirejs.config({ * bundles: { * 'primary': ['main', 'util', 'text', 'text!template.html'], * 'secondary': ['text!secondary.html'] * } * }...
* 'foo': 'foo1.0' * } * } * }); **/
random_line_split
csv.js
require("should"); var dataUtil = require("../../data-util/garment-purchasing/garment-currency-data-util"); var helper = require("../../helper"); // var validate = require("dl-models").validator.garmentPurchasing.garmentPurchaseOrder; var moment = require('moment'); var Manager = require("../../../src/managers/garment...
done(e); }); }); it('#03. should success when insert csv', function (done) { var dataTest = {}; dataTest.data = [ ["Mata Uang", "Kurs"], ["USD", "9999"], ]; dataTest.date = new Date(); manager.insert(dataTest) .then(result => { result.should.i...
.catch(e => {
random_line_split
init_project.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script can generate automate scripts for open source python project. Scroll to ``if __name__ == "__main__":`` for more info. """ from __future__ import print_function import sys import datetime from os import walk, mkdir from os.path import join, abspath, dirnam...
def initiate_project( package_name, repo_name, python_version, github_username, author_name, author_email, maintainer_name, maintainer_email, year, s3_bucket, ): """ Generate project start files. """ print("Initate '%...
"""Read string from text file. """ with open(path, "rb") as f: return f.read().decode(encoding)
identifier_body
init_project.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script can generate automate scripts for open source python project. Scroll to ``if __name__ == "__main__":`` for more info. """ from __future__ import print_function import sys import datetime from os import walk, mkdir from os.path import join, abspath, dirnam...
# make destination directory try: print(" Create '%s' ..." % dst_dir) mkdir(dst_dir) except: pass # files for filename in file_list: src = join(src_dir, filename) dst = join(dst_dir, filename) content ...
dst_dir = join(dirname(dst_dir), package_name)
conditional_block
init_project.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script can generate automate scripts for open source python project. Scroll to ``if __name__ == "__main__":`` for more info. """ from __future__ import print_function import sys import datetime from os import walk, mkdir from os.path import join, abspath, dirnam...
year = str(datetime.datetime.utcnow().year) s3_bucket = "www.wbh-doc.com" # IMPORTANT initiate_project( package_name, repo_name, python_version, github_username, author_name, author_email, maintainer_name, maintainer_email, year, ...
author_email = "husanhe@gmail.com" # IMPORTANT maintainer_name = author_name maintainer_email = author_email
random_line_split
init_project.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script can generate automate scripts for open source python project. Scroll to ``if __name__ == "__main__":`` for more info. """ from __future__ import print_function import sys import datetime from os import walk, mkdir from os.path import join, abspath, dirnam...
( package_name, repo_name, python_version, github_username, author_name, author_email, maintainer_name, maintainer_email, year, s3_bucket, ): """ Generate project start files. """ print("Initate '%s-project' from templat...
initiate_project
identifier_name
struct_add_field.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
() { }
main
identifier_name
struct_add_field.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
let x: Y = Y { y: 'c' }; } pub fn main() { }
embed.x.x as u32 } #[rustc_clean(label="TypeckTables", cfg="rpass2")] pub fn use_Y() {
random_line_split
random.py
""" Statistics for astronomy """ import numpy as np from scipy.stats.distributions import rv_continuous def bivariate_normal(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0, size=None, return_cov=False): """Sample points from a 2D normal distribution Parameters ---------- mu : array-lik...
#---------------------------------------------------------------------- # Define some new distributions based on rv_continuous class trunc_exp_gen(rv_continuous): """A truncated positive exponential continuous random variable. The probability distribution is:: p(x) ~ exp(k * x) between a and b ...
return x
conditional_block
random.py
""" Statistics for astronomy """ import numpy as np from scipy.stats.distributions import rv_continuous def bivariate_normal(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0, size=None, return_cov=False): """Sample points from a 2D normal distribution Parameters ---------- mu : array-lik...
The arguments are (a, b, k) %(before_notes)s %(example)s """ def _argcheck(self, a, b, k): self._const = k / (np.exp(k * b) - np.exp(k * a)) return (a != b) and not np.isinf(k) def _pdf(self, x, a, b, k): pdf = self._const * np.exp(k * x) pdf[(x < a) | (x > b)...
random_line_split
random.py
""" Statistics for astronomy """ import numpy as np from scipy.stats.distributions import rv_continuous def bivariate_normal(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0, size=None, return_cov=False): """Sample points from a 2D normal distribution Parameters ---------- mu : array-lik...
(rv_continuous): """A truncated positive exponential continuous random variable. The probability distribution is:: p(x) ~ c * x + d between a and b = 0 otherwise The arguments are (a, b, c). d is set by the normalization %(before_notes)s %(example)s """ ...
linear_gen
identifier_name
random.py
""" Statistics for astronomy """ import numpy as np from scipy.stats.distributions import rv_continuous def bivariate_normal(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0, size=None, return_cov=False):
Returns ------- out : ndarray The drawn samples, of shape *size*, if that was provided. If not, the shape is ``(N,)``. In other words, each entry ``out[i,j,...,:]`` is an N-dimensional value drawn from the distribution. cov : ndarray The 2x2 covariance matrix. ...
"""Sample points from a 2D normal distribution Parameters ---------- mu : array-like (length 2) The mean of the distribution sigma_1 : float The unrotated x-axis width sigma_2 : float The unrotated y-axis width alpha : float The rotation counter-clockwise about t...
identifier_body
test.py
"""Run Valgrind on all demos.""" # Copyright (C) 2008 Ilmar Wilbers # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
(path, run_str, prog_type, no_reachable_check = False): output = get_status_output("cd %s && %s %s" % (path, vg_comm, run_str)) if "No such file or directory" in "".join([str(l) for l in output]): print "*** FAILED: Unable to run demo" return [(demo, "C++", output[1])] if len(re.findall('Al...
run_and_analyse
identifier_name
test.py
"""Run Valgrind on all demos.""" # Copyright (C) 2008 Ilmar Wilbers # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
failed = [] # Run C++ unittests print "----------------------------------------------------------------------" print "Running Valgrind on all C++ unittests" print "" print "Found %d C++ unittests" % len(cpptests) print "" for test_path in cpptests: print "--------------------------------------------------------...
output = get_status_output("cd %s && %s %s" % (path, vg_comm, run_str)) if "No such file or directory" in "".join([str(l) for l in output]): print "*** FAILED: Unable to run demo" return [(demo, "C++", output[1])] if len(re.findall('All heap blocks were freed',output[1])) == 1: print "O...
identifier_body
test.py
"""Run Valgrind on all demos.""" # Copyright (C) 2008 Ilmar Wilbers # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by
# (at your option) any later version. # # DOLFIN 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 Lesser General Public License for more details. # # You should have received a copy of...
# the Free Software Foundation, either version 3 of the License, or
random_line_split
test.py
"""Run Valgrind on all demos.""" # Copyright (C) 2008 Ilmar Wilbers # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
if platform.system() in ['Darwin', 'Windows']: print "No support for Valgrind on this platform." sys.exit(0) # Demos to run cppdemos = [] for dpath, dnames, fnames in os.walk(os.path.join(os.curdir, "..", "..", "demo")): if os.path.basename(dpath) == 'cpp': if os.path.isfile(os.path.join(dpath, '...
print "Skipping C++ only memory tests" sys.exit()
conditional_block
durand.py
""" Implementation of the paper, Durand and Dorsey SIGGGRAPH 2002, "Fast Bilateral Fitering for the display of high-dynamic range images" """ import numpy as np import hydra.io import hydra.filters def
(img, sigma_s=0.02, sigma_r=0.4): r, c = img.shape sigma_s = max(r, c) * sigma_s img_log = np.log10(img + 1.0e-6) img_fil = hydra.filters.bilateral(img_log, sigma_s, sigma_r) base = 10.0 ** (img_fil) - 1.0e-6 base[base <= 0.0] = 0.0 base = base.reshape((r, c)) detail = hydra.core.re...
bilateral_separation
identifier_name
durand.py
""" Implementation of the paper, Durand and Dorsey SIGGGRAPH 2002, "Fast Bilateral Fitering for the display of high-dynamic range images" """ import numpy as np import hydra.io import hydra.filters def bilateral_separation(img, sigma_s=0.02, sigma_r=0.4): r, c = img.shape sigma_s = max(r, c) * sigma_s ...
def durand(img, target_contrast=5.0): L = hydra.core.lum(img) tmp = np.zeros(img.shape) for c in range(3): tmp[:,:,c] = hydra.core.remove_specials(img[:,:,c] / L) Lbase, Ldetail = bilateral_separation(L) log_base = np.log10(Lbase) max_log_base = np.max(log_base) log_detail = np.lo...
return base, detail
random_line_split
durand.py
""" Implementation of the paper, Durand and Dorsey SIGGGRAPH 2002, "Fast Bilateral Fitering for the display of high-dynamic range images" """ import numpy as np import hydra.io import hydra.filters def bilateral_separation(img, sigma_s=0.02, sigma_r=0.4): r, c = img.shape sigma_s = max(r, c) * sigma_s ...
ret[:,:,c] = tmp[:,:,c] * output ret = np.maximum(ret, 0.0) ret = np.minimum(ret, 1.0) return ret
L = hydra.core.lum(img) tmp = np.zeros(img.shape) for c in range(3): tmp[:,:,c] = hydra.core.remove_specials(img[:,:,c] / L) Lbase, Ldetail = bilateral_separation(L) log_base = np.log10(Lbase) max_log_base = np.max(log_base) log_detail = np.log10(Ldetail) compression_factor = np.l...
identifier_body
durand.py
""" Implementation of the paper, Durand and Dorsey SIGGGRAPH 2002, "Fast Bilateral Fitering for the display of high-dynamic range images" """ import numpy as np import hydra.io import hydra.filters def bilateral_separation(img, sigma_s=0.02, sigma_r=0.4): r, c = img.shape sigma_s = max(r, c) * sigma_s ...
ret = np.maximum(ret, 0.0) ret = np.minimum(ret, 1.0) return ret
ret[:,:,c] = tmp[:,:,c] * output
conditional_block
error.rs
/* diosix error codes * * (c) Chris Williams, 2019-2021. * * See LICENSE for usage and copying. */ /* how things can go wrong */ #[derive(Debug)] pub enum Cause { /* misc */ NotImplemented, /* debug */ DebugInitFailed, /* devices */ DeviceTreeBad,
/* physical CPU cores */ PhysicalCoreBadID, PhysicalCoreCountUnknown, /* capsule services */ ServiceAlreadyRegistered, ServiceAlreadyOwner, ServiceNotAllowed, ServiceNotFound, /* messages */ MessageBadType, /* heap */ HeapNotInUse, HeapBadBlock, HeapNoFreeMem, ...
CantCloneDevices, BootDeviceTreeBad,
random_line_split
error.rs
/* diosix error codes * * (c) Chris Williams, 2019-2021. * * See LICENSE for usage and copying. */ /* how things can go wrong */ #[derive(Debug)] pub enum
{ /* misc */ NotImplemented, /* debug */ DebugInitFailed, /* devices */ DeviceTreeBad, CantCloneDevices, BootDeviceTreeBad, /* physical CPU cores */ PhysicalCoreBadID, PhysicalCoreCountUnknown, /* capsule services */ ServiceAlreadyRegistered, ServiceAlreadyOw...
Cause
identifier_name
uploader.rs
//! # Jaeger Span Uploader #[cfg(any(feature = "collector_client", feature = "wasm_collector_client"))] use crate::exporter::collector; use crate::exporter::{agent, jaeger}; use async_trait::async_trait; use opentelemetry::sdk::export::trace; use crate::exporter::JaegerTraceRuntime; #[async_trait] pub(crate) trait Up...
{ Agent(agent::AgentSyncClientUdp), } #[async_trait] impl Uploader for SyncUploader { async fn upload(&mut self, batch: jaeger::Batch) -> trace::ExportResult { match self { SyncUploader::Agent(client) => { // TODO Implement retry behaviour client ...
SyncUploader
identifier_name
uploader.rs
//! # Jaeger Span Uploader #[cfg(any(feature = "collector_client", feature = "wasm_collector_client"))] use crate::exporter::collector; use crate::exporter::{agent, jaeger}; use async_trait::async_trait; use opentelemetry::sdk::export::trace; use crate::exporter::JaegerTraceRuntime; #[async_trait] pub(crate) trait Up...
.map_err::<crate::Error, _>(Into::into)?; } } Ok(()) } }
{ match self { AsyncUploader::Agent(client) => { // TODO Implement retry behaviour client .emit_batch(batch) .await .map_err::<crate::Error, _>(Into::into)?; } #[cfg(feature = "collect...
identifier_body
uploader.rs
//! # Jaeger Span Uploader #[cfg(any(feature = "collector_client", feature = "wasm_collector_client"))] use crate::exporter::collector; use crate::exporter::{agent, jaeger}; use async_trait::async_trait; use opentelemetry::sdk::export::trace; use crate::exporter::JaegerTraceRuntime; #[async_trait] pub(crate) trait Up...
} Ok(()) } } /// Uploads a batch of spans to Jaeger #[derive(Debug)] pub(crate) enum AsyncUploader<R: JaegerTraceRuntime> { /// Agent async client Agent(agent::AgentAsyncClientUdp<R>), /// Collector sync client #[cfg(any(feature = "collector_client", feature = "wasm_collector_clien...
{ // TODO Implement retry behaviour client .emit_batch(batch) .map_err::<crate::Error, _>(Into::into)?; }
conditional_block
uploader.rs
//! # Jaeger Span Uploader #[cfg(any(feature = "collector_client", feature = "wasm_collector_client"))] use crate::exporter::collector; use crate::exporter::{agent, jaeger}; use async_trait::async_trait; use opentelemetry::sdk::export::trace; use crate::exporter::JaegerTraceRuntime; #[async_trait] pub(crate) trait Up...
} #[async_trait] impl<R: JaegerTraceRuntime> Uploader for AsyncUploader<R> { /// Emit a jaeger batch for the given uploader async fn upload(&mut self, batch: jaeger::Batch) -> trace::ExportResult { match self { AsyncUploader::Agent(client) => { // TODO Implement retry behavi...
/// Collector sync client #[cfg(any(feature = "collector_client", feature = "wasm_collector_client"))] Collector(collector::CollectorAsyncClientHttp),
random_line_split
requests.py
## Copyright 2009 Luc Saffre ## This file is part of the Lino project. ## Lino 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. ## L...
#print pth return path def get_redirect(request): if hasattr(request,"redirect_to"): return request.redirect_to def redirect_to(request,url): request.redirect_to = url #~ def is_editing(request): #~ editing = request.GET.get("editing",None) #~ if editing is None: #~...
path += "?" + s
conditional_block
requests.py
## Copyright 2009 Luc Saffre ## This file is part of the Lino project. ## Lino 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. ## L...
def redirect_to(request,url): request.redirect_to = url #~ def is_editing(request): #~ editing = request.GET.get("editing",None) #~ if editing is None: #~ path = request.session.get("editing",None) #~ else: #~ editing = int(editing) #~ if editing: #~ requ...
if hasattr(request,"redirect_to"): return request.redirect_to
identifier_body
requests.py
## Copyright 2009 Luc Saffre
## (at your option) any later version. ## Lino 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...
## This file is part of the Lino project. ## Lino 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
random_line_split
requests.py
## Copyright 2009 Luc Saffre ## This file is part of the Lino project. ## Lino 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. ## L...
(request,*args,**kw): get = request.GET.copy() for k,v in kw.items(): if v is None: # value None means "remove this key" if get.has_key(k): del get[k] else: get[k] = v path = request.path if len(args): path += "/" + "/".join(args) path ...
again
identifier_name
conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # seamless documentation build configuration file, created by # sphinx-quickstart on Mon Jul 3 17:16:13 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # a...
(master_doc, 'seamless', 'seamless documentation', author, 'seamless', 'One line description of project.', 'Miscellaneous'), ]
# (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [
random_line_split
mod.rs
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use common::SourceLocationKey; use fixture_tests::Fixture; use graphql_ir::{build, ExecutableDefinition}; use graphql_syntax::par...
ExecutableDefinition::Fragment(fragment) => { let mut import_statements = Default::default(); let fragment = print_fragment( &TEST_SCHEMA, fragment, &ProjectConfig { ...
{ let mut import_statements = Default::default(); let operation = print_operation( &TEST_SCHEMA, operation, &ProjectConfig { js_module_format: JsModuleForma...
conditional_block
mod.rs
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use common::SourceLocationKey; use fixture_tests::Fixture; use graphql_ir::{build, ExecutableDefinition}; use graphql_syntax::par...
ExecutableDefinition::Fragment(fragment) => { let mut import_statements = Default::default(); let fragment = print_fragment( &TEST_SCHEMA, fragment, &ProjectConfig { ...
}
random_line_split
mod.rs
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use common::SourceLocationKey; use fixture_tests::Fixture; use graphql_ir::{build, ExecutableDefinition}; use graphql_syntax::par...
&mut import_statements, ); format!("{}{}", import_statements, operation) } ExecutableDefinition::Fragment(fragment) => { let mut import_statements = Default::default(); ...
{ let ast = parse_executable( fixture.content, SourceLocationKey::standalone(fixture.file_name), ) .unwrap(); build(&TEST_SCHEMA, &ast.definitions) .map(|definitions| { definitions .iter() .map(|def| match def { Exec...
identifier_body
mod.rs
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use common::SourceLocationKey; use fixture_tests::Fixture; use graphql_ir::{build, ExecutableDefinition}; use graphql_syntax::par...
(fixture: &Fixture<'_>) -> Result<String, String> { let ast = parse_executable( fixture.content, SourceLocationKey::standalone(fixture.file_name), ) .unwrap(); build(&TEST_SCHEMA, &ast.definitions) .map(|definitions| { definitions .iter() ...
transform_fixture
identifier_name
rpc.py
# adapted from zmq_server_example.py in tinyrpc import time, sys import zmq from tinyrpc.protocols.jsonrpc import JSONRPCProtocol from tinyrpc.transports.zmq import ZmqServerTransport from tinyrpc.server import RPCServer from tinyrpc.dispatch import RPCDispatcher class Server(object): def __init__(self, req_callba...
return self.req_callback(req)
random_line_split
rpc.py
# adapted from zmq_server_example.py in tinyrpc import time, sys import zmq from tinyrpc.protocols.jsonrpc import JSONRPCProtocol from tinyrpc.transports.zmq import ZmqServerTransport from tinyrpc.server import RPCServer from tinyrpc.dispatch import RPCDispatcher class
(object): def __init__(self, req_callback): # print 'initializing Rpc' self.ctx = zmq.Context() self.dispatcher = RPCDispatcher() self.transport = ZmqServerTransport.create(self.ctx, 'tcp://127.0.0.1:8000') self.req_callback = req_callback self.rpc_s...
Server
identifier_name
rpc.py
# adapted from zmq_server_example.py in tinyrpc import time, sys import zmq from tinyrpc.protocols.jsonrpc import JSONRPCProtocol from tinyrpc.transports.zmq import ZmqServerTransport from tinyrpc.server import RPCServer from tinyrpc.dispatch import RPCDispatcher class Server(object): def __init__(self, req_callba...
return self.req_callback(req)
identifier_body
spike-api.js
'use strict'; var _ = require('lodash'); var request = require('request'); var VERSION = require('../package.json').version; var REST_BASE_URL = 'https://api.spike.cc/v1/'; /** * SpikeAPI */ function SpikeAPI(options) { this.options = _.assign({ secretKey: '', publishableKey: '' }, options); this.requ...
var options = _.assign(this.requestDefaults, { form: formData }); // post API this._request('post', url, options, callback); }; /** * Get a charge info by REST API. * @param {string} id Charge ID. * @param {function} callback function(err, result) */ SpikeAPI.prototype.getCharge = function(id, callbac...
random_line_split
spike-api.js
'use strict'; var _ = require('lodash'); var request = require('request'); var VERSION = require('../package.json').version; var REST_BASE_URL = 'https://api.spike.cc/v1/'; /** * SpikeAPI */ function SpikeAPI(options) { this.options = _.assign({ secretKey: '', publishableKey: '' }, options); this.requ...
}; /** * return JSON Object * @returns {object} JSON Object */ Product.prototype.toJSON = function() { return this.attrs; }; // exports module.exports = { SpikeAPI: SpikeAPI, Product: Product };
{ this.attrs[attr] = value; }
conditional_block
spike-api.js
'use strict'; var _ = require('lodash'); var request = require('request'); var VERSION = require('../package.json').version; var REST_BASE_URL = 'https://api.spike.cc/v1/'; /** * SpikeAPI */ function
(options) { this.options = _.assign({ secretKey: '', publishableKey: '' }, options); this.requestDefaults = { auth: { user: this.options.secretKey, pass: '' }, headers: { 'Accept': '*/*', 'Connection': 'close', 'User-Agent': 'node-spike-api/' + VERSION }, ...
SpikeAPI
identifier_name
spike-api.js
'use strict'; var _ = require('lodash'); var request = require('request'); var VERSION = require('../package.json').version; var REST_BASE_URL = 'https://api.spike.cc/v1/'; /** * SpikeAPI */ function SpikeAPI(options) { this.options = _.assign({ secretKey: '', publishableKey: '' }, options); this.requ...
/** * Product */ function Product(attrs) { this.attrs = _.assign({ id: '', title: '', description: '', language: 'EN', price: 0, currency: '', count: 0, stock: 0 }, attrs); } /** * getter * @param {string} attr Name of attribute. * @returns {stirng|number} Value of attribute...
{ var err = new Error('Invalid argments.'); var callback = null; _.each(args, function(arg) { if (_.isFunction(arg)) { callback = arg; } }); if (_.isFunction(callback)) { return { callback: callback, err: err }; } else { throw err; } }
identifier_body
PricingType.js
/** Pricing Type model **/ 'use strict'; var Model = require('./Model'); function PricingType(values) { Model(this); this.model.defProperties({ pricingTypeID: 0, singularName: '', pluralName: '', slugName: '', addNewLabel: null, serviceProfessional...
namePlaceHolder: null, suggestedName: null, fixedName: null, durationLabel: null, priceLabel: null, priceNote: null, firstTimeClientsOnlyLabel: null, descriptionPlaceHolder: null, priceRateQuantityLabel: null, priceRateUnitLabel: null, ...
priceCalculation: null, isAddon: false, // Form Texts
random_line_split
PricingType.js
/** Pricing Type model **/ 'use strict'; var Model = require('./Model'); function PricingType(values)
priceLabel: null, priceNote: null, firstTimeClientsOnlyLabel: null, descriptionPlaceHolder: null, priceRateQuantityLabel: null, priceRateUnitLabel: null, noPriceRateLabel: null, numberOfSessionsLabel: null, inPersonPhoneLabel: null, ...
{ Model(this); this.model.defProperties({ pricingTypeID: 0, singularName: '', pluralName: '', slugName: '', addNewLabel: null, serviceProfessionalDescription: null, // PriceCalculationType enumeration value: priceCalculation: null, ...
identifier_body
PricingType.js
/** Pricing Type model **/ 'use strict'; var Model = require('./Model'); function
(values) { Model(this); this.model.defProperties({ pricingTypeID: 0, singularName: '', pluralName: '', slugName: '', addNewLabel: null, serviceProfessionalDescription: null, // PriceCalculationType enumeration value: priceCalculation: nul...
PricingType
identifier_name
mailbox_kit.js
//#include include/takeable.js var label = "Mailbox Kit"; var version = "1327361898"; var name_single = "Mailbox Kit"; var name_plural = "Mailbox Kits"; var article = "a"; var description = ""; var is_hidden = false; var has_info = true; var adjusted_scale = 1; var stackmax = 1; var base_cost = 0; var input_for = []; ...
(pc){ var out = []; return out; } var tags = [ "no_rube", "metalproduct", "no_trade" ]; // this is a temporary fix, while the client doesn't load item defs // from the XML files. we pass this data on login events. var itemDef = { label : this.label, name_plural : this.name_plural, stackmax : this.stackmax,...
getDescExtras
identifier_name
mailbox_kit.js
//#include include/takeable.js var label = "Mailbox Kit"; var version = "1327361898"; var name_single = "Mailbox Kit"; var name_plural = "Mailbox Kits"; var article = "a"; var description = ""; var is_hidden = false; var has_info = true; var adjusted_scale = 1; var stackmax = 1; var base_cost = 0; var input_for = []; ...
itemDef.keys_in_pack = { "r" : "drop", "g" : "give" }; // generated ok 2012-01-23 15:38:18 by lizg
random_line_split
mailbox_kit.js
//#include include/takeable.js var label = "Mailbox Kit"; var version = "1327361898"; var name_single = "Mailbox Kit"; var name_plural = "Mailbox Kits"; var article = "a"; var description = ""; var is_hidden = false; var has_info = true; var adjusted_scale = 1; var stackmax = 1; var base_cost = 0; var input_for = []; ...
var tags = [ "no_rube", "metalproduct", "no_trade" ]; // this is a temporary fix, while the client doesn't load item defs // from the XML files. we pass this data on login events. var itemDef = { label : this.label, name_plural : this.name_plural, stackmax : this.stackmax, is_hidden : this.is_hidden, has_...
{ var out = []; return out; }
identifier_body
980_unique_paths_III.py
class Solution: def uniquePathsIII(self, grid: 'List[List[int]]') -> 'int': self.res = 0 R, C, E = len(grid), len(grid[0]), 1 for i in range(R):
def dfs(x, y, E): if not (0 <= x < R and 0 <= y < C and grid[x][y] >= 0): return if (x,y) == end and E == 0: self.res += 1 return grid[x][y] = -2 dfs(x+1, y, E-1) dfs(x-1, y, E-1) dfs(x, y+1, E-1) ...
for j in range(C): if grid[i][j] == 1: x,y = (i, j) elif grid[i][j] == 2: end = (i, j) elif grid[i][j] == 0: E += 1
conditional_block