language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def fetch(self, url, listener, chunk_size_bytes=None, timeout_secs=None):
"""Fetches data from the given URL notifying listener of all lifecycle events.
:param string url: the url to GET data from
:param listener: the listener to notify of all download lifecycle events
:param chunk_size_bytes: the chun... |
java | public void checkFieldsCompatible(final String... fields) {
final Set<String> indexFields = Sets.newHashSet(index.getDefinition().getFields());
final Joiner joiner = Joiner.on(",");
check(indexFields.equals(Sets.newHashSet(fields)),
"Existing index '%s' (class '%s') fields '%s' a... |
java | public static <T, U> Stream<U> cast(final Stream<T> stream, final Class<? extends U> type) {
return stream.map(type::cast);
} |
java | public Operands addArgument(@NonNull String id, @NonNull INDArray array) {
map.put(NodeDescriptor.builder().name(id).build(), array);
return this;
} |
python | def get_beta(self, kl_loss=0.0):
"""Get the KL multiplier, either dynamically or schedule based.
if hparams.latent_loss_multiplier_dynamic is set to true, then beta
is being adjusted to keep KL under hparams.latent_loss_multiplier_epsilon.
In order to do so, the beta is being updated at each iteration
... |
python | def message_received(self, message):
"""Message was received from device."""
# If the message identifer is outstanding, then someone is
# waiting for the respone so we save it here
identifier = message.identifier or 'type_' + str(message.type)
if identifier in self._outstanding:
... |
python | def ready(self):
"""
update Django Rest Framework serializer mappings
"""
from django.contrib.gis.db import models
from rest_framework.serializers import ModelSerializer
from .fields import GeometryField
try:
# drf 3.0
field_mapping = Mode... |
python | def merge_collections(collections, force_dense=False, sampling_rate='auto'):
''' Merge two or more collections at the same level of analysis.
Args:
collections (list): List of Collections to merge.
sampling_rate (int, str): Sampling rate to use if it becomes necessary
to resample De... |
java | public static Collection<SerializationFormat> getAllFormats() {
ArrayList<SerializationFormat> serializationFormats = new ArrayList<>();
// single graph formats
serializationFormats.add(createTurtle());
serializationFormats.add(createN3());
serializationFormats.add(createNTriple... |
python | def write_hdf5_genes(E, gene_list, filename):
'''SPRING standard: filename = main_spring_dir + "counts_norm_sparse_genes.hdf5"'''
E = E.tocsc()
hf = h5py.File(filename, 'w')
counts_group = hf.create_group('counts')
cix_group = hf.create_group('cell_ix')
hf.attrs['ncells'] = E.shape[0]
hf.... |
java | public Collection getAllObjects(Class target)
{
PersistenceBroker broker = getBroker();
Collection result;
try
{
Query q = new QueryByCriteria(target);
result = broker.getCollectionByQuery(q);
}
finally
{
if (brok... |
java | public static <C extends Compound> boolean sequenceEquality(Sequence<C> source, Sequence<C> target) {
return baseSequenceEquality(source, target, false);
} |
python | def create_local_module_dir(cache_dir, module_name):
"""Creates and returns the name of directory where to cache a module."""
tf_v1.gfile.MakeDirs(cache_dir)
return os.path.join(cache_dir, module_name) |
java | private void getCommandsToDiff(String mapName,
CatalogMap<? extends CatalogType> prevMap,
CatalogMap<? extends CatalogType> newMap)
{
assert(prevMap != null);
assert(newMap != null);
// in previous, not in new
for... |
python | def add_to(self, parent, **kwargs):
# type: (Part, **Any) -> Part
"""Add a new instance of this model to a part.
This works if the current part is a model and an instance of this model is to be added
to a part instances in the tree.
In order to prevent the backend from updating... |
python | def forward_prediction(self, m):
""" Compute the expected sensory effect of the motor command m. It is a shortcut for self.infer(self.conf.m_dims, self.conf.s_dims, m)
"""
return self.infer(self.conf.m_dims, self.conf.s_dims, m) |
java | private void tryToMakeAdmin(User u) {
AuthorizationStrategy as = Jenkins.getInstance().getAuthorizationStrategy();
for (PermissionAdder adder : ExtensionList.lookup(PermissionAdder.class)) {
if (adder.add(as, u, Jenkins.ADMINISTER)) {
return;
}
}
} |
python | def write_parfile(df,parfile):
""" write a pest parameter file from a dataframe
Parameters
----------
df : (pandas.DataFrame)
dataframe with column names that correspond to the entries
in the parameter data section of a pest control file
parfile : str
name of the parameter f... |
java | public static void main(String[] args)
{
gbStandAlone = true;
m_args = args; // For a standalone app, you must save the args to parse them later.
if (Application.getRootApplet() != null)
{
Application.getRootApplet().init();
Application.getRootApplet().start();... |
python | def get_filenames(dirname, full_path=False, match_regex=None, extension=None):
"""
Get all filenames under ``dirname`` that match ``match_regex`` or have file
extension equal to ``extension``, optionally prepending the full path.
Args:
dirname (str): /path/to/dir on disk where files to read are... |
java | @Override
public void removeAllDataFromCache() {
for (Persister persister : this.listPersister) {
if (persister instanceof CacheCleaner) {
((CacheCleaner) persister).removeAllDataFromCache();
}
if (persister instanceof ObjectPersisterFactory) {
... |
python | def installation(self):
"""Return the details of the installation."""
self.locations = []
url = ("https://tccna.honeywell.com/WebAPI/emea/api/v1/location"
"/installationInfo?userId=%s"
"&includeTemperatureControlSystems=True"
% self.account_info['use... |
java | public static Date copyWith(Date self, Map<Object, Integer> updates) {
Calendar cal = Calendar.getInstance();
cal.setTime(self);
set(cal, updates);
return cal.getTime();
} |
java | public List<MockResponse> enqueue(String... paths) {
if (paths == null) {
return null;
}
List<MockResponse> mockResponseList = new ArrayList<>();
for (String path : paths) {
Fixture fixture = Fixture.parseFrom(path, parser);
MockResponse mockResponse = fixture.toMockResponse();
m... |
python | def _slice(self, slicer):
""" return a slice of my values """
# slice the category
# return same dims as we currently have
if isinstance(slicer, tuple) and len(slicer) == 2:
if not com.is_null_slice(slicer[0]):
raise AssertionError("invalid slicing for a 1-n... |
python | def change_site(self, old_site_name, new_site_name, new_location_name=None,
new_er_data=None, new_pmag_data=None, replace_data=False):
"""
Find actual data objects for site and location.
Then call the Site class change method to update site name and data.
"""
... |
python | def _run_somatic(paired, ref_file, target, out_file):
"""Run somatic calling with octopus, handling both paired and tumor-only cases.
Tweaks for low frequency, tumor only and UMI calling documented in:
https://github.com/luntergroup/octopus/blob/develop/configs/UMI.config
"""
align_bams = paired.tu... |
java | public RecordTypeBuilder addProperty(String name, JSType type, Node propertyNode) {
isEmpty = false;
properties.put(name, new RecordProperty(type, propertyNode));
return this;
} |
java | private void initDeviceInfo() throws V4L4JException{
//initialise deviceInfo
deviceInfo = new DeviceInfo(v4l4jObject, deviceFile);
ImageFormatList l = deviceInfo.getFormatList();
supportJPEG = l.getJPEGEncodableFormats().size()==0?false:true;
supportRGB24 = l.getRGBEncodableFormats().size()==0?false:true... |
java | public void marshall(DescribeEntityAggregatesRequest describeEntityAggregatesRequest, ProtocolMarshaller protocolMarshaller) {
if (describeEntityAggregatesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarsha... |
java | public int compareClassesByName(BugCollection lhsCollection, BugCollection rhsCollection, String lhsClassName,
String rhsClassName) {
lhsClassName = rewriteClassName(lhsClassName);
rhsClassName = rewriteClassName(rhsClassName);
return lhsClassName.compareTo(rhsClassName);
} |
java | public boolean contains(CharSequence name, CharSequence value, boolean ignoreCase) {
return contains(name.toString(), value.toString(), ignoreCase);
} |
python | def alias_item(self, item_id, alias_id):
"""Adds an ``Id`` to an ``Item`` for the purpose of creating compatibility.
The primary ``Id`` of the ``Item`` is determined by the
provider. The new ``Id`` is an alias to the primary ``Id``. If
the alias is a pointer to another item, it is reass... |
java | @GET
public Response search()
throws IOException {
return execute(getResourceRequest(RequestTypeEnum.GET, RestOperationTypeEnum.SEARCH_TYPE));
} |
java | @Bean
public PropertiesFactoryBean casCommonMessages() {
val properties = new PropertiesFactoryBean();
val resourceLoader = new DefaultResourceLoader();
val commonNames = casProperties.getMessageBundle().getCommonNames();
val resourceList = commonNames
.stream()
... |
python | def reload(self):
"""
Reloads current instance from DB store
"""
self._load_data(self.objects.data().filter(key=self.key)[0][0], True) |
python | def load_balancers_list_all(**kwargs):
'''
.. versionadded:: 2019.2.0
List all load balancers within a subscription.
CLI Example:
.. code-block:: bash
salt-call azurearm_network.load_balancers_list_all
'''
result = {}
netconn = __utils__['azurearm.get_client']('network', **k... |
python | def make_directory(self, directory_name, *args, **kwargs):
""" :meth:`.WNetworkClientProto.make_directory` method implementation
"""
previous_path = self.session_path()
try:
self.session_path(directory_name)
os.mkdir(self.full_path())
finally:
self.session_path(previous_path) |
java | public static String padRight(String string, int size, char padding) {
if(string == null || size <= string.length()) {
return string;
}
StringBuilder sb = new StringBuilder();
sb.append(string);
while (sb.length() < size) {
sb.append(padding);
}
return sb.toString();
} |
java | public final LWMConfig getBus() {
String thisMethodName = "getBus";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, thi... |
python | def pressure_trend_text(trend):
"""Convert pressure trend to a string, as used by the UK met
office.
"""
_ = pywws.localisation.translation.ugettext
if trend > 6.0:
return _(u'rising very rapidly')
elif trend > 3.5:
return _(u'rising quickly')
elif trend > 1.5:
retur... |
java | public String readString () {
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
// Null, empty, or UTF8.
int charCount = readVarIntFlag(true);
switch (charCount) {
case 0:
return null;
case 1:
return "";
}
charCount--;
readUtf8Chars(charCount);
return new String(chars, 0, ... |
java | final JsMessage setPropertiesInMessage(LMEMessage theMessage)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setPropertiesInMessage", theMessage);
boolean copyMade = false;
// If this is pubsub we share this message with other subscribers so we have
// to... |
python | def to_array(self):
"""
Serializes this VoiceMessage to a dictionary.
:return: dictionary representation of this object.
:rtype: dict
"""
array = super(VoiceMessage, self).to_array()
if isinstance(self.voice, InputFile):
array['voice'] = self.voice.to... |
python | def path_glob(pattern, current_dir=None):
"""Use pathlib for ant-like patterns, like: "**/*.py"
:param pattern: File/directory pattern to use (as string).
:param current_dir: Current working directory (as Path, pathlib.Path, str)
:return Resolved Path (as path.Path).
"""
if not current_di... |
java | public void validateFile(String fileName, String fileContents) throws ProvisioningApiException {
RequestBody requestBody = new MultipartBuilder()
.type(MultipartBuilder.FORM)
.addPart(
Headers.of("Content-Disposition", "form-data; name=\"csvfile\"; filename=\""+fileName+"\""),
RequestBody.creat... |
java | @Override
public void initialize(String keyStoreName, String keyStorePath, String keyStoreType, String keyStoreProvider,
String keyStorePassword, String keyAlias) throws AuditEncryptionException {
WsLocationAdmin locationAdmin = locationAdminRef.getService();
if (locationA... |
java | public static Vertex newB()
{
return new Vertex(Predefine.TAG_BIGIN, " ", new CoreDictionary.Attribute(Nature.begin, Predefine.MAX_FREQUENCY / 10), CoreDictionary.getWordID(Predefine.TAG_BIGIN));
} |
python | def set_tunnel(self, tunnel_type, tunnel, callback=None):
"""
set_tunnel(self, tunnel_type, tunnel, callback=None):
"""
orig_tunnel = self.tunnels.get(tunnel_type, (None, None))[0]
if orig_tunnel is not None:
_logger.debug("Unsubscribe: %s", (orig_tunnel,))
... |
java | public void setFunction( GradientLineFunction function , double funcMinValue ) {
this.function = function;
this.funcMinValue = funcMinValue;
lineSearch.setFunction(function,funcMinValue);
N = function.getN();
B = new DMatrixRMaj(N,N);
searchVector = new DMatrixRMaj(N,1);
g = new DMatrixRMaj(N,1);
s = ... |
python | def _emiss_ee(self, Eph):
"""
Electron-electron bremsstrahlung emissivity per unit photon energy
"""
if self.weight_ee == 0.0:
return np.zeros_like(Eph)
gam = np.vstack(self._gam)
# compute integral with electron distribution
emiss = c.cgs * trapz_log... |
python | def to_internal_value(self, data):
"""
Dicts of native values <- Dicts of primitive datatypes.
"""
if html.is_html_input(data):
data = html.parse_html_dict(data)
if not isinstance(data, dict):
self.fail('not_a_dict', input_type=type(data).__name__)
... |
java | public void stop(long millisec) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Stopping (" + millisec + ") : " + this);
}
if (0 == millisec) {
setState(STATE_STOPPED);
} else {
setState(STATE_STOPPING);
}
... |
java | public static Bootstrap removeConfiguration(Bootstrap b, String name) {
Objects.requireNonNull(b, "bootstrap");
Objects.requireNonNull(name, "name");
if (b.config().handler() != null) {
b.handler(removeConfiguration(b.config().handler(), name));
}
return b;
} |
java | private void alterMssqlTextColumns() {
ColumnType stateColType = getTypeOf(getSnapshotTableNameWithSchema(), "state");
ColumnType changedPropertiesColType = getTypeOf(getSnapshotTableNameWithSchema(), "state");
if(stateColType.typeName.equals("text")) {
executeSQL("ALTER TABLE " + g... |
python | def fork_worker(self, job):
"""Invoked by ``work`` method. ``fork_worker`` does the actual forking to create the child
process that will process the job. It's also responsible for monitoring the child process
and handling hangs and crashes.
Finally, the ``process`` method actually proce... |
java | public void setValue(E element) {
if(element == null)
throw new NullPointerException("cannot set a null element");
if(_lastId == VStack.NULL_ID)
throw new IllegalStateException("neither next() nor previous() has been called");
_stack.setById(_lastId, element);
a... |
python | def to_links_df(regressor_type,
regressor_kwargs,
trained_regressor,
tf_matrix_gene_names,
target_gene_name):
"""
:param regressor_type: string. Case insensitive.
:param regressor_kwargs: dict of key-value pairs that configures the regressor.
... |
python | def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
"""
See :meth:`superclass method
<.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
for spec of input and result values.
"""
# Check that the GSIM supports the standard deviations requested
... |
python | def prepare_policy_template(self, scaling_type, period_sec, server_group):
"""Renders scaling policy templates based on configs and variables.
After rendering, POSTs the json to Spinnaker for creation.
Args:
scaling_type (str): ``scale_up`` or ``scaling_down``. Type of policy
... |
python | def stripArgs(args, blacklist):
"""
Removes any arguments in the supplied list that are contained in the specified blacklist
"""
blacklist = [b.lower() for b in blacklist]
return list([arg for arg in args if arg.lower() not in blacklist]) |
python | def cluster_mini_batch_kmeans(data=None, k=100, max_iter=10, batch_size=0.2, metric='euclidean',
init_strategy='kmeans++', n_jobs=None, chunksize=None, skip=0, clustercenters=None, **kwargs):
r"""k-means clustering with mini-batch strategy
Mini-batch k-means is an approximation to... |
python | def get_broker(list_key=Conf.PREFIX):
"""
Gets the configured broker type
:param list_key: optional queue name
:type list_key: str
:return:
"""
# custom
if Conf.BROKER_CLASS:
module, func = Conf.BROKER_CLASS.rsplit('.', 1)
m = importlib.import_module(module)
broke... |
java | public GSLELINEEND createGSLELINEENDFromString(EDataType eDataType, String initialValue) {
GSLELINEEND result = GSLELINEEND.get(initialValue);
if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
return result;
} |
python | def eta_hms(seconds, always_show_hours=False, always_show_minutes=False, hours_leading_zero=False):
"""Converts seconds remaining into a human readable timestamp (e.g. hh:mm:ss, h:mm:ss, mm:ss, or ss).
Positional arguments:
seconds -- integer/float indicating seconds remaining.
Keyword arguments:
... |
java | public final EObject ruleAbstractToken() throws RecognitionException {
EObject current = null;
EObject this_AbstractTokenWithCardinality_0 = null;
EObject this_Action_1 = null;
enterRule();
try {
// InternalXtext.g:1247:2: ( (this_AbstractTokenWithCardinality_0... |
java | public void cleanDirectory() {
final File[] directories = _parentDirectory.listFiles((dir, name) -> name.startsWith(DIRECTORY_PREFIX));
for (final File directory : directories) {
delete(directory);
}
} |
python | def nla_put_u64(msg, attrtype, value):
"""Add 64 bit integer attribute to Netlink message.
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/attr.c#L638
Positional arguments:
msg -- Netlink message (nl_msg class instance).
attrtype -- attribute type (integer).
value -- numeric value to sto... |
java | public static Map<String,String> extractDateToDayFromVerbatim(String verbatimEventDate, int yearsBeforeSuspect) {
Map<String,String> result = extractDateFromVerbatim(verbatimEventDate, yearsBeforeSuspect);
if (result.size()>0 && result.get("resultState").equals("range")) {
String dateRange = result.get("result"... |
java | private void checkA() throws DatatypeException, IOException {
if (context.length() == 0) {
appendToContext(current);
}
current = reader.read();
appendToContext(current);
skipSpaces();
boolean expectNumber = true;
for (;;) {
switch (current... |
python | def fit(self, X, fixed_initialization=None):
"""Run GloVe and return the new matrix.
Parameters
----------
X : array-like of shape = [n_words, n_words]
The square count matrix.
fixed_initialization : None or dict (default: None)
If a dict, this will repl... |
python | def get_string(self, **kwargs):
"""Return string representation of table in current state.
Arguments:
start - index of first data row to include in output
end - index of last data row to include in output PLUS ONE (list slice style)
fields - names of fields (columns) to includ... |
python | def _remove_init_all(r):
"""Remove any __all__ in __init__.py file."""
new_r = redbaron.NodeList()
for n in r.node_list:
if n.type == 'assignment' and n.target.value == '__all__':
pass
else:
new_r.append(n)
return new_r |
python | def label_correcting_get_cycle(self, j, pred):
'''
API:
label_correcting_get_cycle(self, labelled, pred)
Description:
In label correcting check cycle it is decided pred has a cycle and
nodes in the cycle are labelled. We will create a list of nodes
... |
java | public List<PersistenceUnit<Persistence<T>>> getAllPersistenceUnit()
{
List<PersistenceUnit<Persistence<T>>> list = new ArrayList<PersistenceUnit<Persistence<T>>>();
List<Node> nodeList = childNode.get("persistence-unit");
for(Node node: nodeList)
{
PersistenceUnit<Persistence<T>> t... |
java | private Result nextImpl(int pos, int inUnit) {
int node=chars_.charAt(pos++);
for(;;) {
if(node<kMinLinearMatch) {
return branchNext(pos, node, inUnit);
} else if(node<kMinValueLead) {
// Match the first of length+1 units.
int lengt... |
python | def _accumulateFactors(self, aLocation, deltaLocation, limits, axisOnly):
"""
Calculate the factors of deltaLocation towards aLocation,
"""
relative = []
deltaAxis = deltaLocation.isOnAxis()
if deltaAxis is None:
relative.append(1)
elif deltaAxis:
... |
java | public static String getSegmentName(int segmentType)
{
String segmentName = "(Unknown segment type)";
segmentName = segValues.get(segmentType);
if (segmentName == null)
segmentName = "(Unknown segment type)";
return segmentName;
} |
java | public SubmitJobRequest withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} |
java | public final void chopMap() {
/* if it has been chopped then you have to return. */
if (mapChopped) {
return;
}
mapChopped = true;
/* If the internal map was not create yet, don't. We can chop the value w/o creating the internal map.*/
if (this.map == null) {... |
java | @Deprecated
public static Collector<MonetaryAmount, MonetarySummaryStatistics, MonetarySummaryStatistics> summarizingMonetary(
CurrencyUnit currencyUnit, ExchangeRateProvider provider){
// TODO implement method here
return summarizingMonetary(currencyUnit);
} |
python | def _live_receivers(self, sender):
"""
Filter sequence of receivers to get resolved, live receivers.
This checks for weak references and resolves them, then returning only
live receivers.
"""
receivers = None
if self.use_caching and not self._dead_receivers:
... |
python | def release(self, conn):
"""Revert back connection to pool."""
if conn.in_transaction:
raise InvalidRequestError(
"Cannot release a connection with "
"not finished transaction"
)
raw = conn.connection
res = yield from self._pool.rel... |
python | async def send_code_request(self, phone, *, force_sms=False):
"""
Sends a code request to the specified phone number.
Args:
phone (`str` | `int`):
The phone to which the code will be sent.
force_sms (`bool`, optional):
Whether to force se... |
python | def police_priority_map_exceed_map_pri5_exceed(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
police_priority_map = ET.SubElement(config, "police-priority-map", xmlns="urn:brocade.com:mgmt:brocade-policer")
name_key = ET.SubElement(police_priority_map, ... |
python | def start_log_task(task, logger=logging, level='info'):
"""
Starts a log task
Args:
task (str): name of the log task to start
logger (logging.Logger): logger to use
level (str): log level to use
Returns:
None
"""
getattr(logger, level)(START_TASK_TRIGGER_MSG % t... |
java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Path("/metrics/search")
@Description("Discover metric schema records. If type is specified, then records of that particular type are returned.")
public MetricDiscoveryResultDto searchRecords(@Context HttpServletRequest req,
MetricDiscoveryQueryDto met... |
python | def write_metrics_file(metrics: List[Dict[str, Any]], path: str):
"""
Write metrics data to tab-separated file.
:param metrics: metrics data.
:param path: Path to write to.
"""
with open(path, 'w') as metrics_out:
for checkpoint, metric_dict in enumerate(metrics, 1):
metrics... |
python | def list_users():
"""
List all users on the database
"""
echo_header("List of users")
for user in current_app.appbuilder.sm.get_all_users():
click.echo(
"username:{0} | email:{1} | role:{2}".format(
user.username, user.email, user.roles
)
) |
java | static public List<String> hasIssues(List<Context> contexts) {
List<String> issues = new ArrayList<>();
// Check that individual contexts are valid
for (Context context : contexts) {
issues.addAll(ContextChecker.hasIssues(context));
}
// Check that ids are unique
Set<String> ids = new Ha... |
python | def remove_rule(self, rule):
"""Remove rule from :attr:`R` and its corresponding weight from
:attr:`W`.
:param rule: rule to remove
:type rule:
:class:`~creamas.rules.rule.Rule` or
:class:`~creamas.rules.rule.RuleLeaf`
:raises TypeError:
If ru... |
python | def create_widget(self):
""" Create the underlying widget.
"""
d = self.declaration
self.widget = TabLayout(self.get_context(), None, d.style) |
python | def authorized(self):
"""
This is the route/function that the user will be redirected to by
the provider (e.g. Twitter) after the user has logged into the
provider's website and authorized your app to access their account.
"""
if self.redirect_url:
next_url = ... |
python | async def release(self, *, delay=None):
"""
Release task (return to queue) with delay if specified
:param delay: Time in seconds before task will become ready again
:return: Task instance
"""
return await self._tube.release(self._task_id, delay=delay) |
python | def shift_com(elements, coordinates, com_adjust=np.zeros(3)):
"""
Return coordinates translated by some vector.
Parameters
----------
elements : numpy.ndarray
An array of all elements (type: str) in a molecule.
coordinates : numpy.ndarray
An array containing molecule's coordina... |
java | @Override
public <E extends Enum<E>> AbstractIoBufferEx putEnumSetInt(Set<E> set) {
long vector = toLong(set);
if ((vector & ~INT_MASK) != 0) {
throw new IllegalArgumentException(
"The enum set is too large to fit in an int: " + set);
}
return putInt((... |
python | def upload_site(self):
"""Upload a previously-built site to LSST the Docs."""
if not os.path.isdir(self._config['build_dir']):
message = 'Site not built at {0}'.format(self._config['build_dir'])
self._logger.error(message)
raise RuntimeError(message)
ltdclien... |
java | private void sendData(CommsByteBuffer request, short jfapPriority, boolean requireReply,
SITransaction tran, int outboundSegmentType, int outboundNoReplySegmentType,
int replySegmentType)
throws SIResourceException, SISessionUnavailableException,
... |
java | void initializeRandomAttributes(SimpleTypeInformation<V> in) {
int d = ((VectorFieldTypeInformation<V>) in).getDimensionality();
selectedAttributes = BitsUtil.random(k, d, rnd.getSingleThreadedRandom());
} |
python | def Beta(alpha, beta, low=0, high=1, tag=None):
"""
A Beta random variate
Parameters
----------
alpha : scalar
The first shape parameter
beta : scalar
The second shape parameter
Optional
--------
low : scalar
Lower bound of the distribution support (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.