language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void setRef(Constituent v) {
if (PTBConstituent_Type.featOkTst && ((PTBConstituent_Type)jcasType).casFeat_ref == null)
jcasType.jcas.throwFeatMissing("ref", "de.julielab.jules.types.PTBConstituent");
jcasType.ll_cas.ll_setRefValue(addr, ((PTBConstituent_Type)jcasType).casFeatCode_ref, jcasType.ll_c... |
java | public FileSystemDataset load (final State state) {
return new FileSystemDataset() {
@Override
public Path datasetRoot() {
return new Path(state.getProp(SERIALIZE_COMPACTION_FILE_PATH_NAME));
}
@Override
public String datasetURN() {
return state.getProp(SERIALIZE_COMPA... |
java | @Override
public final void setJMSDeliveryMode(int deliveryMode) throws JMSException
{
if (deliveryMode != DeliveryMode.PERSISTENT &&
deliveryMode != DeliveryMode.NON_PERSISTENT)
throw new FFMQException("Invalid delivery mode : "+deliveryMode,"INVALID_DELIVERY_MODE");
... |
java | public void matches(Session other) throws ClientException {
compareTransferParams(other);
compareServerMode(other);
if (needsGridFTP() && transferMode != MODE_EBLOCK) {
throw new ClientException(ClientException.BAD_MODE,
"Extended block mode necessary");
... |
python | def read_frame(self):
"""
Read an AMQP frame.
"""
frame_type, channel, size = unpack('>BHI', self._read(7))
payload = self._read(size)
ch = ord(self._read(1))
if ch == 206: # '\xce'
return frame_type, channel, payload
else:
raise E... |
java | @Pure
public static URL findLibraryURL(String libName) {
return findLibraryURL(null, libName, null, null);
} |
python | def filter(self,
pos_condition=None,
stopwords=None,
is_normalize=True,
func_normalizer=normalize_text,
check_field_name='stem'):
# type: (List[Tuple[text_type,...]], List[text_type], bool, Callable[[text_type], text_type],text_type)->Fi... |
java | public void destroy() {
try {
super.destroy();
} finally {
if (defaultJedisConnector != null && myOwnRedis) {
try {
defaultJedisConnector.destroy();
} catch (Exception e) {
LOGGER.warn(e.getMessage(), e);
... |
java | public Task<AwsSesSendResult> sendEmail(
@NonNull final String to,
@NonNull final String from,
@NonNull final String subject,
@NonNull final String body) {
return dispatcher.dispatchTask(new Callable<AwsSesSendResult>() {
@Override
public AwsSesSendResult call() {
return ... |
java | public <T extends Pointer> T getHelperWorkspace(String key){
return helperWorkspacePointers == null ? null : (T)helperWorkspacePointers.get(key);
} |
java | public ListObjectParentsResult withParentLinks(ObjectIdentifierAndLinkNameTuple... parentLinks) {
if (this.parentLinks == null) {
setParentLinks(new java.util.ArrayList<ObjectIdentifierAndLinkNameTuple>(parentLinks.length));
}
for (ObjectIdentifierAndLinkNameTuple ele : parentLinks) ... |
python | def push(self, channel_id, data):
"""Push message with POST ``data`` for ``channel_id``
"""
channel_path = self.channel_path(channel_id)
response = requests.post(channel_path, data)
return response.json() |
python | def merge_pairs(self):
"""
Use bbmerge from the bbmap suite of tools to merge paired-end reads
"""
logging.info('Merging paired reads')
for sample in self.metadata:
# Can only merge paired-end
if len(sample.general.fastqfiles) == 2:
# Set t... |
java | public static CmsXmlPage unmarshal(CmsObject cms, CmsFile file) throws CmsXmlException {
return CmsXmlPageFactory.unmarshal(cms, file, true);
} |
python | def remove_router_from_hosting_device(self, client, hosting_device_id,
router_id):
"""Remove a router from hosting_device."""
res_path = hostingdevice.HostingDevice.resource_path
return client.delete((res_path + DEVICE_L3_ROUTERS + "/%s") % (
... |
python | def get_records(self, name):
"""Return all the records for the given name in the cache.
Args:
name (string): The name which the required models are stored under.
Returns:
list: A list of :class:`cinder_data.model.CinderModel` models.
"""
if name in self.... |
java | public Observable<ServiceResponse<Page<FeatureResultInner>>> list1NextWithServiceResponseAsync(final String nextPageLink) {
return list1NextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<FeatureResultInner>>, Observable<ServiceResponse<Page<FeatureResultInner>>>>() {
... |
java | public int startNewSession() {
if (txSessEncKey != null)
return SESSION_ERROR_ALREADY_ACTIVE;
if ((txMasterSalt == null) || (rxMasterSalt == null))
return SESSION_ERROR_MASTER_SALT_UDNEFINED;
if ((txMasterKey == null) || (rxMasterKey == null))
return SESSION_ERROR_MASTER_SALT_UDNEFINED;
if (!txSessionK... |
python | def _collect_variables(names, expressions=None):
"""
Map labels and expressions to registered variables.
Handles argument matching.
Example:
_collect_variables(names=['zones', 'zone_id'],
expressions=['parcels.zone_id'])
Would return a dict representing:
... |
java | public HttpResponse sendRequest(PiwikRequest request) throws IOException{
HttpClient client = getHttpClient();
uriBuilder.replaceQuery(request.getUrlEncodedQueryString());
HttpGet get = new HttpGet(uriBuilder.build());
try {
return client.execute(get);
} finally {
... |
python | def pngout(ext_args):
"""Run the external program pngout on the file."""
args = _PNGOUT_ARGS + [ext_args.old_filename, ext_args.new_filename]
extern.run_ext(args)
return _PNG_FORMAT |
python | def map_agent(self, agent, do_rename):
"""Return the given Agent with its grounding mapped.
This function grounds a single agent. It returns the new Agent object
(which might be a different object if we load a new agent state
from json) or the same object otherwise.
Parameters
... |
java | public void setTMRecoveryService(TMRecoveryService tmrec) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setTMRecoveryService " + tmrec);
if (tmsRef != null) {
if (!_isSQLRecoveryLog) {
if (_cc != null) {
tmsRef.doStartup(this, _isSQLRecoveryLog);
... |
java | protected final void flushBuffer(boolean closeConn) throws IOException {
if (!flushed && closeConn) {
response.setHeader("connection", "close");
// if(showVersion)response.setHeader(Constants.NAME+"-Version", version);
}
initOut();
byte[] barr = _toString(true).getBytes(ReqRspUtil.getCharacterEncoding(nu... |
python | def display_path_as_ul(category, using='categories.Category'):
"""
Render the category with ancestors, but no children using the
``categories/ul_tree.html`` template.
Example::
{% display_path_as_ul "/Grandparent/Parent" %}
or ::
{% display_path_as_ul category_obj %}
Returns... |
java | public MusicElement getElementByReference(MusicElementReference ref) {
if (voiceExists(ref.getVoice())) {
for (Object o : getVoice(ref.getVoice())) {
MusicElement element = (MusicElement) o;
if (element.getReference().equals(ref))
return element;
... |
java | public BoxCollaboration.Info collaborate(String email, BoxCollaboration.Role role,
Boolean notify, Boolean canViewPath) {
JsonObject accessibleByField = new JsonObject();
accessibleByField.add("login", email);
accessibleByField.add("type", "user");
... |
python | def load_vocabulary(lang="en", type="wiki"):
"""Return a CountedVocabulary object.
Args:
lang (string): language code.
type (string): wiki,...
"""
src_dir = "{}_vocab".format(type)
p = locate_resource(src_dir, lang)
return CountedVocabulary.from_vocabfile(p) |
python | def translate(
nucleotide_sequence,
first_codon_is_start=True,
to_stop=True,
truncate=False):
"""Translates cDNA coding sequence into amino acid protein sequence.
Should typically start with a start codon but allowing non-methionine
first residues since the CDS we're transla... |
java | public static void initialiseAcceptListenerFactory(AcceptListenerFactory _acceptListenerFactory)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "initialiseAcceptListenerFactory", _acceptListenerFactory);
Class clientImpl = instance.getClass();
... |
java | private static UriComponentsBuilder getBuilder(@Nullable ServerWebExchange exchange) {
return exchange == null //
? UriComponentsBuilder.fromPath("/") //
: UriComponentsBuilder.fromHttpRequest(exchange.getRequest());
} |
java | private static ChannelBuffer createDataTerminatingChannelBuffer(byte[] data) {
int length = data.length;
if (length < 1) {
return ChannelBuffers.wrappedBuffer(CRLF_DOT_CRLF);
} else {
byte[] terminating;
byte last = data[length -1];
if (... |
python | def _set_route_parameter(self, v, load=False):
"""
Setter method for route_parameter, mapped from YANG variable /hardware/profile/route/predefined/route_parameter (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_route_parameter is considered as a private
m... |
python | def decrypt_file(self, filename, always_trust=False, passphrase=None,
output=None):
"""Decrypt the contents of a file-like object ``filename`` .
:param str filename: A file-like object to decrypt.
:param bool always_trust: Instruct GnuPG to ignore trust checks.
:par... |
java | public void execute(@Param("pipelineId") Long pipelineId, Context context, Navigator nav) throws Exception {
Channel channel = channelService.findByPipelineId(pipelineId);
if (channel.getStatus().isStart()) {
nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
return;
}
... |
java | protected List<AccessControlEntry> readACLPermisions(String cid) throws SQLException, IllegalACLException
{
List<AccessControlEntry> naPermissions = new ArrayList<AccessControlEntry>();
ResultSet exoPerm = findPropertyByName(cid, Constants.EXO_PERMISSIONS.getAsString());
try
{
if (ex... |
python | def netconf_state_statistics_dropped_sessions(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
netconf_state = ET.SubElement(config, "netconf-state", xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring")
statistics = ET.SubElement(netconf_state, "s... |
python | def _ppf(self, uloc, left, right, cache):
"""
Point percentile function.
Example:
>>> print(chaospy.Uniform().inv([0.1, 0.2, 0.9]))
[0.1 0.2 0.9]
>>> print(chaospy.Add(chaospy.Uniform(), 2).inv([0.1, 0.2, 0.9]))
[2.1 2.2 2.9]
>>> print... |
python | def add_to_results(self, data, label, results):
"""
Adds the label to the results, as needed, then appends the data
to the running results tab
"""
for datum in data:
if label is not None:
datum.update({'type': label})
results.append(datum)... |
java | public T removeAcl(List<AclEntry> entries) {
for (AclEntry entry : entries) {
if (entry.isDefault()) {
AccessControlList defaultAcl = getDefaultACL();
defaultAcl.removeEntry(entry);
} else {
mAcl.removeEntry(entry);
}
}
updateMask(entries);
return getThis();
} |
java | public void setAdditionalArtifacts(java.util.Collection<String> additionalArtifacts) {
if (additionalArtifacts == null) {
this.additionalArtifacts = null;
return;
}
this.additionalArtifacts = new java.util.ArrayList<String>(additionalArtifacts);
} |
java | @NotNull
public DoubleStream doubles() {
return DoubleStream.generate(new DoubleSupplier() {
@Override
public double getAsDouble() {
return random.nextDouble();
}
});
} |
python | def new_calendar(self, calendar_name):
""" Creates a new calendar
:param str calendar_name: name of the new calendar
:return: a new Calendar instance
:rtype: Calendar
"""
if not calendar_name:
return None
url = self.build_url(self._endpoints.get('roo... |
python | def list_namespaced_pod_template(self, namespace, **kwargs):
"""
list or watch objects of kind PodTemplate
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_namespaced_pod_template(names... |
python | def electric_field_amplitude_intensity(s0, Isat=16.6889462814,
Omega=1e6, units="ad-hoc"):
"""Return the amplitude of the electric field for saturation parameter.
This is at a given saturation parameter s0=I/Isat, where I0 is by default \
Isat=16.6889462814 m/m^2 is ... |
java | public INDArray reconstructionLogProbability(INDArray data, int numSamples) {
if (numSamples <= 0) {
throw new IllegalArgumentException(
"Invalid input: numSamples must be > 0. Got: " + numSamples + " " + layerId());
}
if (reconstructionDistribution instan... |
python | def record_message(self, msg, from_rewarder):
"""Record a message to our rewards.demo file if it is has been opened"""
if self.file:
# Include an authoritative timestamp (because the `sent_at` from the server is likely to be different
timestamped_message = {
'time... |
python | def partial_derivative_scalar(self, U, V, y=0):
"""Compute partial derivative :math:`C(u|v)` of cumulative density of single values."""
self.check_fit()
X = np.column_stack((U, V))
return self.partial_derivative(X, y) |
python | def register_hit_type(self, title, description, reward, duration,
keywords=None, approval_delay=None, qual_req=None):
"""
Register a new HIT Type
title, description are strings
reward is a Price object
duration can be a timedelta, or an object castable t... |
java | protected void displayValues(CmsLocationValue value) {
m_addressField.setTextValue(value.getAddress());
m_latitudeField.setFormValueAsString(value.getLatitudeString());
m_longitudeField.setFormValueAsString(value.getLongitudeString());
m_heightField.setFormValueAsString("" + value.getHe... |
python | def has_gis(wrapped, instance, args, kwargs):
"""Skip function execution if there are no presamples"""
if gis:
return wrapped(*args, **kwargs)
else:
warn(MISSING_GIS) |
python | def energy_upperbound(self, spins):
"""A formula for an upper bound on the energy of Theta with spins fixed.
Args:
spins (dict): Spin values for a subset of the variables in Theta.
Returns:
Formula that upper bounds the energy with spins fixed.
"""
subt... |
python | def createfastq(self):
"""Uses bcl2fastq to create .fastq files from a MiSeqRun"""
# Initialise samplecount
samplecount = 0
# If the fastq destination folder is not provided, make the default value of :path/:miseqfoldername
self.fastqdestination = self.fastqdestination if self.fa... |
java | private DocumentReferenceTranslator getDocRefTranslator(Object value) {
if (value instanceof org.apache.xmlbeans.XmlObject)
return (DocumentReferenceTranslator) VariableTranslator.getTranslator(org.apache.xmlbeans.XmlObject.class.getName());
else if (value instanceof org.w3c.dom.Document)
... |
java | public static double exponentialCdf(double x, double lamda) {
if(x<0 || lamda<=0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
double probability = 1.0 - Math.exp(-lamda*x);
return probability;
} |
python | def _to_graphviz(tree_info, show_info, feature_names, precision=None, **kwargs):
"""Convert specified tree to graphviz instance.
See:
- https://graphviz.readthedocs.io/en/stable/api.html#digraph
"""
if GRAPHVIZ_INSTALLED:
from graphviz import Digraph
else:
raise ImportError('Y... |
java | public static <V> V sqlExecute(final SqlVarArgsFunction<V> functional, final Object... args)
{
return new SqlClosure<V>() {
@Override
public V execute(Connection connection, Object... params) throws SQLException
{
return functional.execute(connection, params);
}
... |
java | public boolean handleCharacter(int ch) {
switch(this.state) {
case SETTING_NORMAL:
this.fontName += (char)ch;
break;
case SETTING_ALTERNATE:
this.falt += (char)ch;
break;
case SETTING_PANOSE:
this.panose += (char)ch;
break;
case SETTING_FONT_EMBED:
break;
case SETTING_FONT_FILE:
brea... |
python | def preview(request):
""" Render preview page.
:returns: A rendered preview
"""
if settings.MARKDOWN_PROTECT_PREVIEW:
user = getattr(request, 'user', None)
if not user or not user.is_staff:
from django.contrib.auth.views import redirect_to_login
return redirect_... |
java | @Benchmark
@BenchmarkMode(Mode.SampleTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public byte[] messageEncodePlain() {
return Status.MESSAGE_KEY.toBytes("Unexpected RST in stream");
} |
java | @XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os", name = "PolicySetCombinerParameters", scope = PolicySetType.class)
public JAXBElement<PolicySetCombinerParametersType> createPolicySetTypePolicySetCombinerParameters(PolicySetCombinerParametersType value) {
return new JAXBElement<P... |
java | void afterRead(Node<K, V> node, long now, boolean recordHit) {
if (recordHit) {
statsCounter().recordHits(1);
}
boolean delayable = skipReadBuffer() || (readBuffer.offer(node) != Buffer.FULL);
if (shouldDrainBuffers(delayable)) {
scheduleDrainBuffers();
}
refreshIfNeeded(node, now);... |
python | def _get_schema_from_list(frum, table_name, parent, nested_path, columns):
"""
:param frum: The list
:param table_name: Name of the table this list holds records for
:param parent: parent path
:param nested_path: each nested array, in reverse order
:param columns: map from full name to column de... |
java | private Plugin probeNextPlugin() {
Plugin plugin = null;
int i = 0;
while (i < listPending.size()) {
// ZAP: Removed unnecessary cast.
plugin = listPending.get(i);
if (isAllDependencyCompleted(plugin)) {
return plugin;
}
... |
java | private SubheaderPointer processSubheaderPointers(long subheaderPointerOffset, int subheaderPointerIndex)
throws IOException {
int intOrLongLength = sasFileProperties.isU64() ? BYTES_IN_LONG : BYTES_IN_INT;
int subheaderPointerLength = sasFileProperties.isU64() ? SUBHEADER_POINTER_LENGTH_X64... |
python | def find_key_by_email(self, email, secret=False):
"""Find user's key based on their email address.
:param str email: The email address to search for.
:param bool secret: If True, search through secret keyring.
"""
for key in self.list_keys(secret=secret):
for uid in ... |
java | protected Object getUnwrapped(Object name) {
try {
return DeepUnwrap.unwrap(get(name));
} catch (TemplateException e){
throw new ViewException(e);
}
} |
java | private static void mkdir(@NonNull final File directory, final boolean createParents)
throws IOException {
Condition.INSTANCE.ensureNotNull(directory, "The directory may not be null");
boolean result = createParents ? directory.mkdirs() : directory.mkdir();
if (!result && !directory... |
python | def getalgo(self, operation, name):
'''Return the algorithm for *operation* named *name*'''
if operation not in self._algorithms:
raise NotAvailable('{0} not registered.'.format(operation))
oper = self._algorithms[operation]
try:
return oper[name]
e... |
java | private static String getValueFromDB(final String _key,
final String _language)
{
String ret = null;
try {
boolean closeContext = false;
if (!Context.isThreadActive()) {
Context.begin();
closeContext = t... |
java | @Override
public void broadcast(final FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
FacesContext context = getFacesContext();
// OPEN QUESTION: should we consider a navigation to the same view as a
// no-op navigation?
// only proceed if the ... |
java | public void setSection(MaterialSection section) {
section.select();
syncSectionsState(section);
switch (section.getTarget()) {
case MaterialSection.TARGET_FRAGMENT:
// se l'utente clicca sulla stessa schermata in cui si trova si chiude il drawer e basta
... |
java | public RowSet mapToResultType(ControlBeanContext context, Method m, ResultSet resultSet, Calendar cal) {
final SQL methodSQL = (SQL) context.getMethodPropertySet(m, SQL.class);
final int maxrows = methodSQL.maxRows();
try {
CachedRowSetImpl rows = new CachedRowSetImpl();
... |
python | def set_window_iconify_callback(window, cbfun):
"""
Sets the iconify callback for the specified window.
Wrapper for:
GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
"""
window_addr = ctypes.cast(ctypes.pointer(window),
... |
java | public static void init(ProcessingEnvironment env) {
processingEnv = env;
typeUtils = processingEnv.getTypeUtils();
elementUtils = processingEnv.getElementUtils();
} |
java | public static RedisConnectionException create(Throwable cause) {
if (cause instanceof RedisConnectionException) {
return new RedisConnectionException(cause.getMessage(), cause.getCause());
}
return new RedisConnectionException("Unable to connect", cause);
} |
java | @Override
public DescribeChangeSetResult describeChangeSet(DescribeChangeSetRequest request) {
request = beforeClientExecution(request);
return executeDescribeChangeSet(request);
} |
python | def each(coro, iterable, limit=0, loop=None,
collect=False, timeout=None, return_exceptions=False, *args, **kw):
"""
Concurrently iterates values yielded from an iterable, passing them to
an asynchronous coroutine.
You can optionally collect yielded values passing collect=True param,
which... |
python | def list_csi_node(self, **kwargs):
"""
list or watch objects of kind CSINode
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_csi_node(async_req=True)
>>> result = thread.get()
... |
python | def get_activity_modification(self):
"""Extract INDRA ActiveForm statements from the BioPAX model.
This method extracts ActiveForm Statements that are due to
protein modifications. This method reuses the structure of
BioPAX Pattern's
org.biopax.paxtools.pattern.PatternBox.constr... |
python | def ipblur(text): # brutalizer ;-)
""" blurs IP address """
import re
m = re.match(r'^(\d{1,3}\.\d{1,3}\.\d{1,3}\.)\d{1,3}.*', text)
if not m:
return text
return '%sxxx' % m.group(1) |
java | private Thread fullGetFirstQueuedThread() {
/*
* The first node is normally head.next. Try to get its
* thread field, ensuring consistent reads: If thread
* field is nulled out or s.prev is no longer head, then
* some other thread(s) concurrently performed setHead in
... |
python | def import_dashboards(path, recursive):
"""Import dashboards from JSON"""
p = Path(path)
files = []
if p.is_file():
files.append(p)
elif p.exists() and not recursive:
files.extend(p.glob('*.json'))
elif p.exists() and recursive:
files.extend(p.rglob('*.json'))
for f i... |
python | async def _sync_revoc_for_proof(self, rr_id: str) -> None:
"""
Pick up tails file reader handle for input revocation registry identifier. If no symbolic
link is present, get the revocation registry definition to retrieve its tails file hash,
then find the tails file and link it.
... |
python | def start(self):
"""
Given the pipeline topology starts ``Pipers`` in the order input ->
output. See ``Piper.start``. ``Pipers`` instances are started in two
stages, which allows them to share ``NuMaps``.
"""
# top - > bottom of pipeline
pipers = self.p... |
java | public void suspend() {
if (suspension.compareAndSet(null, new CountDownLatch(1))) {
try {
suspendBarrier.await();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (BrokenBarrierException e) {
LOG.error("Exception during suspend: " + flowletCon... |
python | def default_reverse_key_func(full_key):
"""
Reverse of Django's default_key_func, i.e. undoing:
def default_key_func(key, key_prefix, version):
return '%s:%s:%s' % (key_prefix, version, key)
"""
match = reverse_key_re.match(full_key)
return match.group(3), match.group(1), int(ma... |
java | public static int littleInt(InputStream input) throws IOException {
char lo = littleChar(input);
char hi = littleChar(input);
return (hi << 16) | lo;
} |
java | @Override
public String getTypeDefinition(String typeName) throws AtlasException {
final IDataType dataType = typeSystem.getDataType(IDataType.class, typeName);
return TypesSerialization.toJson(typeSystem, dataType.getName());
} |
python | async def insert(query):
"""Perform INSERT query asynchronously. Returns last insert ID.
This function is called by object.create for single objects only.
"""
assert isinstance(query, peewee.Insert),\
("Error, trying to run insert coroutine"
"with wrong query class %s" % str(query))
... |
java | private void readFooter(RandomAccessInputStream raf, int location) throws IOException
{
raf.seek(location);
byte[] foot = new byte[FOOT_SIZE];
if (raf.read(foot) != FOOT_SIZE)
{
throw new IOException("Error encountered reading id3v2 footer");
}
majorVersion = (int) foot[3];
if (majorVersion <= NEW_... |
python | def trace(self, context, obj):
"""Enumerate the children of the given object, as would be visible and utilized by dispatch."""
root = obj
if isroutine(obj):
yield Crumb(self, root, endpoint=True, handler=obj, options=opts(obj))
return
for name, attr in getmembers(obj if isclass(obj) else obj.__cl... |
python | def parse_arg_list(param_start):
"""Exctract values like --libdir=bla/bla/bla
param_start must be '--libdir='
"""
values = [arg[len(param_start):]
for arg in sys.argv
if arg.startswith(param_start)]
# remove recognized arguments from the sys.argv
otherArgs = [arg
... |
python | def _coord_vertical_alignment(self):
"""performs vertical alignment according to current dirvh internal state.
"""
dirh,dirv = self.dirh,self.dirv
g = self.grx
for l in self.layers[::-dirv]:
if not l.prevlayer(): continue
r=None
for vk in l[::d... |
python | def halted(self):
"""Returns whether the CPU core was halted.
Args:
self (JLink): the ``JLink`` instance
Returns:
``True`` if the CPU core is halted, otherwise ``False``.
Raises:
JLinkException: on device errors.
"""
result = int(self._dll... |
java | public TaskScheduler getTaskScheduler()
{
if (m_taskScheduler == null)
m_taskScheduler = new PrivateTaskScheduler(this.getBaseApplet().getApplication(), 0, true);
return m_taskScheduler;
} |
java | @Override
public void setFontName(String fontName) {
if (this.fontName.equals(fontName)) {
return;
} else {
this.fontName = fontName;
makeFonts();
}
} |
java | @Override
public Destination getDestination(PeerDescriptor peer, DestinationReferenceDescriptor destinationReference, Session session) throws JMSException
{
try
{
Context jndiContext = JNDITools.getContext(peer.getJdniInitialContextFactoryName(),
peer.getProviderURL(),
null);
... |
java | private void addLocalRuntimeDefinition(
final AvroLocalAppSubmissionParameters localAppSubmissionParams,
final AvroJobSubmissionParameters jobSubmissionParameters,
final MultiRuntimeDefinitionBuilder builder) {
// create and serialize local configuration if defined
final Configurat... |
java | @Override
protected void doTickEffekts(ChannelMemory aktMemo)
{
if (aktMemo.effekt==0 && aktMemo.effektParam==0) return;
switch (aktMemo.effekt)
{
case 0x00 : // Arpeggio
aktMemo.arpegioIndex = (aktMemo.arpegioIndex+1)%3;
int nextNotePeriod = aktMemo.arpegioNote[aktMemo.arpegioIndex];
if (ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.