language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def _get_tracker(self, resource):
"""
Return the resource tracker that is tracking ``resource``.
:param resource: A resource.
:return: A resource tracker.
:rtype: :class:`_ResourceTracker`
"""
with self._lock:
for rt in self._reference_queue:
... |
python | def _next_trace_frames(
self,
session: Session,
trace_frame: TraceFrameQueryResult,
visited_ids: Set[int],
backwards: bool = False,
) -> List[TraceFrameQueryResult]:
"""Finds all trace frames that the given trace_frame flows to.
When backwards=True, the resul... |
java | public String updateByDiffer(MappedStatement ms) {
Class<?> entityClass = getEntityClass(ms);
StringBuilder sql = new StringBuilder();
sql.append(SqlHelper.updateTable(entityClass, tableName(entityClass)));
sql.append(updateSetColumnsByDiffer(entityClass));
sql.append(wherePKColu... |
python | def dump_stack_trace(stack_trace, bits = None):
"""
Dump a stack trace, as returned by L{Thread.get_stack_trace} with the
C{bUseLabels} parameter set to C{False}.
@type stack_trace: list( int, int, str )
@param stack_trace: Stack trace as a list of tuples of
( retur... |
python | def consume(self, callback, queue):
"""
Register a message consumer that executes the provided callback when
messages are received.
The queue must exist prior to calling this method. If a consumer
already exists for the given queue, the callback is simply updated and
an... |
java | void addGuardParameters( Map<String, Expression> parameters, boolean isDefault ) {
isGuard = true;
wasDefaultFunction = false;
guardDefault = isDefault;
if( parameters != null ) {
addMixin( null, parameters, null );
}
} |
python | def _print_results_to_stdout(
self,
classifications,
crossmatches):
"""*print the classification and crossmatch results for a single transient object to stdout*
**Key Arguments:**
- ``crossmatches`` -- the unranked crossmatch classifications
-... |
java | public final ScanRun getScanRun(ScanRunName name) {
GetScanRunRequest request =
GetScanRunRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getScanRun(request);
} |
java | public JSONObject getGroupUsers(String groupId, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("group_id", groupId);
if (options != null) {
request.addBody(options);
}
request.setUri(Fa... |
python | def is_parent_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a direct parent of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this `... |
java | private void compactGroups() {
for (int i = 0; i < groups.size(); i++) {
List<Segment> group = groups.get(i);
List<OffsetPredicate> groupPredicates = predicates.get(i);
Segment segment = compactGroup(group, groupPredicates);
mergeReleased(group, groupPredicates, segment);
deleteGroup(g... |
java | public static String ENDPOINT_UNKNOWN_PARAMS(Object arg0, Object arg1, Object arg2) {
return localizer.localize(localizableENDPOINT_UNKNOWN_PARAMS(arg0, arg1, arg2));
} |
python | def supervised_to_dict(dataset, text2self):
"""Turns a supervised dataset into a dataset with a feature dictionary.
if text2self, then the features dictionary contains a "targets" key.
else, the features dictionary contains "inputs" and "targets" keys.
Args:
dataset: a tf.data.Dataset
text2self: a boo... |
python | def find_by_opcode( checked_ops, opcode ):
"""
Given all previously-accepted operations in this block,
find the ones that are of a particular opcode.
@opcode can be one opcode, or a list of opcodes
>>> find_by_opcode([{'op': '+'}, {'op': '>'}], 'NAME_UPDATE')
[{'op': '+'}]
>>> find_by_... |
java | static MultiMap<String> resolveParameters(Method method, Object[] args) {
MultiMap<String> parameterMap = new MultiValueMap<>(Optional.ofNullable(args).map(ary -> ary.length).orElse(0));
if (args == null) {
return parameterMap;
}
Parameter[] parameters = method.getParameters();
for (int i = 0;... |
java | public static String extractName(String className) {
if (className == null) return null;
int index = className.lastIndexOf('.');
if (index != -1) return className.substring(index + 1);
return className;
} |
python | def finish_data(self, layers):
"""
Modify data before it is drawn out by the geom
Parameters
----------
layers : list
List of layers
"""
for layer in layers:
layer.data = self.facet.finish_data(layer.data, self) |
python | def create(vm_):
'''
Create a single VM from a data dict.
'''
try:
if vm_['profile'] and config.is_profile_configured(
__opts__,
__active_provider_name__ or 'azurearm',
vm_['profile'],
vm_=vm_
) is False:
return False
except... |
python | def simplify_for_Union(type_list):
"""Removes types that are subtypes of other elements in the list.
Does not return a copy, but instead modifies the given list.
Intended for preprocessing of types to be combined into a typing.Union.
Subtypecheck is backed by pytypes.is_subtype, so this differs from
... |
python | def ack_message(self, message):
"""Acknowledge the message on the broker and log the ack
:param message: The message to acknowledge
:type message: rejected.data.Message
"""
if message.channel.is_closed:
LOGGER.warning('Can not ack message, channel is closed')
... |
java | protected static void loadProvider(final URL url, final ClassLoader cl) {
try {
final Properties props = PropertiesUtil.loadClose(url.openStream(), url);
if (validVersion(props.getProperty(API_VERSION))) {
final Provider provider = new Provider(props, url, cl);
... |
java | Set<Integer> findLoadStoreBacktrackPositions(final Set<Integer> loadStorePositions) {
// go to this or next zero-position
return loadStorePositions.stream().map(this::findBacktrackPosition).collect(Collectors.toSet());
} |
python | def add_commands(cmds):
"""
Adds one or more commands to the module namespace.
Commands must end in "Command" to be added.
Example (see tests/parser.py):
sievelib.commands.add_commands(MytestCommand)
:param cmds: a single Command Object or list of Command Objects
"""
if not isinstance(c... |
java | private Thread createServerThread(ServerTask r) {
Thread t = new Thread(r);
t.setName("EmbeddedLibertyServer-" + t.getName());
return t;
} |
java | public DataStreamSink<T> addSink(SinkFunction<T> sinkFunction) {
// read the output type of the input Transform to coax out errors about MissingTypeInfo
transformation.getOutputType();
// configure the type if needed
if (sinkFunction instanceof InputTypeConfigurable) {
((InputTypeConfigurable) sinkFunction... |
java | private void initFilter() {
EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);
Metamodel metaModel = kunderaMetadata.getApplicationMetadata().getMetamodel(getPersistenceUnit());
EntityType entityType = metaModel.entity(entityClass);
if (nul... |
java | static ZonedDateTime getDateFromStringToZoneId(String date, ZoneId zoneId, DateTimeFormatter formatter) throws DateTimeParseException {
try {
//noticed that date not parsed with non-US locale. For me this fix is helpful
LocalDate localDate = LocalDate.parse(date, formatter);
... |
java | public static Map<String, String> AppConsumeByMap(Map<String, String> reqData) {
return SDKUtil.convertResultStringToMap(AppConsume(reqData));
} |
java | public String getScript(ClientBehaviorContext behaviorContext)
{
if (behaviorContext == null)
{
throw new NullPointerException("behaviorContext");
}
ClientBehaviorRenderer renderer = getRenderer(behaviorContext.getFacesContext());
if (renderer != null)
... |
java | public ServiceRegistration<FileMonitor> monitorFiles(Collection<String> paths, long monitorInterval) {
BundleContext bundleContext = actionable.getBundleContext();
final Hashtable<String, Object> fileMonitorProps = new Hashtable<String, Object>();
fileMonitorProps.put(FileMonitor.MONITOR_FILES, ... |
python | def children(self, val: list):
""" Sets children
:param val: List of citation children
"""
final_value = []
if val is not None:
for citation in val:
if citation is None:
continue
elif not isinstance(citation, (BaseC... |
python | def get(self, session):
'''taobao.aftersale.get 查询用户售后服务模板
查询用户设置的售后服务模板,仅返回标题和id'''
request = TOPRequest('taobao.aftersale.get')
self.create(self.execute(request, session))
return self.after_sales |
python | def get_psf_sky(self, ra, dec):
"""
Determine the local psf at a given sky location.
The psf is returned in degrees.
Parameters
----------
ra, dec : float
The sky position (degrees).
Returns
-------
a, b, pa : float
The p... |
python | def parse_fn(fn):
""" This parses the file name and returns the coordinates of the tile
Parameters
-----------
fn : str
Filename of a GEOTIFF
Returns
--------
coords = [LLC.lat, LLC.lon, URC.lat, URC.lon]
"""
try:
parts = os.path.splitext(os.path.split(fn)[-1])[0].r... |
java | public void removeMailbox(long hsId) {
synchronized (m_mapLock) {
ImmutableMap.Builder<Long, Mailbox> b = ImmutableMap.builder();
for (Map.Entry<Long, Mailbox> e : m_siteMailboxes.entrySet()) {
if (e.getKey().equals(hsId)) {
continue;
}... |
java | private JarFile getJarFile()
throws IOException
{
JarFile jarFile = null;
isCacheValid();
if (! _backingIsFile) {
throw new FileNotFoundException(getBacking().getNativePath());
}
try {
jarFile = new JarFile(getBacking().getNativePath());
/*
if (_backing.getN... |
java | private Expr parseLambdaInitialiser(EnclosingScope scope, boolean terminated) {
int start = index;
match(Ampersand);
// First parse the captured lifetimes with the original scope
Tuple<Identifier> captures = parseOptionalCapturedLifetimes(scope);
// Now we create a new scope for this lambda expression.
// I... |
java | public IfcLampTypeEnum createIfcLampTypeEnumFromString(EDataType eDataType, String initialValue) {
IfcLampTypeEnum result = IfcLampTypeEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() +... |
python | def indent_lines(lines, output, branch_method, leaf_method, pass_syntax, flush_left_syntax, flush_left_empty_line,
indentation_method, get_block):
"""Returns None.
The way this function produces output is by adding strings to the
list that's passed in as the second parameter.
Paramete... |
python | def GetCountStopTimes(self):
"""Return the number of stops made by this trip."""
cursor = self._schedule._connection.cursor()
cursor.execute(
'SELECT count(*) FROM stop_times WHERE trip_id=?', (self.trip_id,))
return cursor.fetchone()[0] |
java | public Comparator<Integer> getCompByName() {
return new Comparator<Integer>() {
@Override
public int compare(Integer t1, Integer t2) {
Integer p1 = tokenCollection.get(t1).getPositionStart();
Integer p2 = tokenCollection.get(t2).getPositionStart();
assert p1 != null : "no positio... |
python | def htmlSetMetaEncoding(self, encoding):
"""Sets the current encoding in the Meta tags NOTE: this will
not change the document content encoding, just the META
flag associated. """
ret = libxml2mod.htmlSetMetaEncoding(self._o, encoding)
return ret |
java | @SuppressWarnings("unchecked")
@Override
public EList<PluginConfiguration> getConfigurations() {
return (EList<PluginConfiguration>) eGet(StorePackage.Literals.PLUGIN_DESCRIPTOR__CONFIGURATIONS, true);
} |
java | public static Duration convertUnits(double duration, TimeUnit fromUnits, TimeUnit toUnits, double minutesPerDay, double minutesPerWeek, double daysPerMonth)
{
switch (fromUnits)
{
case YEARS:
{
duration *= (minutesPerWeek * 52);
break;
}
case E... |
java | public CreateMLModelRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} |
python | def load_fasttext_format(cls, path, ctx=cpu(), **kwargs):
"""Create an instance of the class and load weights.
Load the weights from the fastText binary format created by
https://github.com/facebookresearch/fastText
Parameters
----------
path : str
Path to t... |
java | public PdfPatternPainter createPattern(float width, float height, float xstep, float ystep, Color color) {
checkWriter();
if ( xstep == 0.0f || ystep == 0.0f )
throw new RuntimeException("XStep or YStep can not be ZERO.");
PdfPatternPainter painter = new PdfPatternPainter(writer, col... |
python | def _get_namespace_filter(
taxon_filter: Optional[int]=None,
category_filter: Optional[str]=None) -> Union[None, str]:
"""
Given either a taxon and/or category, return the correct namespace
:raises ValueError: If category is provided without a taxon
"""
na... |
python | def cds_length_of_associated_transcript(effect):
"""
Length of coding sequence of transcript associated with effect,
if there is one (otherwise return 0).
"""
return apply_to_transcript_if_exists(
effect=effect,
fn=lambda t: len(t.coding_sequence) if (t.complete and t.coding_sequence... |
java | public Graph<T> reduce(Graph<T> g) {
boolean subgraph = nodes.containsAll(g.nodes) &&
g.edges.keySet().stream()
.allMatch(u -> adjacentNodes(u).containsAll(g.adjacentNodes(u)));
if (!subgraph) {
throw new IllegalArgumentException(g + " is not a subgraph... |
java | public static Map.Entry<String, Map<String, ?>> networkSpeedCommand(
NetworkSpeed networkSpeed) {
return new AbstractMap.SimpleEntry<>(NETWORK_SPEED,
prepareArguments("netspeed", networkSpeed.name().toLowerCase()));
} |
java | private Diagram loadDiagram(InputStream in, boolean offset)
throws SlickException {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
buil... |
python | def _read_data(fname):
"""Reads data from file.
Reads the data in 'fname' into a list where each list entry contains
[energy predicted, energy calculated, list of concentrations].
Parameters
----------
fname : str
The name and path to the data file.
Returns
-------
en... |
python | def stream_user(self, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Streams events that are relevant to the authorized user, i.e. home
timeline and notifications.
"""
return s... |
python | def redact_image(
self,
parent,
inspect_config=None,
image_redaction_configs=None,
include_findings=None,
byte_item=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
... |
python | def p_assignment_delay(self, p):
'assignment : ASSIGN delays lvalue EQUALS delays rvalue SEMICOLON'
p[0] = Assign(p[3], p[6], p[2], p[5], lineno=p.lineno(1))
p.set_lineno(0, p.lineno(1)) |
python | def get_created_date_metadata(self):
"""Gets the metadata for the asset creation date.
return: (osid.Metadata) - metadata for the created date
*compliance: mandatory -- This method must be implemented.*
"""
# Implemented from template for osid.resource.ResourceForm.get_group_me... |
python | def _add_or_remove_flag(self, flag, add):
"""
Add the given `flag` if `add` is True, remove it otherwise.
"""
meth = self.add_flag if add else self.remove_flag
meth(flag) |
java | private MutationStatus incrCoords(KeySpec ks) {
final StorageVBucketCoordinates curCoord;
synchronized (vbCoords) {
curCoord = vbCoords[ks.vbId];
}
long seq = curCoord.incrSeqno();
long uuid = curCoord.getUuid();
VBucketCoordinates coord = new BasicVBucketCoo... |
java | protected PathResource getFileResource(final Path file, final String path, final Path symlinkBase, String normalizedFile) throws IOException {
if (this.caseSensitive) {
if (symlinkBase != null) {
String relative = symlinkBase.relativize(file.normalize()).toString();
S... |
java | public static Set<String> listDeployments(Resource deploymentRootResource, Set<String> runtimeNames) {
Set<Pattern> set = new HashSet<>();
for (String wildcardExpr : runtimeNames) {
Pattern pattern = DeploymentOverlayIndex.getPattern(wildcardExpr);
set.add(pattern);
... |
python | def clientUpdated(self, *args, **kwargs):
"""
Client Updated Messages
Message that a new client has been updated.
This exchange outputs: ``v1/client-message.json#``This exchange takes the following keys:
* reserved: Space reserved for future routing-key entries, you should al... |
java | public static String getModifierSuffix(String fullName, String baseName) {
if (fullName.equals(baseName)) {
return null;
}
int indexOfOpeningBracket = fullName.indexOf(MODIFIER_OPENING_TOKEN);
return fullName.substring(indexOfOpeningBracket, fullName.length());
} |
java | public static String generateCssStyle(CmsObject cms) {
StringBuffer result = new StringBuffer(128);
result.append("<style type='text/css'>\n");
String contents = "";
try {
contents = new String(
cms.readFile(CmsWorkplace.VFS_PATH_COMMONS + "style/report.css")... |
python | def get_snapshot(self, snapshot_id_or_uri, volume_id_or_uri=None):
"""
Gets a snapshot of a volume.
Args:
volume_id_or_uri:
Can be either the volume ID or the volume URI. It is optional if it is passed a snapshot URI,
but required if it passed a snaps... |
java | public ServiceFuture<RoleDefinitionInner> createOrUpdateAsync(String scope, String roleDefinitionId, RoleDefinitionProperties properties, final ServiceCallback<RoleDefinitionInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(scope, roleDefinitionId, properties), s... |
python | def sort(self):
"""Sort variants from most correct to consume, to least.
Sort rules:
version_priority:
- sort by highest versions of packages shared with request;
- THEN least number of additional packages added to solve;
- THEN highest versions of additional packages;
... |
java | private void handleFlowResults(Queue<Env<AttrContext>> queue, ListBuffer<Element> elems) {
for (Env<AttrContext> env: queue) {
switch (env.tree.getTag()) {
case CLASSDEF:
JCClassDecl cdef = (JCClassDecl) env.tree;
if (cdef.s... |
java | public DomainObjectMatch<DomainObject> TO_GENERIC(String domainObjectTypeName) {
Boolean br_old = null;
try {
TraversalExpression te = (TraversalExpression)this.astObject;
InternalDomainAccess iAccess = te.getQueryExecutor().getMappingInfo().getInternalDomainAccess();
iAccess.loadDomainInfoIfNeeded();
C... |
java | public String getValue(char name, String defaultValue) {
return getValue(String.valueOf(name), defaultValue);
} |
java | public static String getPrimitiveDefault(Class type) {
if (type == Boolean.class) {
return "false";
}
if (type == Character.class) {
return Character.toString((char) 0);
}
return "0";
} |
python | def query_accession():
"""
Returns list of accession numbers by query query parameters
---
tags:
- Query functions
parameters:
- name: accession
in: query
type: string
required: false
description: UniProt accession number
default: P05067
... |
java | public static String rawTypeToString(TypeMirror type, char innerClassSeparator) {
if (!(type instanceof DeclaredType)) {
throw new IllegalArgumentException("Unexpected type: " + type);
}
StringBuilder result = new StringBuilder();
DeclaredType declaredType = (DeclaredType) type;
rawTypeToStrin... |
java | void parseDocument(
final Reader reader, final int suggestedBufferSize,
final IMarkupHandler handler, final ParseStatus status)
throws ParseException {
final long parsingStartTimeNanos = System.nanoTime();
char[] buffer = null;
try {
handler.h... |
java | public int getStatus() throws SystemException
{
Transaction tx = registry.getTransaction();
if (tx == null)
return Status.STATUS_NO_TRANSACTION;
return tx.getStatus();
} |
python | def point_on_line(ab, c):
'''
point_on_line((a,b), c) yields True if point x is on line (a,b) and False otherwise.
'''
(a,b) = ab
abc = [np.asarray(u) for u in (a,b,c)]
if any(len(u.shape) == 2 for u in abc): (a,b,c) = [np.reshape(u,(len(u),-1)) for u in abc]
else: ... |
java | public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) {
return getCertificateVersionsNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<Certif... |
python | def add_filter_by_regex(self, regex_expression, filter_type=DefaultFilterType):
"""
Add a files filter by regex to this iterator.
:param regex_expression: regex string to apply.
"""
self.add_filter(FilterRegex(regex_expression), filter_type)
return self |
java | @Override
public Class<?> getProxyClass() {
if (proxyClass != null) {
return proxyClass;
}
try {
if (StringUtils.isNotBlank(interfaceId)) {
this.proxyClass = ClassUtils.forName(interfaceId);
if (!proxyClass.isInterface()) {
... |
python | def start_processes(self, max_restarts=-1):
"""
Start processes and check their status. When some process crashes,
start it again. *max_restarts* is maximum amount of the restarts
across all processes. *processes* is a :class:`list` of the
:class:`ProcessWrapper` instances.
... |
java | @Override
public CommercePriceListUserSegmentEntryRel findByUUID_G(String uuid,
long groupId) throws NoSuchPriceListUserSegmentEntryRelException {
CommercePriceListUserSegmentEntryRel commercePriceListUserSegmentEntryRel =
fetchByUUID_G(uuid, groupId);
if (commercePriceListUserSegmentEntryRel == null) {
S... |
python | def setTextEdit( self, textEdit ):
"""
Sets the text edit that this find widget will use to search.
:param textEdit | <QTextEdit>
"""
if ( self._textEdit ):
self._textEdit.removeAction(self._findAction)
self._textEdit = text... |
java | @Override
public void buttonClick(final ClickEvent event) {
if (window.getParent() != null) {
isImplicitClose = true;
UI.getCurrent().removeWindow(window);
}
callback.response(event.getSource().equals(okButton));
} |
java | public static void enrich(Throwable t, String updateMessage) {
String newMessage = createMessage(t.getMessage(), updateMessage, t.getClass().getSimpleName());
replace(t, newMessage);
} |
python | def _load_nonlink_level(handler, level, pathtable, pathname):
"""
Loads level and builds appropriate type, without handling softlinks
"""
if isinstance(level, tables.Group):
if _sns and (level._v_title.startswith('SimpleNamespace:') or
DEEPDISH_IO_ROOT_IS_SNS in level._v_att... |
python | def preprocess_user_variables(userinput):
"""
<Purpose>
Command parser for user variables. Takes the raw userinput and replaces
each user variable with its set value.
<Arguments>
userinput: A raw user string
<Side Effects>
Each user variable will be replaced by the value that it was previously
... |
python | def range(self, axis=None):
""" Return range tuple along specified axis """
return (self.min(axis=axis), self.max(axis=axis)) |
python | def policy_assignment_get(name, scope, **kwargs):
'''
.. versionadded:: 2019.2.0
Get details about a specific policy assignment.
:param name: The name of the policy assignment to query.
:param scope: The scope of the policy assignment.
CLI Example:
.. code-block:: bash
salt-cal... |
python | def get_cmd_line(self):
"""
Return the full command line that will be used when this node
is run by DAGman.
"""
cmd = ""
cmd_list = self.get_cmd_tuple_list()
for argument in cmd_list:
cmd += ' '.join(argument) + " "
return cmd |
python | def size(self):
""" Total unfiltered size of view.
"""
#return len(self._fetch_items())
if self._check_hash_view():
return 1
else:
return self.engine.open().view.size(xmlrpc.NOHASH, self.viewname) |
python | def selection_pos(self):
"""Return start and end positions of the visual selection respectively."""
buff = self._vim.current.buffer
beg = buff.mark('<')
end = buff.mark('>')
return beg, end |
java | public final void synpred16_InternalPureXbase_fragment() throws RecognitionException {
// InternalPureXbase.g:1679:6: ( ( '>' '>' ) )
// InternalPureXbase.g:1679:7: ( '>' '>' )
{
// InternalPureXbase.g:1679:7: ( '>' '>' )
// InternalPureXbase.g:1680:7: '>' '>'
{
... |
java | static URI encodeTemporaryCheckpointFileLocation(UfsJournal journal) {
return URIUtils.appendPathOrDie(journal.getTmpDir(), UUID.randomUUID().toString());
} |
java | @Override
public void handle(CommandContext ctx) throws CommandLineException {
recognizeArguments(ctx);
if(helpArg.isPresent(ctx.getParsedCommandLine())) {
printHelp(ctx);
return;
}
if(!isAvailable(ctx)) {
throw new CommandFormatException("The c... |
python | def doBandTrapz(Aein, lambnew, fc, kin, lamb, ver, z, br):
"""
ver dimensions: wavelength, altitude, time
A and lambda dimensions:
axis 0 is upper state vib. level (nu')
axis 1 is bottom state vib level (nu'')
there is a Franck-Condon parameter (variable fc) for each upper state nu'
"""
... |
python | def get_topics(yaml_info):
''' Returns the names of all of the topics in the bag, and prints them
to stdout if requested
'''
# Pull out the topic info
names = []
# Store all of the topics in a dictionary
topics = yaml_info['topics']
for topic in topics:
names.append(topic['to... |
java | public void setBucketAcl(SetBucketAclRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.PUT);
internalRequest.addParameter("acl", null);
if (request.getCannedAcl() != null) {
... |
python | def addDiscreteOutcomeConstantMean(distribution, x, p, sort = False):
'''
Adds a discrete outcome of x with probability p to an existing distribution,
holding constant the relative probabilities of other outcomes and overall mean.
Parameters
----------
distribution : [np.array]
Two elem... |
java | public static PrefsTransform lookup(PrefsProperty property) {
TypeMirror typeMirror = property.getElement().asType();
TypeName typeName = typeName(typeMirror);
return lookup(typeName);
} |
python | def load_nii(strPathIn, varSzeThr=5000.0):
"""
Load nii file.
Parameters
----------
strPathIn : str
Path to nii file to load.
varSzeThr : float
If the nii file is larger than this threshold (in MB), the file is
loaded volume-by-volume in order to prevent memory overflow.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.