func_name stringlengths 1 130 | whole_func_string stringlengths 86 46.4k | language stringclasses 2
values | func_documentation_string stringlengths 1 8.4k | label int64 0 0 | signal_code int64 0 0 | signal_doc int64 0 0 | signal_complexity int64 0 0 |
|---|---|---|---|---|---|---|---|
Swimlane.product_version | def product_version(self):
"""Swimlane product version"""
version_separator = '+'
if version_separator in self.version:
# Post product/build version separation
return self.version.split(version_separator)[0]
# Pre product/build version separation
return se... | python | Swimlane product version | 0 | 0 | 0 | 0 |
VdpMgr._fill_topology_cfg | def _fill_topology_cfg(self, topo_dict):
"""Fills the extra configurations in the topology. """
cfg_dict = {}
if topo_dict.bond_member_ports is not None:
cfg_dict.update({'bond_member_ports':
topo_dict.bond_member_ports})
if topo_dict.bond_interfa... | python | Fills the extra configurations in the topology. | 0 | 0 | 0 | 0 |
glob | def glob(patterns, *, flags=0):
"""Glob."""
return list(iglob(util.to_tuple(patterns), flags=flags)) | python | Glob. | 0 | 0 | 0 | 0 |
ModuleTypeMessage.populate | def populate(self, priority, address, rtr, data):
"""
:return: None
"""
assert isinstance(data, bytes)
self.needs_low_priority(priority)
self.needs_no_rtr(rtr)
self.needs_data(data, 4)
self.set_attributes(priority, address, rtr)
self.module_type = ... | python | :return: None | 0 | 0 | 0 | 0 |
ClosureOptimizePrimitives.maybeProcessDomTagName | private void maybeProcessDomTagName(Node n) {
if (NodeUtil.isLValue(n)) {
return;
}
String prefix = "goog$dom$TagName$";
String tagName;
if (n.isName() && n.getString().startsWith(prefix)) {
tagName = n.getString().substring(prefix.length());
} else if (n.isGetProp() && !n.getParent(... | java | Converts the given node to string if it is safe to do so. | 0 | 0 | 0 | 0 |
get_dataset_split | def get_dataset_split(tmp_dir, split, use_control_set):
"""Gives the file paths with regards to the given split.
Args:
tmp_dir: temp directory
split: dataset split
use_control_set: uses control dataset if true.
Returns:
list of file paths.
"""
if not use_control_set:
dataset_split = {
... | python | Gives the file paths with regards to the given split.
Args:
tmp_dir: temp directory
split: dataset split
use_control_set: uses control dataset if true.
Returns:
list of file paths. | 0 | 0 | 0 | 0 |
prepare_image_question_encoder | def prepare_image_question_encoder(image_feat, question, hparams):
"""Prepare encoder.
Args:
image_feat: a Tensor.
question: a Tensor.
hparams: run hyperparameters
Returns:
encoder_input: a Tensor, bottom of encoder stack
encoder_self_attention_bias: a bias tensor for use in encoder self-att... | python | Prepare encoder.
Args:
image_feat: a Tensor.
question: a Tensor.
hparams: run hyperparameters
Returns:
encoder_input: a Tensor, bottom of encoder stack
encoder_self_attention_bias: a bias tensor for use in encoder self-attention | 0 | 0 | 0 | 0 |
GrammaticalStructure.getAllDependents | private static Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> getAllDependents(TreeGraphNode node) {
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> newMap = Generics.newHashMap();
for (Class<?> o : node.label.keySet()) {
try {
// The line below will exception unless it's ... | java | Returns all the dependencies of a certain node.
@param node The node to return dependents for
@return map of dependencies | 0 | 0 | 0 | 0 |
ByteArray.compress | public void compress() {
IoBuffer tmp = IoBuffer.allocate(0);
tmp.setAutoExpand(true);
byte[] tmpData = new byte[data.limit()];
data.position(0);
data.get(tmpData);
try (DeflaterOutputStream deflater = new DeflaterOutputStream(tmp.asOutputStream(), new Deflater(Defl... | java | Compress contents using zlib. | 0 | 0 | 0 | 0 |
RoutingBase.create_route | def create_route(self, item, routes):
"""Stores a new item in routing map"""
for route in routes:
self._routes.setdefault(route, set()).add(item)
return item | python | Stores a new item in routing map | 0 | 0 | 0 | 0 |
csvserver_stats.get | public static csvserver_stats get(nitro_service service, String name) throws Exception{
csvserver_stats obj = new csvserver_stats();
obj.set_name(name);
csvserver_stats response = (csvserver_stats) obj.stat_resource(service);
return response;
} | java | Use this API to fetch statistics of csvserver_stats resource of given name . | 0 | 0 | 0 | 0 |
AbstractCounter.getSeries | @Override
public DataPoint[] getSeries(long timestampStartMs, long timestampEndMs, int steps,
DataPoint.Type type) {
DataPoint[] origin = getAllInRange(timestampStartMs, timestampEndMs);
if (steps < 1) {
steps = 1;
}
if (steps == 1) {
return origi... | java | {@inheritDoc} | 0 | 0 | 0 | 0 |
CreditBasedPartitionRequestClientHandler.checkError | private void checkError() throws IOException {
final Throwable t = channelError.get();
if (t != null) {
if (t instanceof IOException) {
throw (IOException) t;
} else {
throw new IOException("There has been an error in the channel.", t);
}
}
} | java | Checks for an error and rethrows it if one was reported. | 0 | 0 | 0 | 0 |
CommerceRegionLocalServiceBaseImpl.updateCommerceRegion | @Indexable(type = IndexableType.REINDEX)
@Override
public CommerceRegion updateCommerceRegion(CommerceRegion commerceRegion) {
return commerceRegionPersistence.update(commerceRegion);
} | java | Updates the commerce region in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
@param commerceRegion the commerce region
@return the commerce region that was updated | 0 | 0 | 0 | 0 |
RetireJSDataSource.shouldUpdagte | protected boolean shouldUpdagte(File repo) throws NumberFormatException {
boolean proceed = true;
if (repo != null && repo.isFile()) {
final int validForHours = settings.getInt(Settings.KEYS.ANALYZER_RETIREJS_REPO_VALID_FOR_HOURS, 0);
final long lastUpdatedOn = repo.lastModified(... | java | Determines if the we should update the RetireJS database.
@param repo the retire JS repository.
@return <code>true</code> if an updated to the RetireJS database should
be performed; otherwise <code>false</code>
@throws NumberFormatException thrown if an invalid value is contained in
the database properties | 0 | 0 | 0 | 0 |
EngineJob.results | def results(self) -> List[TrialResult]:
"""Returns the job results, blocking until the job is complete."""
if not self._results:
job = self._update_job()
for _ in range(1000):
if job['executionStatus']['state'] in TERMINAL_STATES:
break
... | python | Returns the job results, blocking until the job is complete. | 0 | 0 | 0 | 0 |
ZapNTLMEngineImpl.getCharset | private static Charset getCharset(final int flags) throws AuthenticationException
{
if ((flags & FLAG_REQUEST_UNICODE_ENCODING) == 0) {
return DEFAULT_CHARSET;
} else {
if (UNICODE_LITTLE_UNMARKED == null) {
throw new AuthenticationException( "Unicode not supp... | java | Find the character set based on the flags.
@param flags is the flags.
@return the character set. | 0 | 0 | 0 | 0 |
CleaneLing.full | public static CleaneLing full(final FormulaFactory f) {
return new CleaneLing(f, SolverStyle.FULL, new CleaneLingConfig.Builder().build());
} | java | Returns a new full CleaneLing solver.
@param f the formula factory
@return the solver | 0 | 0 | 0 | 0 |
Connectors.externalNodeRemoved | public void externalNodeRemoved( String externalNodeKey ) {
if (this.snapshot.get().containsProjectionForExternalNode(externalNodeKey)) {
// the external node was the root of a projection, so we need to remove that projection
synchronized (this) {
Snapshot current = this.... | java | Signals that an external node with the given key has been removed.
@param externalNodeKey a {@code non-null} String | 0 | 0 | 0 | 0 |
watsonSpeechClient.convert_audio | def convert_audio(self, file_path, new_mimetype, overwrite=False):
'''
a method to convert an audio file into a different codec
:param file_path: string with path to file on localhost
:param new_mimetype: string with mimetype for new file
:param overwrit... | python | a method to convert an audio file into a different codec
:param file_path: string with path to file on localhost
:param new_mimetype: string with mimetype for new file
:param overwrite: [optional] boolean to overwrite existing file
:return: string with path to new file... | 0 | 0 | 0 | 0 |
KeyCrypterScrypt.deriveKey | @Override
public KeyParameter deriveKey(CharSequence password) throws KeyCrypterException {
byte[] passwordBytes = null;
try {
passwordBytes = convertToByteArray(password);
byte[] salt = new byte[0];
if ( scryptParameters.getSalt() != null) {
salt ... | java | Generate AES key.
This is a very slow operation compared to encrypt/ decrypt so it is normally worth caching the result.
@param password The password to use in key generation
@return The KeyParameter containing the created AES key
@throws KeyCrypterException | 0 | 0 | 0 | 0 |
DistributionSnapshot.compare | def compare(self, snapshot):
"""Compare two snapshots:
- return a list of new packages in this snapshot
- return a list of new builds in this snapshot
:param snapshot: distribution snapshot
:type snapshot: DistributionSnapshot
"""
builds = snapshot.builds()
diff_snapshot = DistributionSnapshot(self.d... | python | Compare two snapshots:
- return a list of new packages in this snapshot
- return a list of new builds in this snapshot
:param snapshot: distribution snapshot
:type snapshot: DistributionSnapshot | 0 | 0 | 0 | 0 |
EntityFormat.isUrlAddress | public final static boolean isUrlAddress(String str, ADictionary dic)
{
int prIndex = str.indexOf("://");
if ( prIndex > -1 && ! StringUtil.isLatin(str, 0, prIndex) ) {
return false;
}
int sIdx = prIndex > -1 ? prIndex + 3 : 0;
int slIndex = str.indexOf('... | java | check if the specified string is an URL address or not
@param str
@param dic optional dictionary object
@return boolean | 0 | 0 | 0 | 0 |
Matrix4f.orthoSymmetric | public Matrix4f orthoSymmetric(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
return orthoSymmetric(width, height, zNear, zFar, zZeroToOne, thisOrNew());
} | java | Apply a symmetric orthographic projection transformation for a right-handed coordinate system
using the given NDC z range to this matrix.
<p>
This method is equivalent to calling {@link #ortho(float, float, float, float, float, float, boolean) ortho()} with
<code>left=-width/2</code>, <code>right=+width/2</code>, <code... | 0 | 0 | 0 | 0 |
Dummy.on_touch_up | def on_touch_up(self, touch):
"""Return to ``pos_start``, but first, save my current ``pos`` into
``pos_up``, so that the layout knows where to put the real
:class:`board.Spot` or :class:`board.Pawn` instance.
"""
if touch is not self._touch:
return False
sel... | python | Return to ``pos_start``, but first, save my current ``pos`` into
``pos_up``, so that the layout knows where to put the real
:class:`board.Spot` or :class:`board.Pawn` instance. | 0 | 0 | 0 | 0 |
CFDecoder.get_cell_node_coord | def get_cell_node_coord(self, var, coords=None, axis='x', nans=None):
"""
Checks whether the bounds in the variable attribute are triangular
Parameters
----------
var: xarray.Variable or xarray.DataArray
The variable to check
coords: dict
Coordina... | python | Checks whether the bounds in the variable attribute are triangular
Parameters
----------
var: xarray.Variable or xarray.DataArray
The variable to check
coords: dict
Coordinates to use. If None, the coordinates of the dataset in the
:attr:`ds` attribut... | 0 | 0 | 0 | 0 |
URICertStore.engineGetCertificates | @Override
@SuppressWarnings("unchecked")
public synchronized Collection<X509Certificate> engineGetCertificates
(CertSelector selector) throws CertStoreException {
// if ldap URI we wrap the CertSelector in an LDAPCertSelector to
// avoid LDAP DN matching issues (see LDAPCertSelector for... | java | Returns a <code>Collection</code> of <code>X509Certificate</code>s that
match the specified selector. If no <code>X509Certificate</code>s
match the selector, an empty <code>Collection</code> will be returned.
@param selector a <code>CertSelector</code> used to select which
<code>X509Certificate</code>s should be retur... | 0 | 0 | 0 | 0 |
DBAssert.dataSetAssertion | static void dataSetAssertion(CallInfo callInfo, DataSet expected, DataSet actual) {
validateDataSetAssertion(expected, actual);
DataSource source = expected.getSource();
Delta delta = new Delta(expected, actual);
DataSetAssertion assertion = new DataSetAssertion(expected, delta);
source.getDB().log... | java | Perform a data set assertion.
@param callInfo Call info.
@param expected Expected data.
@param actual Actual data.
@throws DBAssertionError If the assertion fails.
@throws InvalidOperationException If the arguments are invalid. | 0 | 0 | 0 | 0 |
CheckCommandSpaces | def CheckCommandSpaces(filename, linenumber, clean_lines, errors):
"""
No extra spaces between command and parenthesis
"""
line = clean_lines.lines[linenumber]
match = ContainsCommand(line)
if match and len(match.group(2)):
errors(filename, linenumber, 'whitespace/extra',
... | python | No extra spaces between command and parenthesis | 0 | 0 | 0 | 0 |
delaunay2D | def delaunay2D(plist, mode='xy', tol=None):
"""
Create a mesh from points in the XY plane.
If `mode='fit'` then the filter computes a best fitting
plane and projects the points onto it.
.. hint:: |delaunay2d| |delaunay2d.py|_
"""
pd = vtk.vtkPolyData()
vpts = vtk.vtkPoints()
vpts.Se... | python | Create a mesh from points in the XY plane.
If `mode='fit'` then the filter computes a best fitting
plane and projects the points onto it.
.. hint:: |delaunay2d| |delaunay2d.py|_ | 0 | 0 | 0 | 0 |
EC2TagSet.withEc2TagSetList | public EC2TagSet withEc2TagSetList(java.util.List<EC2TagFilter>... ec2TagSetList) {
if (this.ec2TagSetList == null) {
setEc2TagSetList(new com.amazonaws.internal.SdkInternalList<java.util.List<EC2TagFilter>>(ec2TagSetList.length));
}
for (java.util.List<EC2TagFilter> ele : ec2TagSetL... | java | <p>
A list that contains other lists of EC2 instance tag groups. For an instance to be included in the deployment
group, it must be identified by all of the tag groups in the list.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setEc2TagSetList(java.util.Collection)} or ... | 0 | 0 | 0 | 0 |
Task.should_retry_on | def should_retry_on(self, exception_class, logger=None):
"""
Whether this task should be retried when the given exception occurs.
"""
for n in (self.retry_on or []):
try:
if issubclass(exception_class, import_attribute(n)):
return True
... | python | Whether this task should be retried when the given exception occurs. | 0 | 0 | 0 | 0 |
CmsLoginForm.setOptionsVisible | public void setOptionsVisible(boolean optionsVisible) {
m_optionsVisible = optionsVisible;
boolean ousVisible = optionsVisible && !m_ouSelect.isAlwaysHidden();
m_ouSelect.setVisible(ousVisible);
m_forgotPasswordButton.setVisible(optionsVisible);
String optionsMessage = CmsVaadi... | java | Sets visibility of 'advanced' options.<p>
@param optionsVisible true if the options should be shown, false if not | 0 | 0 | 0 | 0 |
SplitColoredFormatter.format | def format(self, record):
"""Format a message from a record object."""
record = ColoredRecord(record)
record.log_color = self.color(self.log_colors, record.levelname)
# Set secondary log colors
if self.secondary_log_colors:
for name, log_colors in self.secondary_log_... | python | Format a message from a record object. | 0 | 0 | 0 | 0 |
Light.set_infrared | def set_infrared(self, infrared_brightness, callb=None, rapid=False):
"""Convenience method to set the infrared status of the device
This method will send a SetPower message to the device, and request callb be executed
when an ACK is received. The default callback will simply cache the value.
... | python | Convenience method to set the infrared status of the device
This method will send a SetPower message to the device, and request callb be executed
when an ACK is received. The default callback will simply cache the value.
:param infrared_brightness: The new state
:type infrared_... | 0 | 0 | 0 | 0 |
PWOutput.read_pattern | def read_pattern(self, patterns, reverse=False,
terminate_on_match=False, postprocess=str):
"""
General pattern reading. Uses monty's regrep method. Takes the same
arguments.
Args:
patterns (dict): A dict of patterns, e.g.,
{"energy": r"e... | python | General pattern reading. Uses monty's regrep method. Takes the same
arguments.
Args:
patterns (dict): A dict of patterns, e.g.,
{"energy": r"energy\\(sigma->0\\)\\s+=\\s+([\\d\\-.]+)"}.
reverse (bool): Read files in reverse. Defaults to false. Useful for
... | 0 | 0 | 0 | 0 |
AnnotationMappingInfo.getClassInfo | public ClassInfo getClassInfo(final String className) {
for(ClassInfo item : classInfos) {
if(item.getClassName().equals(className)) {
return item;
}
}
return null;
} | java | クラス名を指定してクラス情報を取得する。
@param className FQCN(完全限定クラス名)を指定します。
@return 存在しないクラス名の場合、nullを返します。 | 0 | 0 | 0 | 0 |
DensityTree.setMaxDepth | @javax.annotation.Nonnull
public com.simiacryptus.util.data.DensityTree setMaxDepth(int maxDepth) {
this.maxDepth = maxDepth;
return this;
} | java | Sets max depth.
@param maxDepth the max depth
@return the max depth | 0 | 0 | 0 | 0 |
XTimeEdit.setShowHours | def setShowHours(self, state=True):
"""
Sets whether or not to display the hours combo box for this widget.
:param state | <bool>
"""
self._showHours = state
if state:
self._hourSeparator.show()
self._hourCombo.show()
else:
... | python | Sets whether or not to display the hours combo box for this widget.
:param state | <bool> | 0 | 0 | 0 | 0 |
Request.set | def set(self, name: str, value: str) -> None:
"""
重写请求中的 header, 不推荐使用
"""
name = name.casefold()
self._headers[name] = value | python | 重写请求中的 header, 不推荐使用 | 0 | 0 | 0 | 0 |
CircuitTikzGenerator._gate_width | def _gate_width(self, gate):
"""
Return the gate width, using the settings (if available).
:param string gate: The name of the gate whose height is desired.
:return: Width of the gate.
:rtype: float
"""
try:
gates = self.settings['gates']
... | python | Return the gate width, using the settings (if available).
:param string gate: The name of the gate whose height is desired.
:return: Width of the gate.
:rtype: float | 0 | 0 | 0 | 0 |
TaskQueue.notifyStatus | private void notifyStatus(final Task task, final TaskStatus taskStatus, String reasonFormat, Object... args)
{
giant.lock();
try {
Preconditions.checkNotNull(task, "task");
Preconditions.checkNotNull(taskStatus, "status");
Preconditions.checkState(active, "Queue is not active!");
Prec... | java | Notify this queue that some task has an updated status. If this update is valid, the status will be persisted in
the task storage facility. If the status is a completed status, the task will be unlocked and no further
updates will be accepted.
@param task task to update
@param taskStatus new task status
@throws... | 0 | 0 | 0 | 0 |
RtfImage.writeImageDataHexEncoded | private void writeImageDataHexEncoded(final OutputStream bab) throws IOException
{
int cnt = 0;
for(int k = 0; k < imageData.length; k++) {
final byte[] chunk = imageData[k];
for(int x = 0; x < chunk.length; x++) {
bab.write(byte2charLUT, (chunk[x]&0xff)*2, 2);
if(++cnt == 64) {
bab.... | java | Writes the image data to the given buffer as hex encoded text.
@param bab
@throws IOException | 0 | 0 | 0 | 0 |
ExampleDataset.image | def image(self):
"""Counts image (`~astropy.io.fits.ImageHDU`)."""
events = self.event_table
skycoord = SkyCoord(events['GLON'], events['GLAT'], unit='deg', frame='galactic')
pixcoord = PixCoord.from_sky(skycoord=skycoord, wcs=self.wcs)
shape = self.config['shape']
bins ... | python | Counts image (`~astropy.io.fits.ImageHDU`). | 0 | 0 | 0 | 0 |
SubscriptionStateFilter.setConsumerDispatcherStateFilter | public void setConsumerDispatcherStateFilter(ConsumerDispatcherState consumerDispatcherState)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "setConsumerDispatcherStateFilter", consumerDispatcherState);
this._consumerDispatcherState = consumerDispatcherState;
this._subscriptionId = null;
this._dest... | java | setter to create a filter based on a specific consumer dispatcher state object
@param consumerDispatcherState | 0 | 0 | 0 | 0 |
ObjectiveBankAdminSession._record_extension | def _record_extension(self, bank_id, key, value):
"""
To structure a record extension property bean
"""
record_bean = {
'value': value,
'displayName': self._text_bean(key),
'description': self._text_bean(key),
'displayLabel': self._text_bea... | python | To structure a record extension property bean | 0 | 0 | 0 | 0 |
ElasticsearchClientV5.waitForHealthyIndex | public void waitForHealthyIndex(String index) throws IOException {
logger.debug("wait for yellow health on index [{}]", index);
Response restResponse = lowLevelClient.performRequest("GET", "/_cluster/health/" + index,
Collections.singletonMap("wait_for_status", "yellow"));
logge... | java | Wait for an index to become at least yellow (all primaries assigned)
@param index index name
@throws IOException In case of error | 0 | 0 | 0 | 0 |
QWhereSection.appendSQL | @Override
public QWhereSection appendSQL(final SQLSelect _select)
throws EFapsException
{
_select.addPart(SQLPart.WHERE);
this.part.appendSQL(_select);
return this;
} | java | {@inheritDoc} | 0 | 0 | 0 | 0 |
DNSHinfo.write | def write(self, out):
"""Used in constructing an outgoing packet"""
out.write_string(self.cpu, len(self.cpu))
out.write_string(self.os, len(self.os)) | python | Used in constructing an outgoing packet | 0 | 0 | 0 | 0 |
Functions.compose | public static <A, B, C> Function<A, C> compose(Function<A, B> f1, Function<B, C> f2) {
return requireNonNull(f1, "f1").andThen(requireNonNull(f2, "f2"));
} | java | Returns a {@link Function} that composes the specified {@link Function}s with chained
{@link Function#andThen(Function)}. It is useful when you need to compose method handles, which is
impossible with {@link Function#andThen(Function)}:
<pre>{@code
Function<A, B> f = Functions.compose(TypeA::new, TypeB::new);
}</pre> | 0 | 0 | 0 | 0 |
UpperValenceBand.ξ_bounds( | def ξ_bounds(self):
"""Allowed range for the variable :math:`ξ = E - μ`.
:return: :math:`(\\left|Δμ\\right| - 2 λ, \\left|Δμ\\right|)`
:rtype: tuple
"""
λ, Δμ = self._dichalcogenide.λ, self.Δμ
return (abs(Δμ) - 2 * λ, abs(Δμ)) | python | Allowed range for the variable :math:`ξ = E - μ`.
:return: :math:`(\\left|Δμ\\right| - 2 λ, \\left|Δμ\\right|)`
:rtype: tuple | 0 | 0 | 0 | 0 |
Logger.warnf | public void warnf(String format, Object param1) {
if (isEnabled(Level.WARN)) {
doLogf(Level.WARN, FQCN, format, new Object[] { param1 }, null);
}
} | java | Issue a formatted log message with a level of WARN.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param param1 the sole parameter | 0 | 0 | 0 | 0 |
DescribeDocumentVersionsResult.withDocumentVersions | public DescribeDocumentVersionsResult withDocumentVersions(DocumentVersionMetadata... documentVersions) {
if (this.documentVersions == null) {
setDocumentVersions(new java.util.ArrayList<DocumentVersionMetadata>(documentVersions.length));
}
for (DocumentVersionMetadata ele : document... | java | <p>
The document versions.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDocumentVersions(java.util.Collection)} or {@link #withDocumentVersions(java.util.Collection)} if you
want to override the existing values.
</p>
@param documentVersions
The document versions.
@... | 0 | 0 | 0 | 0 |
CustomTabsController.launchUri | public void launchUri(@NonNull final Uri uri) {
final Context context = this.context.get();
if (context == null) {
Log.v(TAG, "Custom Tab Context was no longer valid.");
return;
}
if (customTabsOptions == null) {
customTabsOptions = CustomTabsOptions.... | java | Opens a Uri in a Custom Tab or Browser.
The Custom Tab service will be given up to {@link CustomTabsController#MAX_WAIT_TIME_SECONDS} to be connected.
If it fails to connect the Uri will be opened on a Browser.
<p>
In the exceptional case that no Browser app is installed on the device, this method will fail silently an... | 0 | 0 | 0 | 0 |
ScriptfileUtils.setExecutePermissions | public static void setExecutePermissions(final File scriptfile) throws IOException {
if (!scriptfile.setExecutable(true, true)) {
System.err.println("Unable to set executable bit on temp script file, execution may fail: " + scriptfile
.getAbsolutePath());
}
} | java | Set the executable flag on a file if supported by the OS
@param scriptfile target file
@throws IOException if an error occurs | 0 | 0 | 0 | 0 |
SDVariable.rsub | public SDVariable rsub(String name, SDVariable x) {
val result = sameDiff.f().rsub(this,x);
return sameDiff.updateVariableNameAndReference(result,name);
} | java | Reverse subtraction operation: elementwise {@code x - this}<br>
If this and x variables have equal shape, the output shape is the same as the inputs.<br>
Supports broadcasting: if this and x have different shapes and are broadcastable, the output shape is broadcast.
@param name Name of the output variable
@param x ... | 0 | 0 | 0 | 0 |
Cgroup.has_value | def has_value(self, subsystem, option):
"""
Check whether the given value exists in the given subsystem.
Does not make a difference whether the value is readable, writable, or both.
Do not include the subsystem name in the option name.
Only call this method if the given subsystem... | python | Check whether the given value exists in the given subsystem.
Does not make a difference whether the value is readable, writable, or both.
Do not include the subsystem name in the option name.
Only call this method if the given subsystem is available. | 0 | 0 | 0 | 0 |
Criteria.addColumnIsNull | public void addColumnIsNull(String column)
{
// PAW
//SelectionCriteria c = ValueCriteria.buildNullCriteria(column, getAlias());
SelectionCriteria c = ValueCriteria.buildNullCriteria(column, getUserAlias(column));
c.setTranslateAttribute(false);
addSelectionCriteria(c);
} | java | Adds is Null criteria,
customer_id is Null
The attribute will NOT be translated into column name
@param column The column name to be used without translation | 0 | 0 | 0 | 0 |
ProductSetAPI.get_products | def get_products(self, product_ids):
"""
This function (and backend API) is being obsoleted. Don't use it anymore.
"""
if self.product_set_id is None:
raise ValueError('product_set_id must be specified')
data = {'ids': product_ids}
return self.client.get(self.... | python | This function (and backend API) is being obsoleted. Don't use it anymore. | 0 | 0 | 0 | 0 |
Device.services_resolved | def services_resolved(self):
"""
Called when all device's services and characteristics got resolved.
"""
self._disconnect_service_signals()
services_regex = re.compile(self._device_path + '/service[0-9abcdef]{4}$')
managed_services = [
service for service in ... | python | Called when all device's services and characteristics got resolved. | 0 | 0 | 0 | 0 |
F1D.calc_max_flexural_wavelength | def calc_max_flexural_wavelength(self):
"""
Returns the approximate maximum flexural wavelength
This is important when padding of the grid is required: in Flexure (this
code), grids are padded out to one maximum flexural wavelength, but in any
case, the flexural wavelength is a good character... | python | Returns the approximate maximum flexural wavelength
This is important when padding of the grid is required: in Flexure (this
code), grids are padded out to one maximum flexural wavelength, but in any
case, the flexural wavelength is a good characteristic distance for any
truncation limit | 0 | 0 | 0 | 0 |
Logging.withClusterLogging | public Logging withClusterLogging(LogSetup... clusterLogging) {
if (this.clusterLogging == null) {
setClusterLogging(new java.util.ArrayList<LogSetup>(clusterLogging.length));
}
for (LogSetup ele : clusterLogging) {
this.clusterLogging.add(ele);
}
return t... | java | <p>
The cluster control plane logging configuration for your cluster.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setClusterLogging(java.util.Collection)} or {@link #withClusterLogging(java.util.Collection)} if you want
to override the existing values.
</p>
@param cl... | 0 | 0 | 0 | 0 |
SoftHashMap.clear | @Override
@SuppressWarnings ("unchecked")
public final synchronized void clear () {
strongReferenceArray = (V[]) new Object[strongReferenceCount];
processQueue();
internalMap.clear();
} | java | {@inheritDoc} | 0 | 0 | 0 | 0 |
OPFChecks.checkService | @SuppressWarnings("PMD.PreserveStackTrace")
public static void checkService(@NonNull final Context context,
@NonNull final ComponentName service) {
final PackageManager packageManager = context.getPackageManager();
try {
packageManager.getServiceInfo(s... | java | Checks is a service has been described in the AndroidManifest.xml file.
@param context The instance of {@link android.content.Context}.
@param service The checked service. | 0 | 0 | 0 | 0 |
FluentWebElement.clearField | public FluentWebElement clearField() {
Context ctx = Context.singular(context, "clearField");
executeAndWrapReThrowIfNeeded(setCurrentElement(new Clear()), ctx, true);
return new FluentWebElement(delegate, currentElement, ctx, monitor, booleanInsteadOfNotFoundException);
} | java | Use this instead of clear() to clear an WebElement | 0 | 0 | 0 | 0 |
BNFHeadersImpl.setHeaderChangeLimit | public void setHeaderChangeLimit(int limit) {
this.headerChangeLimit = limit;
this.bOverChangeLimit = false;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Setting header change limit to " + limit);
}
} | java | Set the limit on the number of allowed header changes before this message
must be remarshalled.
@param limit | 0 | 0 | 0 | 0 |
AbstractQueryPageHandler.renderComments | protected void renderComments(PageRequestContext requestContext, QueryPage queryPage, QueryReply queryReply, boolean commentable, boolean viewDiscussion) {
Query query = queryPage.getQuerySection().getQuery();
Panel panel = ResourceUtils.getResourcePanel(query);
RequiredQueryFragment queryFragment = ne... | java | Renders comment list and comment editor
@param requestContext request context
@param queryPage query page
@param queryReply query reply
@param commentable whether to render comment editor
@param viewDiscussion whether to render comment list | 0 | 0 | 0 | 0 |
ArtifactResource.getGavcs | @GET
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON})
@Path(ServerAPI.GET_GAVCS)
public Response getGavcs(@Context final UriInfo uriInfo){
LOG.info("Got a get GAVCs request");
final ListView view = new ListView("GAVCS view", "gavc");
final FiltersHolder filters = new Filt... | java | Return a list of gavc, stored in Grapes, regarding the filters passed in the query parameters.
This method is call via GET <grapes_url>/artifact/gavcs
@return Response A list (in HTML or JSON) of gavc | 0 | 0 | 0 | 0 |
QueryBuilder.array | def array(self):
"""Get all resources and return the result as an array
Returns:
array of str: Array of resources
"""
url = "{}/{}".format(__endpoint__, self.type.RESOURCE)
return RestClient.get(url, self.params)[self.type.RESOURCE] | python | Get all resources and return the result as an array
Returns:
array of str: Array of resources | 0 | 0 | 0 | 0 |
ResourceUtils.addFiles | public static void addFiles(final Project findBugsProject, File clzDir, final Pattern pat) {
if (clzDir.isDirectory()) {
clzDir.listFiles(new FileCollector(pat, findBugsProject));
}
} | java | recurse add all the files matching given name pattern inside the given
directory and all subdirectories | 0 | 0 | 0 | 0 |
TransmuteFunction.get_swagger_operation | def get_swagger_operation(self, context=default_context):
"""
get the swagger_schema operation representation.
"""
consumes = produces = context.contenttype_serializers.keys()
parameters = get_swagger_parameters(self.parameters, context)
responses = {
"400": R... | python | get the swagger_schema operation representation. | 0 | 0 | 0 | 0 |
AndExpressionImpl.eUnset | @Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SimpleAntlrPackage.AND_EXPRESSION__LEFT:
setLeft((Expression)null);
return;
case SimpleAntlrPackage.AND_EXPRESSION__RIGHT:
setRight((Expression)null);
return;
}
super.eUnset(featureID)... | java | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | 0 | 0 | 0 | 0 |
Client.put_settings | def put_settings(self, sensors=[], actuators=[], auth_token=None,
endpoint=None, blink=None, discovery=None,
dht_sensors=[], ds18b20_sensors=[]):
""" Sync settings to the Konnected device """
url = self.base_url + '/settings'
payload = {
"se... | python | Sync settings to the Konnected device | 0 | 0 | 0 | 0 |
UriBuilder.fromPath | public static UriBuilder fromPath(String path) {
if (path == null)
throw new IllegalArgumentException("Path cannot be null");
final UriBuilder builder = newInstance();
builder.path(path);
return builder;
} | java | Create a new instance representing a relative URI initialized from a URI path.
@param path a URI path that will be used to initialize the UriBuilder, may contain URI template parameters.
@return a new UriBuilder
@throws IllegalArgumentException if path is null | 0 | 0 | 0 | 0 |
ResourceUtil.toResourceNotExisting | public static Resource toResourceNotExisting(PageContext pc, String destination) {
return toResourceNotExisting(pc, destination, pc.getConfig().allowRealPath(), false);
} | java | cast a String (argument destination) to a File Object, if destination is not a absolute, file
object will be relative to current position (get from PageContext) existing file is preferred but
dont must exist
@param pc Page Context to the current position in filesystem
@param destination relative or absolute path for f... | 0 | 0 | 0 | 0 |
Board.canMove | def canMove(self):
"""
test if a move is possible
"""
if not self.filled():
return True
for y in self.__size_range:
for x in self.__size_range:
c = self.getCell(x, y)
if (x < self.__size-1 and c == self.getCell(x+1, y)) \
... | python | test if a move is possible | 0 | 0 | 0 | 0 |
handle_block | def handle_block(
initiator_state: InitiatorTransferState,
state_change: Block,
channel_state: NettingChannelState,
pseudo_random_generator: random.Random,
) -> TransitionResult[InitiatorTransferState]:
""" Checks if the lock has expired, and if it has sends a remove expired
lock... | python | Checks if the lock has expired, and if it has sends a remove expired
lock and emits the failing events. | 0 | 0 | 0 | 0 |
JSchema.findChildByIndex | private JMFType findChildByIndex(JMFType start, int index) {
if (index < 0)
return null;
if (start instanceof JSVariant) {
JSVariant var = (JSVariant)start;
int cases = var.getCaseCount();
if (index >= cases)
return null;
else
return getEffectiveType(var.getCase(ind... | java | variant | 0 | 0 | 0 | 0 |
DotNetDomain.resolve_any_xref | def resolve_any_xref(self, env, fromdocname, builder, target,
node, contnode):
"""Look for any references, without object type
This always searches in "refspecific" mode
"""
prefix = node.get('dn:prefix')
results = []
match = self.find_obj(env, ... | python | Look for any references, without object type
This always searches in "refspecific" mode | 0 | 0 | 0 | 0 |
PandocAttributes.to_dict | def to_dict(self):
"""Returns attributes formatted as a dictionary."""
d = {'id': self.id, 'classes': self.classes}
d.update(self.kvs)
return d | python | Returns attributes formatted as a dictionary. | 0 | 0 | 0 | 0 |
RemoteTaskRunner.runPendingTasks | private void runPendingTasks()
{
runPendingTasksExec.submit(
new Callable<Void>()
{
@Override
public Void call()
{
try {
// make a copy of the pending tasks because tryAssignTask may delete tasks from pending and move them
// in... | java | This method uses a multi-threaded executor to extract all pending tasks and attempt to run them. Any tasks that
are successfully assigned to a worker will be moved from pendingTasks to runningTasks. This method is thread-safe.
This method should be run each time there is new worker capacity or if new tasks are assigned... | 0 | 0 | 0 | 0 |
dropdb | def dropdb(force=False):
"""Drop DATABASES['default']"""
if force:
logger.info(
"Terminating any other connections to %s on %s",
repr(DB["NAME"]),
repr(DB["HOST"]),
)
kill_other_psql_sessions()
logger.info("Dropping database %s", repr(DB["NAME"])... | python | Drop DATABASES['default'] | 0 | 0 | 0 | 0 |
DTMDocumentImpl.appendChild | public void appendChild(int newChild, boolean clone, boolean cloneDepth) {
boolean sameDoc = ((newChild & DOCHANDLE_MASK) == m_docHandle);
if (clone || !sameDoc) {
} else {
}
} | java | Append a child to the end of the child list of the current node. Please note that the node
is always cloned if it is owned by another document.
<p>%REVIEW% "End of the document" needs to be defined more clearly.
Does it become the last child of the Document? Of the root element?</p>
@param newChild Must be a valid ne... | 0 | 0 | 0 | 0 |
PythonFile.line_range | def line_range(self, line_number):
"""Return a slice for the given line number"""
if line_number <= 0 or line_number > len(self.lines):
raise IndexError('NOTE: Python file line numbers are offset by 1.')
if line_number not in self.logical_lines:
return slice(line_number, line_number + 1)
el... | python | Return a slice for the given line number | 0 | 0 | 0 | 0 |
InternalSimpleAntlrParser.ruleParameter | public final EObject ruleParameter() throws RecognitionException {
EObject current = null;
Token lv_type_0_0=null;
Token lv_name_1_0=null;
enterRule();
try {
// InternalSimpleAntlr.g:457:28: ( ( ( (lv_type_0_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) ... | java | InternalSimpleAntlr.g:454:1: ruleParameter returns [EObject current=null] : ( ( (lv_type_0_0= RULE_ID ) ) ( (lv_name_1_0= RULE_ID ) ) ) ; | 0 | 0 | 0 | 0 |
RocketChatAPI.get_private_rooms | def get_private_rooms(self, **kwargs):
"""
Get a listing of all private rooms with their names and IDs
"""
return GetPrivateRooms(settings=self.settings, **kwargs).call(**kwargs) | python | Get a listing of all private rooms with their names and IDs | 0 | 0 | 0 | 0 |
ThreadPool.enqueue | def enqueue(self, future):
"""
Enqueue a future to be processed by one of the threads in the pool.
The future must be bound to a worker and not have been started yet.
"""
future.enqueue()
with self._lock:
if self._shutdown:
raise RuntimeError('ThreadPool has been shut down and can... | python | Enqueue a future to be processed by one of the threads in the pool.
The future must be bound to a worker and not have been started yet. | 0 | 0 | 0 | 0 |
Bits.toStore | public static BitStore toStore(int size, Random random, float probability) {
return preferredType.random(size, random, probability);
} | java | Creates a mutable {@link BitStore} initialized with random bit values.
@param size
the capacity, in bits, of the new {@link BitStore}
@param random
a source of randomness
@param probability
a number between 0 and 1 inclusive, being the independent
probability that a bit is set
@return a new mutable {@link BitStore} in... | 0 | 0 | 0 | 0 |
ClearFuncs.runner | def runner(self, clear_load):
'''
Send a master control function back to the runner system
'''
# All runner ops pass through eauth
auth_type, err_name, key, sensitive_load_keys = self._prep_auth_info(clear_load)
# Authenticate
auth_check = self.loadauth.check_aut... | python | Send a master control function back to the runner system | 0 | 0 | 0 | 0 |
CompanyLinkType.readValue | @Override
public Object readValue(final Attribute _attribute,
final List<Object> _objectList)
throws EFapsException
{
Object ret = null;
if (CollectionUtils.isNotEmpty(_objectList)) {
final Object obj = _objectList.get(0);
if (obj != nu... | java | {@inheritDoc} | 0 | 0 | 0 | 0 |
EntityToObjectConverter.setLongProperty | private <T> void setLongProperty(T object, Field field, Object value) throws IllegalAccessException {
field.set(object, ((Number) value).longValue());
} | java | override | 0 | 0 | 0 | 0 |
Signal.send | async def send(self, sender, **kwargs):
''' send a signal from the sender to all connected receivers '''
if not self.receivers:
return []
responses = []
futures = []
for receiver in self._get_receivers(sender):
method = receiver()
if callable(m... | python | send a signal from the sender to all connected receivers | 0 | 0 | 0 | 0 |
IterableExtensions.fold | public static <T, R> R fold(Iterable<T> iterable, R seed, Function2<? super R, ? super T, ? extends R> function) {
return IteratorExtensions.fold(iterable.iterator(), seed, function);
} | java | <p>
Applies the combinator {@code function} to all elements of the iterable in turn and uses {@code seed} as the
start value.
</p>
<p>
One of the function parameters is an element of the iterable, and the other is the result of previous application
of the function. The seed of the operation is explicitly passed to
{@li... | 0 | 0 | 0 | 0 |
create_document_batches | def create_document_batches(jsonlines, id_field, max_batch_size=CLOUDSEARCH_MAX_BATCH_SIZE):
"""Create batches in expected AWS Cloudsearch format, limiting the
byte size per batch according to given max_batch_size
See: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html
"""... | python | Create batches in expected AWS Cloudsearch format, limiting the
byte size per batch according to given max_batch_size
See: http://docs.aws.amazon.com/cloudsearch/latest/developerguide/preparing-data.html | 0 | 0 | 0 | 0 |
CrowdModel.predict_files | def predict_files(self, files):
'''
reads files off disk, resizes them
and then predicts them, files should
be a list or itrerable of file paths
that lead to images, they are then
loaded with opencv, resized, and predicted
'''
imgs = [0]*len(files)
... | python | reads files off disk, resizes them
and then predicts them, files should
be a list or itrerable of file paths
that lead to images, they are then
loaded with opencv, resized, and predicted | 0 | 0 | 0 | 0 |
ImplicitDenyMarshaller.marshall | public void marshall(ImplicitDeny implicitDeny, ProtocolMarshaller protocolMarshaller) {
if (implicitDeny == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(implicitDeny.getPolicies(), POLICIES_BINDIN... | java | Marshall the given parameter object. | 0 | 0 | 0 | 0 |
Authenticator.blockingIssueAuthorizationCode | public String blockingIssueAuthorizationCode(HttpRequest req) throws OAuthException {
AuthRequest authRequest = new AuthRequest(req);
LOG.info("received client_id:" + authRequest.getClientId());
if (!isActiveClientId(authRequest.getClientId()).blockingGet()) {
throw new OAuthExceptio... | java | /authorize?response_type=code&client_id=s6BhdRkqt3&state=xyz&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb | 0 | 0 | 0 | 0 |
rl_cleanspaces | def rl_cleanspaces(x):
"""
Clean double spaces, trailing spaces, heading spaces,
spaces before punctuations
"""
patterns = (
# arguments for re.sub: pattern and repl
# удаляем пробел перед знаками препинания
(r' +([\.,?!\)]+)', r'\1'),
# добавляем пробел после знака п... | python | Clean double spaces, trailing spaces, heading spaces,
spaces before punctuations | 0 | 0 | 0 | 0 |
ifposition | def ifposition(parser, token):
"""
Syntax::
{% ifposition POSITION_NAME ... for CATEGORY [nofallback] %}
{% else %}
{% endifposition %}
"""
bits = list(token.split_contents())
end_tag = 'end' + bits[0]
nofallback = False
if bits[-1] == 'nofallback':
nofallb... | python | Syntax::
{% ifposition POSITION_NAME ... for CATEGORY [nofallback] %}
{% else %}
{% endifposition %} | 0 | 0 | 0 | 0 |
TLVWithSubType.value | def value(self):
"""Return sub type and sub value as binary data.
Returns:
:class:`~pyof.foundation.basic_types.BinaryData`:
BinaryData calculated.
"""
binary = UBInt8(self.sub_type).pack() + self.sub_value.pack()
return BinaryData(binary) | python | Return sub type and sub value as binary data.
Returns:
:class:`~pyof.foundation.basic_types.BinaryData`:
BinaryData calculated. | 0 | 0 | 0 | 0 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 6