language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public ListProvisionedCapacityResult listProvisionedCapacity(ListProvisionedCapacityRequest request) {
request = beforeClientExecution(request);
return executeListProvisionedCapacity(request);
} |
java | public java.util.List<VirtualMFADevice> getVirtualMFADevices() {
if (virtualMFADevices == null) {
virtualMFADevices = new com.amazonaws.internal.SdkInternalList<VirtualMFADevice>();
}
return virtualMFADevices;
} |
python | def rest_post(url, data, timeout, show_error=False):
'''Call rest post method'''
try:
response = requests.post(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\
data=data, timeout=timeout)
return response
except Exception as ex... |
java | public static void main(final String[] args) {
ByteArray8Holder b1 = new ByteArray8Holder(new byte[] {
0, 0, 0, 0, 0, 0, 0, 1
});
ByteArray8Holder b2 = new ByteArray8Holder(new byte[] {
0, 0, 0, 0, 0, 0, 0, 2
});
ByteArray8Holder b2b = new ByteArray8Holder(new byte[] {
0, 0, 0, 0, 0, 0, 0, 2
});... |
python | def _save_files(self, data, dtype_out_time):
"""Save the data to netcdf files in direc_out."""
path = self.path_out[dtype_out_time]
if not os.path.isdir(self.dir_out):
os.makedirs(self.dir_out)
if 'reg' in dtype_out_time:
try:
reg_data = xr.open_da... |
java | private static <V> Collection<V> sorted(Iterable<V> source, Comparator<V> comparator, int size)
{
V[] vs = (V[]) new Object[size];
int i = 0;
for (V v : source)
vs[i++] = v;
Arrays.sort(vs, comparator);
return Arrays.asList(vs);
} |
python | def name_scope(name=None):
"""
This decorator wraps a function so that it runs inside a TensorFlow
name scope. The name is given by the `name` option; if this is None,
then the name of the function will be used.
```
>>> @name_scope()
>>> def foo(...):
>>> # now runs inside scope "foo... |
java | public <T> InjectorBuilder forEachElement(ElementVisitor<T> visitor) {
Elements
.getElements(module)
.forEach(element -> element.acceptVisitor(visitor));
return this;
} |
java | public void setPersistentAttributes(Map<String, Object> persistentAttributes) {
if (persistenceAdapter == null) {
throw new IllegalStateException("Attempting to set persistence attributes without configured persistence adapter");
}
this.persistentAttributes = persistentAttributes;
... |
python | def p_encaps_var_dollar_curly_array_offset(p):
'encaps_var : DOLLAR_OPEN_CURLY_BRACES STRING_VARNAME LBRACKET expr RBRACKET RBRACE'
p[0] = ast.ArrayOffset(ast.Variable('$' + p[2], lineno=p.lineno(2)), p[4],
lineno=p.lineno(3)) |
python | def make_error(self,
message: str,
*,
error: Exception = None,
# ``error_class: Type[Exception]=None`` doesn't work on
# Python 3.5.2, but that is exact version ran by Read the
# Docs :( More info: http://s... |
java | public IssueCategory createCategory(IssueCategory category) throws RedmineException {
if (category.getProject() == null
|| category.getProject().getId() == null) {
throw new IllegalArgumentException(
"IssueCategory must contain an existing project");
}
return transport.addChildEntry(Project.cla... |
python | def form(self, request, tag):
"""
Render the inputs for a form.
@param tag: A tag with:
- I{form} and I{description} slots
- I{liveform} and I{subform} patterns, to fill the I{form} slot
- An I{inputs} slot, to fill with parameter views
- L{IP... |
java | public DialSeries addSeries(String seriesName, double value, String annotation) {
// Sanity checks
sanityCheck(seriesName, value);
DialSeries series = new DialSeries(seriesName, value, annotation);
seriesMap.put(seriesName, series);
return series;
} |
python | def configure_ckan(m):
"""Load groups and organizations, from a file in Metatab format"""
from ckanapi import RemoteCKAN
try:
doc = MetapackDoc(m.mt_file, cache=m.cache)
except (IOError, MetatabError) as e:
err("Failed to open metatab '{}': {}".format(m.mt_file, e))
c = RemoteCKAN(... |
python | def API_GET(self, courseid, taskid=None): # pylint: disable=arguments-differ
"""
List tasks available to the connected client. Returns a dict in the form
::
{
"taskid1":
{
"name": "Name of the course", ... |
python | def str_if_not_none(value):
"""
Returns an str(value) if the value is not None.
:param value: None or a value that can be converted to a str.
:return: None or str(value)
"""
if not(value is None or isinstance(value, string_types)):
value = str(value)
return value |
java | @Override
public DescriptorValue calculate(IAtomContainer atomContainer) {
IAtomContainer ac;
try {
ac = (IAtomContainer) atomContainer.clone();
} catch (CloneNotSupportedException e) {
return getDummyDescriptorValue(e);
}
List<String> profiles = new A... |
python | def iddtxt2groups(txt):
"""extract the groups from the idd file"""
try:
txt = txt.decode('ISO-8859-2')
except AttributeError as e:
pass # for python 3
txt = nocomment(txt, '!')
txt = txt.replace("\\group", "!-group") # retains group in next line
txt = nocomment(txt, '\\') # remov... |
python | def _split_cell(cell, module):
""" Split a hybrid %%sql cell into the Python code and the queries.
Populates a module with the queries.
Args:
cell: the contents of the %%sql cell.
module: the module that the contents will populate.
Returns:
The default (last) query for the module.
"""
line... |
python | def execute(self, eopatch):
"""
:param eopatch: Input EOPatch.
:type eopatch: EOPatch
:return: Transformed eo patch
:rtype: EOPatch
"""
feature_type, feature_name = next(self.feature(eopatch))
good_idxs = self._get_filtered_indices(eopatch[feature_type][f... |
python | def from_prev_calc(cls, prev_calc_dir, standardize=False, sym_prec=0.1,
international_monoclinic=True, reciprocal_density=100,
small_gap_multiply=None, **kwargs):
"""
Generate a set of Vasp input files for static calculations from a
directory of prev... |
python | def __spawn_new_request(self):
"""Spawn the first queued request if there is one available.
Returns:
bool: True if a new request was spawned, false otherwise.
"""
first_in_line = self.queue.get_first(QueueItem.STATUS_QUEUED)
if first_in_line is None:
... |
python | def load_family_details(self, pheno_covar):
"""Load family data updating the pheno_covar with family ids found.
:param pheno_covar: Phenotype/covariate object
:return: None
"""
file = open(self.fam_details)
header = file.readline()
format = file.readline()
... |
python | def get_gamma_value(self):
'''
getter
Gamma value.
'''
if isinstance(self.__gamma_value, float) is False:
raise TypeError("The type of __gamma_value must be float.")
return self.__gamma_value |
python | def load_drp(self, name, entry_point='numina.pipeline.1'):
"""Load all available DRPs in 'entry_point'."""
for drpins in self.iload(entry_point):
if drpins.name == name:
return drpins
else:
raise KeyError('{}'.format(name)) |
python | def uniform(start, end=None, periods=None, freq=None, sc=None):
"""
Instantiates a uniform DateTimeIndex.
Either end or periods must be specified.
Parameters
----------
start : string, long (nanos from epoch), or Pandas Timestamp
end : string, long (nanos from epoch), or Pandas... |
java | public static Collection<MonetaryRounding> getRoundings(RoundingQuery roundingQuery) {
return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow(
() -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available."))
.getRoundings(roun... |
java | @VisibleForTesting
public static void transcodeJpegWithExifOrientation(
final InputStream inputStream,
final OutputStream outputStream,
final int exifOrientation,
final int scaleNumerator,
final int quality)
throws IOException {
NativeJpegTranscoderSoLoader.ensure();
Precon... |
java | public void setBuffer(WsByteBuffer buf) {
if (buf != null) {
this.buffers = this.defaultBuffers;
this.buffers[0] = buf;
} else {
this.buffers = null;
}
} |
python | def ensure_schema(client, table_name):
"""
Create the table/columnfamily if it doesn't already exist.
:param client: A Cassandra CQL client
:type client: silverberg.client.CQLClient
:param lock_table: A table/columnfamily table name for holding locks.
:type lock_table: ... |
java | private void executeUpdatesSynchronous(DBTransaction transaction) {
BatchStatement batchState = new BatchStatement(Type.UNLOGGED);
batchState.addAll(getMutations(transaction));
executeBatch(batchState);
} |
java | public int getDelay()
{
if (scheduledGraceful != null)
return (int)scheduledGraceful.getDelay(TimeUnit.SECONDS);
if (shutdown.get())
return Integer.MIN_VALUE;
return Integer.MAX_VALUE;
} |
java | @Override
protected void beforeWaitForSynchronization(final T message) throws CouldNotPerformException {
transactionIdField = ProtoBufFieldProcessor.getFieldDescriptor(message, TransactionIdProvider.TRANSACTION_ID_FIELD_NAME);
if (transactionIdField == null) {
throw new NotAvailableExcep... |
python | def get_viewer(self, v_id, viewer_class=None, width=512, height=512,
force_new=False):
"""
Get an existing viewer by viewer id. If the viewer does not yet
exist, make a new one.
"""
if not force_new:
try:
return self.viewers[v_id]
... |
python | def send_messages(self, messages):
"""Send one or more EmailMessage objects.
Returns:
int: Number of email messages sent.
"""
if not messages:
return
new_conn_created = self.open()
if not self.connection:
# We failed silentl... |
python | def get_parser():
"""Initialize the parser for the command line interface and bind the
autocompletion functionality"""
# initialize the parser
parser = argparse.ArgumentParser(
description=(
'Command line tool for extracting text from any document. '
) % locals(),
)
... |
python | def norm_int_dict(int_dict):
"""Normalizes values in the given dict with int values.
Parameters
----------
int_dict : list
A dict object mapping each key to an int value.
Returns
-------
dict
A dict where each key is mapped to its relative part in the sum of
all dic... |
java | public void insert( int index , int value ) {
if( size == data.length ) {
int temp[] = new int[ size * 2];
System.arraycopy(data,0,temp,0,index);
temp[index] = value;
System.arraycopy(data,index,temp,index+1,size-index);
this.data = temp;
size++;
} else {
size++;
for( int i = size-1; i > ind... |
python | def gradient(self):
"""Compute the gradient of the energy for all atoms"""
result = np.zeros((self.numc, 3), float)
for index1 in range(self.numc):
result[index1] = self.gradient_component(index1)
return result |
java | public PutRemediationConfigurationsResult withFailedBatches(FailedRemediationBatch... failedBatches) {
if (this.failedBatches == null) {
setFailedBatches(new com.amazonaws.internal.SdkInternalList<FailedRemediationBatch>(failedBatches.length));
}
for (FailedRemediationBatch ele : fai... |
python | def workflow_overwrite(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /workflow-xxxx/overwrite API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fworkflow-xxxx%2Foverwrite
"""
return DXHTTPRequest('/%... |
python | def on_packet_received(self, pkt):
"""DEV: entry point. Will be called by sniff() for each
received packet (that passes the filters).
"""
if not pkt:
return
if self.store:
self.lst.append(pkt)
if self.prn:
result = self.prn(pkt)
... |
java | public void resumeConsumer(int suspendFlag)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resumeConsumer", this);
ArrayList<AORequestedTick> satisfiedTicks = null;
synchronized(parent) // AOStream
{
try
{
// Take the lock
th... |
python | def shuffle(args):
"""
%prog shuffle p1.fastq p2.fastq
Shuffle pairs into interleaved format.
"""
p = OptionParser(shuffle.__doc__)
p.set_tag()
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
p1, p2 = args
pairsfastq = pairspf((p1, p2)) ... |
java | public static Specification<JpaTarget> hasAssignedDistributionSet(final Long distributionSetId) {
return (targetRoot, query, cb) -> cb.equal(
targetRoot.<JpaDistributionSet> get(JpaTarget_.assignedDistributionSet).get(JpaDistributionSet_.id),
distributionSetId);
} |
java | public boolean setHiddenInputValue(String idOrName, String value) {
T element = findElement(By.id(idOrName));
if (element == null) {
element = findElement(By.name(idOrName));
if (element != null) {
executeJavascript("document.getElementsByName('%s')[0].value='%s'"... |
java | public static void main(final String[] args) {
Switch about = new Switch("a", "about", "display about message");
Switch help = new Switch("h", "help", "display help message");
FileArgument expectedFile = new FileArgument("e", "expected-file", "expected interpretation file, default stdin; at lea... |
python | def find_by_type_or_id(type_or_id, prs):
"""
:param type_or_id: Type of the data to process or ID of the processor class
:param prs: A list of :class:`anyconfig.models.processor.Processor` classes
:return:
A list of processor classes to process files of given data type or
processor 'type... |
java | static <EqClassT, LeftProvT, RightProvT> EquivalenceBasedProvenancedAlignment<EqClassT, LeftProvT, RightProvT> fromEquivalenceClassMaps(
final Multimap<? extends EqClassT, ? extends LeftProvT> leftEquivalenceClassesToProvenances,
final Multimap<? extends EqClassT, ? extends RightProvT> rightEquivalenceClass... |
java | public Path getPathInHar(Path path) {
Path harPath = new Path(path.toUri().getPath());
if (archivePath.compareTo(harPath) == 0)
return new Path(Path.SEPARATOR);
Path tmp = new Path(harPath.getName());
Path parent = harPath.getParent();
while (!(parent.compareTo(archivePath) == 0)) {
if (... |
java | public void setSessionProperty(String name, String value)
{
requireNonNull(name, "name is null");
requireNonNull(value, "value is null");
checkArgument(!name.isEmpty(), "name is empty");
CharsetEncoder charsetEncoder = US_ASCII.newEncoder();
checkArgument(name.indexOf('=') <... |
java | public AdvancedNetworkConfig setClientEndpointConfig(ServerSocketEndpointConfig serverSocketEndpointConfig) {
serverSocketEndpointConfig.setProtocolType(ProtocolType.CLIENT);
endpointConfigs.put(CLIENT, serverSocketEndpointConfig);
return this;
} |
java | public static Class<?> classForNameWithException(final String name, final ClassLoader cl)
throws ClassNotFoundException {
if (cl != null) {
try {
return Class.forName(name, false, cl);
} catch (final ClassNotFoundException | NoClassDefFoundError e) {
... |
python | async def disconnect(self, abort=False):
"""Disconnect from the server.
:param abort: If set to ``True``, do not wait for background tasks
associated with the connection to end.
Note: this method is a coroutine.
"""
if self.state == 'connected':
... |
java | public static String separatorsToSystem(final String path)
{
if (path == null)
{
return null;
}
if (isSystemWindows())
{
return separatorsToWindows(path);
}
else
{
return separatorsToUnix(path);
}
} |
python | def calculeToday(self):
"""Calcule the intervals from the last date."""
self.__logger.debug("Add today")
last = datetime.datetime.strptime(self.__lastDay, "%Y-%m-%d")
today = datetime.datetime.now().date()
self.__validInterval(last, today) |
java | private void removeComponentWithoutException(Type role, String hint)
{
try {
removeComponent(role, hint);
} catch (Exception e) {
this.logger.warn("Instance released but disposal failed. Some resources may not have been released.", e);
}
} |
python | def is_password_valid(password):
"""
Check if a password is valid
"""
pattern = re.compile(r"^.{4,75}$")
return bool(pattern.match(password)) |
python | def user_data(self, access_token, *args, **kwargs):
"""Load user data from OAuth Profile Google App Engine App"""
url = GOOGLE_APPENGINE_PROFILE_V1
auth = self.oauth_auth(access_token)
return self.get_json(url,
auth=auth, params=auth
) |
python | def eig_one_step(current_vector, learning_rate, vector_prod_fn):
"""Function that performs one step of gd (variant) for min eigen value.
Args:
current_vector: current estimate of the eigen vector with minimum eigen
value.
learning_rate: learning rate.
vector_prod_fn: function which returns produc... |
java | public static void main(final String[] args) {
Switch about = new Switch("a", "about", "display about message");
Switch help = new Switch("h", "help", "display help message");
FileArgument fastaFile = new FileArgument("i", "fasta-file", "input FASTA file, default stdin", false);
StringAr... |
python | def interested_in(self):
"""
A list of strings describing the genders the user is interested in.
"""
genders = []
for gender in self.cache['interested_in']:
genders.append(gender)
return genders |
java | private void removeOldChannels()
{
Iterator<AsteriskChannelImpl> i;
synchronized (channels)
{
i = channels.values().iterator();
while (i.hasNext())
{
final AsteriskChannel channel = i.next();
final Date dateOfRemoval = chan... |
python | def report(mount):
'''
Report on quotas for a specific volume
CLI Example:
.. code-block:: bash
salt '*' quota.report /media/data
'''
ret = {mount: {}}
ret[mount]['User Quotas'] = _parse_quota(mount, '-u')
ret[mount]['Group Quotas'] = _parse_quota(mount, '-g')
return ret |
java | public static void scale(double[][] x, double lo, double hi) {
int n = x.length;
int p = x[0].length;
double[] min = colMin(x);
double[] max = colMax(x);
for (int j = 0; j < p; j++) {
double scale = max[j] - min[j];
if (!Math.isZero(scale)) {
... |
python | def _setup_postprocess_hds_timeseries(hds_file, df, config_file, prefix=None, model=None):
"""Dirty function to post process concentrations in inactive/dry cells"""
warnings.warn(
"Setting up post processing of hds or ucn timeseries obs. "
"Prepending 'pp' to obs name may cause length to exceed ... |
python | def raw_urlsafe_b64encode(b):
'''Base64 encode using URL-safe encoding with padding removed.
@param b bytes to decode
@return bytes decoded
'''
b = to_bytes(b)
b = base64.urlsafe_b64encode(b)
b = b.rstrip(b'=') # strip padding
return b |
python | def set_wake_on_modem(enabled):
'''
Set whether or not the computer will wake from sleep when modem activity is
detected.
:param bool enabled: True to enable, False to disable. "On" and "Off" are
also acceptable values. Additionally you can pass 1 and 0 to represent
True and False respe... |
java | public static String getIP(final InetAddress inetAddress)
{
String ip = "";
ip = inetAddress.getHostAddress();
if (ip.equals(""))
{
final byte[] ipAddressInBytes = inetAddress.getAddress();
for (int i = 0; i < ipAddressInBytes.length; i++)
{
if (i > 0)
{
ip += ".";
}
... |
python | def explain_prediction(estimator, doc, **kwargs):
"""
Return an explanation of an estimator prediction.
:func:`explain_prediction` is not doing any work itself, it dispatches
to a concrete implementation based on estimator type.
Parameters
----------
estimator : object
Estimator in... |
python | def write_ndarray(self, result, dst_paths, nodata=None, compress='lzw'):
"""Write results (ndarray) to disc."""
assert len(dst_paths) == result.shape[2]
assert result.shape[0] == self._height
assert result.shape[1] == self._width
assert result.shape[2] == len(dst_paths)
... |
python | def get_block_operator(self):
"""Determine the immediate parent boolean operator for a filter"""
# Top level operator is `and`
block_stack = ['and']
for f in self.manager.iter_filters(block_end=True):
if f is None:
block_stack.pop()
continue
... |
java | public static <T> Collector<T, ?, Optional<Long>> rank(T value, Comparator<? super T> comparator) {
return rankBy(value, t -> t, comparator);
} |
python | def get_object(self, view_name, view_args, view_kwargs):
"""
Return the object corresponding to a matched URL.
Takes the matched URL conf arguments, and should return an
object instance, or raise an `ObjectDoesNotExist` exception.
"""
lookup_value = view_kwargs.get(self.... |
java | @Override
public boolean getPadding(Rect padding) {
padding.set(mPadding, mPadding, mPadding, mPadding);
return mPadding != 0;
} |
python | def unhandled_keys(self, size, key):
"""
Override this method to intercept keystrokes in subclasses.
Default behavior: Toggle flagged on space, ignore other keys.
"""
if key == " ":
if not self.flagged:
self.display.new_files.append(self.get_node().get... |
python | def wikipedia_search(query, lang="en", max_result=1):
"""
https://www.mediawiki.org/wiki/API:Opensearch
"""
query = any2unicode(query)
params = {
"action":"opensearch",
"search": query,
"format":"json",
#"formatversion":2,
#"namespace":0,
"suggest"... |
python | def _json_min(src, dest=''):
"""Minify JSON
Args:
src: json string or path-to-file with text to minify (mandatory)
dest: path-to-file to save minified xml string; (optional)
- if file doesn't exist it is created automatically;
- if this arg is skept function returns ... |
java | public Object getPropertyValue(String propertyName) throws BeansException {
if (PropertyAccessorUtils.isIndexedProperty(propertyName)) {
return getIndexedPropertyValue(propertyName);
}
else {
return getSimplePropertyValue(propertyName);
}
} |
java | public void marshall(StageDeclaration stageDeclaration, ProtocolMarshaller protocolMarshaller) {
if (stageDeclaration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(stageDeclaration.getName(), NAM... |
python | def create_plateaus(data, edges, plateau_size, plateau_vals, plateaus=None):
'''Creates plateaus of constant value in the data.'''
nodes = set(edges.keys())
if plateaus is None:
plateaus = []
for i in range(len(plateau_vals)):
if len(nodes) == 0:
break
... |
java | public Future<Channel> renegotiate(final Promise<Channel> promise) {
if (promise == null) {
throw new NullPointerException("promise");
}
ChannelHandlerContext ctx = this.ctx;
if (ctx == null) {
throw new IllegalStateException();
}
EventExecutor e... |
java | public void setChannelSummaries(java.util.Collection<ChannelSummary> channelSummaries) {
if (channelSummaries == null) {
this.channelSummaries = null;
return;
}
this.channelSummaries = new java.util.ArrayList<ChannelSummary>(channelSummaries);
} |
java | @SuppressWarnings("unchecked")
public EList<IfcRelDefinesByProperties> getPropertyDefinitionOf() {
return (EList<IfcRelDefinesByProperties>) eGet(
Ifc2x3tc1Package.Literals.IFC_PROPERTY_SET_DEFINITION__PROPERTY_DEFINITION_OF, true);
} |
python | def tower_layout(graph, height='freeenergy', scale=None, center=None, dim=2):
"""
Position all nodes of graph stacked on top of each other.
Parameters
----------
graph : `networkx.Graph` or `list` of nodes
A position will be assigned to every node in graph.
height : `str` or `None`, opt... |
python | def read_data_from_bytes(fileContent):
"""
Takes the binary data stored in the binary string provided and extracts the
data for each channel that was saved, along with the sample rate and length
of the data array.
Parameters
----------
fileContent : bytes
bytes object containing t... |
python | def decode_page(page):
"""
Return unicode string of geocoder results.
Nearly all services use JSON, so assume UTF8 encoding unless the
response specifies otherwise.
"""
if hasattr(page, 'read'): # urllib
if py3k:
encoding = page.headers.get_param("charset") or "utf-8"
... |
java | @SuppressWarnings("unchecked")
private static void pinStateChangeCallback(int pin, boolean state) {
Vector<GpioInterruptListener> listenersClone;
listenersClone = (Vector<GpioInterruptListener>) listeners.clone();
for (int i = 0; i < listenersClone.size(); i++) {
GpioInterruptL... |
python | def add_watch_callback(self, *args, **kwargs):
"""
Watch a key or range of keys and call a callback on every event.
If timeout was declared during the client initialization and
the watch cannot be created during that time the method raises
a ``WatchTimedOut`` exception.
... |
python | def run_steps_from_string(self, spec, language_name='en'):
""" Called from within step definitions to run other steps. """
caller = inspect.currentframe().f_back
line = caller.f_lineno - 1
fname = caller.f_code.co_filename
steps = parse_steps(spec, fname, line, ... |
java | public InputStream newInputStream() {
return new InputStream() {
private int pos = 0;
public int read() throws IOException {
synchronized(ByteBuffer.this) {
if(pos>=size) return -1;
return buf[pos++];
}
... |
python | def _getInputImage (input,group=None):
""" Factory function to return appropriate imageObject class instance"""
# extract primary header and SCI,1 header from input image
sci_ext = 'SCI'
if group in [None,'']:
exten = '[sci,1]'
phdu = fits.getheader(input, memmap=False)
else:
... |
java | public static DenseVector fromCSV(String csv) {
return Vector.fromCSV(csv).to(Vectors.DENSE);
} |
python | def suspend(self):
"""
Suspends the thread execution.
@rtype: int
@return: Suspend count. If zero, the thread is running.
"""
hThread = self.get_handle(win32.THREAD_SUSPEND_RESUME)
if self.is_wow64():
# FIXME this will be horribly slow on XP 64
... |
java | @Override
public boolean canServe(URL refUrl) {
if (refUrl == null || !this.getPath().equals(refUrl.getPath())) {
return false;
}
if(!protocol.equals(refUrl.getProtocol())) {
return false;
}
if (!Constants.NODE_TYPE_SERVICE.equals(this.getParameter(U... |
java | @Override
public final AItemSpecifics<T, ID> process(
final Map<String, Object> pReqVars,
final AItemSpecifics<T, ID> pEntity,
final IRequestData pRequestData) throws Exception {
String fileToUploadName = (String) pRequestData
.getAttribute("fileToUploadName");
OutputStream outs = null... |
python | def discoverTokenEndpoints(domain, content=None, look_in={'name': 'link'}, test_urls=True, validateCerts=True):
"""Find the token for the given domain.
Only scan html element matching all criteria in look_in.
optionally the content to be scanned can be given as an argument.
:param domain: the URL of t... |
python | def send(self_p, dest):
"""
Send message to destination socket, and destroy the message after sending
it successfully. If the message has no frames, sends nothing but destroys
the message anyhow. Nullifies the caller's reference to the message (as
it is a destructor).
"""
return lib.zmsg... |
java | public ClientResponse updateApplicationCatalog(File catalogPath, File deploymentPath)
throws IOException, NoConnectionsException, ProcCallException
{
return Client.updateApplicationCatalog(catalogPath, deploymentPath);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.