language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public String getJSONMessages() {
StringBuilder builder = new StringBuilder();
builder.append("{");
boolean first = true;
Enumeration<String> keys = this.bundle.getKeys();
while (keys.hasMoreElements()) {
if (!first)
builder.append(",");
else
first = false;
String key = keys.nextElement();... |
python | def _one_cycle_mult(areg, breg, rem_bits, sum_sf=0, curr_bit=0):
""" returns a WireVector sum of rem_bits multiplies (in one clock cycle)
note: this method requires a lot of area because of the indexing in the else statement """
if rem_bits == 0:
return sum_sf
else:
a_curr_val = areg[cur... |
java | private <T> boolean handleProcessEntry(FlowletProcessEntry<T> entry,
BlockingQueue<FlowletProcessEntry<?>> processQueue) {
if (!entry.shouldProcess()) {
return false;
}
ProcessMethod<T> processMethod = entry.getProcessSpec().getProcessMethod();
if (processMet... |
java | private static final void cpy(long10 out, long10 in) {
out._0=in._0; out._1=in._1;
out._2=in._2; out._3=in._3;
out._4=in._4; out._5=in._5;
out._6=in._6; out._7=in._7;
out._8=in._8; out._9=in._9;
} |
python | def get_flat_models_from_model(model: Type['main.BaseModel']) -> Set[Type['main.BaseModel']]:
"""
Take a single ``model`` and generate a set with itself and all the sub-models in the tree. I.e. if you pass
model ``Foo`` (subclass of Pydantic ``BaseModel``) as ``model``, and it has a field of type ``Bar`` (a... |
python | def _make_links_absolute(html, base_url):
"""
Make all links absolute.
"""
url_changes = []
soup = BeautifulSoup(html)
for tag in soup.find_all('a', href=True):
old = tag['href']
fixed = urljoin(base_url, old)
if old != fixed:
url_changes.append((old, fixed))... |
java | @SuppressWarnings("unchecked")
@Override
public EList<Long> getListPositions() {
return (EList<Long>) eGet(Ifc4Package.Literals.IFC_REFERENCE__LIST_POSITIONS, true);
} |
python | def pdist_squareformed_numpy(a):
"""
Compute spatial distance using pure numpy
(similar to scipy.spatial.distance.cdist())
Thanks to Divakar Roy (@droyed) at stackoverflow.com
Note this needs at least np.float64 precision!
Returns: dist
"""
a = np.array(a, dtype=np.float64)
a_sumr... |
python | def cmdline_split(s: str, platform: Union[int, str] = 'this') -> List[str]:
"""
As per
https://stackoverflow.com/questions/33560364/python-windows-parsing-command-lines-with-shlex.
Multi-platform variant of ``shlex.split()`` for command-line splitting.
For use with ``subprocess``, for ``argv`` inje... |
java | public static void setLocalVar(ExecutionContext context, String name, Object value) {
LexicalEnvironment localEnv = context.getLexicalEnvironment();
localEnv.getRecord().createMutableBinding(context, name, false);
localEnv.getRecord().setMutableBinding(context, name, value, false);
} |
python | def restart(name, path=None, lxc_config=None, force=False):
'''
.. versionadded:: 2015.5.0
Restart the named container. If the container was not running, the
container will merely be started.
name
The name of the container
path
path to the container parent directory
de... |
python | def _update_services_instant_gratification(sdp_target_state: str):
"""For demonstration purposes only.
This instantly updates the services current state with the
target state, rather than wait on them or schedule random delays
in bringing them back up.
"""
service_states = get_service_state_lis... |
python | def replace_variable(self, variable):
"""Substitute variables with numeric values"""
if variable == 'x':
return self.value
if variable == 't':
return self.timedelta
raise ValueError("Invalid variable %s", variable) |
java | public final void setType(final NotifyType type) {
setType((type != null) ? type.getCssName() : NotifyType.INFO.getCssName());
} |
java | protected CmsObject getCmsObject(CmsCmisCallContext context) {
try {
if (context.getUsername() == null) {
// user name can be null
CmsObject cms = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());
cms.getRequestContext().setCurren... |
java | public boolean put(DeliveryDelayableReference deliveryDelayableReference)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "put", "ObjId=" + deliveryDelayableReference.getID() + " ET=" + deliveryDelayableReference.getDeliveryDelayTime());
boolean ... |
python | def threeD_gridplot(nodes, **kwargs):
"""Plot in a series of grid points in 3D.
:type nodes: list
:param nodes: List of tuples of the form (lat, long, depth)
:returns: :class:`matplotlib.figure.Figure`
.. rubric:: Example
>>> from eqcorrscan.utils.plotting import threeD_gridplot
>>> node... |
java | public static InputSource newInputSource(Reader reader, String systemId) {
InputSource source = new InputSource(reader);
source.setSystemId(wrapSystemId(systemId));
return source;
} |
java | public static Page getInstance(String className) throws TechnicalException {
try {
return (Page) NoraUiInjector.getNoraUiInjectorSource().getInstance(Class.forName(pagesPackage + className));
} catch (final ClassNotFoundException e) {
throw new TechnicalException(Messages.for... |
python | def ac3(space):
"""
AC-3 algorithm. This reduces the domains of the variables by
propagating constraints to ensure arc consistency.
:param Space space: The space to reduce
"""
#determine arcs
arcs = {}
for name in space.variables:
arcs[name] = set([])
for const in space.cons... |
java | public void wrap(
final FileChannel fileChannel, final FileChannel.MapMode mapMode, final long offset, final long length)
{
unmap();
this.fileChannel = fileChannel;
this.mapMode = mapMode;
map(offset, length);
} |
python | def predict_percentile(self, X, ancillary_X=None, p=0.5):
"""
Returns the median lifetimes for the individuals, by default. If the survival curve of an
individual does not cross 0.5, then the result is infinity.
http://stats.stackexchange.com/questions/102986/percentile-loss-functions
... |
java | @Override
public boolean isDateAllowed(LocalDate date) {
if ((firstAllowedDate != null) && (date.isBefore(firstAllowedDate))) {
return false;
}
if ((lastAllowedDate != null) && (date.isAfter(lastAllowedDate))) {
return false;
}
return true;
} |
java | private String findAtomLink(final Element parent, final String rel) {
String ret = null;
final List<Element> linksList = parent.getChildren("link", ATOM_10_NS);
if (linksList != null) {
for (final Element element : linksList) {
final Element link = element;
... |
python | def uninstall(pkg, dir=None, runas=None, env=None):
'''
Uninstall an NPM package.
If no directory is specified, the package will be uninstalled globally.
pkg
A package name in any format accepted by NPM
dir
The target directory from which to uninstall the package, or None for
... |
python | def setTableType(self, tableType, autoRefresh=True):
"""
Sets the table type associated with this edit.
:param tableType | <subclass of orb.Table>
"""
self.uiRecordTREE.setTableType(tableType)
self._queryWidget.setTableType(tableType)
... |
python | def _check_not_tuple_of_2_elements(obj, obj_name='obj'):
"""Check object is not tuple or does not have 2 elements."""
if not isinstance(obj, tuple) or len(obj) != 2:
raise TypeError('%s must be a tuple of 2 elements.' % obj_name) |
java | public static String notContain(String textToSearch, String substring) throws IllegalArgumentException {
return notContain(textToSearch, substring, "[Assertion failed] - this String argument must not contain the substring [{}]", substring);
} |
java | public void subscribe (DObjectManager omgr)
{
if (_active) {
log.warning("Active safesub asked to resubscribe " + this + ".", new Exception());
return;
}
// note that we are now again in the "wishing to be subscribed" state
_active = true;
// make su... |
java | void genTry(JCTree body, List<JCCatch> catchers, Env<GenContext> env) {
int limit = code.nextreg;
int startpc = code.curCP();
Code.State stateTry = code.state.dup();
genStat(body, env, CRT_BLOCK);
int endpc = code.curCP();
boolean hasFinalizer =
... |
java | private static String calculateStringToSignV0(Map<String, String> parameters) {
StringBuilder data = new StringBuilder();
data.append(parameters.get("Action")).append(parameters.get("Timestamp"));
return data.toString();
} |
python | def _match_elements(dom, matches):
"""
Find location of elements matching patterns specified in `matches`.
Args:
dom (obj): HTMLElement DOM tree.
matches (dict): Structure: ``{"var": {"data": "match", ..}, ..}``.
Returns:
dict: Structure: ``{"var": {"data": HTMLElement_obj, ..}... |
java | @SuppressWarnings("unchecked")
public static <E> Class<E> resolveType(Class<E> type, Schema schema) {
if (type == Object.class) {
type = ReflectData.get().getClass(schema);
}
if (type == null) {
type = (Class<E>) GenericData.Record.class;
}
return type;
} |
java | @Check
public void checkAssertKeywordUse(SarlAssertExpression expression) {
final XExpression condition = expression.getCondition();
if (condition != null) {
final LightweightTypeReference fromType = getActualType(condition);
if (!fromType.isAssignableFrom(Boolean.TYPE)) {
error(MessageFormat.format(
... |
java | @Override
public boolean hasNext() {
try {
return hasNextThrow();
} catch (SQLException e) {
last = null;
closeQuietly();
// unfortunately, can't propagate back the SQLException
throw new IllegalStateException("Errors getting more results of " + dataClass, e);
}
} |
python | def get_averaged_bias_matrix(bias_sequences, dtrajs, nstates=None):
r"""
Computes a bias matrix via an exponential average of the observed frame wise bias energies.
Parameters
----------
bias_sequences : list of numpy.ndarray(T_i, num_therm_states)
A single reduced bias energy trajectory or... |
java | @SuppressWarnings("unchecked")
<T> ICompletableFuture<Map<Integer, T>> invokeAsync() {
assert !invoked : "already invoked";
invoked = true;
ensureNotCallingFromPartitionOperationThread();
invokeOnAllPartitions();
return future;
} |
java | private String replaceVariablesInMacroStep(Matcher macroMatcher, String action) {
for (Map.Entry<String, Integer> e : variableToGroupNumber.entrySet()) {
action = action.replace(e.getKey(), "<$" + e.getValue() + ">");
}
return action;
} |
python | def p_word_list(p):
'''word_list : WORD
| word_list WORD'''
parserobj = p.context
if len(p) == 2:
p[0] = [_expandword(parserobj, p.slice[1])]
else:
p[0] = p[1]
p[0].append(_expandword(parserobj, p.slice[2])) |
python | def _lderiv(self,l,n):
"""
NAME:
_lderiv
PURPOSE:
evaluate the derivative w.r.t. lambda for this potential
INPUT:
l - prolate spheroidal coordinate lambda
n - prolate spheroidal coordinate nu
OUTPUT:
derivative w.r.t. la... |
java | private int readStringRecordValue(DBaseFileField field, int nrecord, int nfield, byte[] rawData,
int rawOffset, OutputParameter<String> value) throws IOException {
final byte[] recordData = new byte[field.getLength()];
System.arraycopy(rawData, rawOffset, recordData, 0, recordData.length);
String data;
if (... |
java | @Override
public void execute() throws MojoExecutionException, MojoFailureException
{
ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
try
{
SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(ValidatorMojo.class));
Validation.validat... |
python | def preprocess(core, dim, shape, dtype):
"""Constructor function for the Poly class."""
core, dim_, shape_, dtype_ = chaospy.poly.constructor.identify_core(core)
core, shape = chaospy.poly.constructor.ensure_shape(core, shape, shape_)
core, dtype = chaospy.poly.constructor.ensure_dtype(core, dtype, dty... |
python | def from_wif_or_ewif_file(path: str, password: Optional[str] = None) -> SigningKeyType:
"""
Return SigningKey instance from Duniter WIF or EWIF file
:param path: Path to WIF of EWIF file
:param password: Password needed for EWIF file
"""
with open(path, 'r') as fh:
... |
java | public FKeyModel getFkey(String fkeyName) {
if (fkeyConstraints == null)
return null;
for (FKeyModel fkey : fkeyConstraints)
if (!StrUtils.isEmpty(fkeyName) && fkeyName.equalsIgnoreCase(fkey.getFkeyName()))
return fkey;
return null;
} |
python | def _calc_stats(self):
"""
Calculate performance statistics after the two sets of annotations
are compared.
Example:
-------------------
ref=500 test=480
{ 30 { 470 } 10 }
-------------------
tp = 470
fp = 10
fn = 30
... |
java | public void addAuthInfo(final String scheme, final byte[] auth) {
retryUntilConnected(new Callable<Object>() {
@Override
public Object call() throws Exception {
_connection.addAuthInfo(scheme, auth);
return null;
}
});
} |
java | private static void endZoneProps(Writer writer, boolean isDst) throws IOException{
// END:STANDARD or END:DAYLIGHT
writer.write(ICAL_END);
writer.write(COLON);
if (isDst) {
writer.write(ICAL_DAYLIGHT);
} else {
writer.write(ICAL_STANDARD);
}
... |
python | def _evalDayStr(self, datetimeString, sourceTime):
"""
Evaluate text passed by L{_partialParseDaystr()}
"""
s = datetimeString.strip()
sourceTime = self._evalDT(datetimeString, sourceTime)
# Given string is a natural language date string like today, tomorrow..
(y... |
java | public DevCmdInfo_2 command_query_2(final String command) throws DevFailed, SystemException {
Util.out4.println("Device_2Impl.command_query_2(" + command + ") arrived");
// Retrieve number of command and allocate memory to send back info
final int nb_cmd = device_class.get_command_list().size();
Util.out4.println(... |
java | public alluxio.grpc.RunPOptionsOrBuilder getOptionsOrBuilder() {
return options_ == null ? alluxio.grpc.RunPOptions.getDefaultInstance() : options_;
} |
python | def deregister(cls, name: str) -> None:
"""Deregisters a registered connection plugin by its name
Args:
name: name of the connection plugin to deregister
Raises:
:obj:`nornir.core.exceptions.ConnectionPluginNotRegistered`
"""
if name not in cls.available... |
python | def VerifyStructure(self, parser_mediator, line):
"""Verify that this file is an IIS log file.
Args:
parser_mediator (ParserMediator): mediates interactions between
parsers and other components, such as storage and dfvfs.
line (str): line from a text file.
Returns:
bool: True i... |
python | def infos_on_basis_set(self):
"""
infos on the basis set as in Fiesta log
"""
o = []
o.append("=========================================")
o.append("Reading basis set:")
o.append("")
o.append(" Basis set for {} atom ".format(str(self.filename)))
o.... |
java | public java.util.List<GlobalClusterMember> getGlobalClusterMembers() {
if (globalClusterMembers == null) {
globalClusterMembers = new com.amazonaws.internal.SdkInternalList<GlobalClusterMember>();
}
return globalClusterMembers;
} |
java | public static float bigram(List<Word> words){
if(words.size() > 1){
float score=0;
for(int i=0; i<words.size()-1; i++){
score += getScore(words.get(i).getText(), words.get(i+1).getText());
}
return score;
}
return 0;
} |
python | def get_or_create(self, **kwargs):
"""
Looks up an object with the given kwargs, creating one if necessary.
Returns a tuple of (object, created), where created is a boolean
specifying whether an object was created.
"""
assert kwargs, \
'get_or_create() must be... |
python | def sndrcv(pks, pkt, timeout=None, inter=0, verbose=None, chainCC=False,
retry=0, multi=False, rcv_pks=None, store_unanswered=True,
process=None, prebuild=False):
"""Scapy raw function to send a packet and receive its answer.
WARNING: This is an internal function. Using sr/srp/sr1/srp is
... |
java | protected DoubleMatrix1D findEqFeasiblePoint2(DoubleMatrix2D AMatrix, DoubleMatrix1D bVector) throws Exception {
int p = AMatrix.rows();
int m = AMatrix.columns();
if(m <= p){
LogFactory.getLog(this.getClass().getName()).error("Equalities matrix A must be pxn with rank(A) = p < n");
throw new Runti... |
python | def set_speed(self, aspirate=None, dispense=None):
"""
Set the speed (mm/second) the :any:`Pipette` plunger will move
during :meth:`aspirate` and :meth:`dispense`
Parameters
----------
aspirate: int
The speed in millimeters-per-second, at which the plunger wi... |
python | def add_user_grant(self, permission, user_id, recursive=False,
headers=None, display_name=None):
"""
Convenience method that provides a quick way to add a canonical
user grant to a bucket. This method retrieves the current ACL,
creates a new grant based on the par... |
python | def _collectAsArrow(self):
"""
Returns all records as a list of ArrowRecordBatches, pyarrow must be installed
and available on driver and worker Python environments.
.. note:: Experimental.
"""
with SCCallSiteSync(self._sc) as css:
sock_info = self._jdf.colle... |
java | @Override
public boolean stopCellEditing() {
JFormattedTextField ftf = (JFormattedTextField) getComponent();
if (ftf.isEditValid()) {
try {
ftf.commitEdit();
} catch (java.text.ParseException ex) {
}
} else { //text is invalid
... |
python | def _merge_configuration(self, parent_config, child_options):
"""Merge parent config into the child options.
The migration process requires an `options` object for the child in
order to distinguish between mutually exclusive codes, add-select and
add-ignore error codes.
"""
... |
python | def sexa2deci(sign, hd, mm, ss, todeg=False):
"""Combine sexagesimal components into a decimal number.
Parameters
----------
sign : int
Sign of the number: 1 for +ve, -1 for negative.
hd : float
The hour or degree like part.
mm : float
The minute or arc-minute like part.... |
java | private static CloudErrorType toCloudErrorType(String code) {
if ("Throttling".equals(code)) {
return CloudErrorType.THROTTLING;
} else if ("TooManyBuckets".equals(code)) {
return CloudErrorType.QUOTA;
} else if ("SignatureDoesNotMatch".equals(code)) {
return ... |
java | public void remove(Object data, int iOpenMode) throws DBException, RemoteException
{
this.checkCurrentCacheIsPhysical(null);
m_tableRemote.remove(data, iOpenMode);
if (m_objCurrentCacheRecord != null)
{
if (m_mapCache != null)
m_mapCache.set(((Integer)m_ob... |
python | def populate_model(model_or_inst, excludes=None, only=None):
"""
Call `make_request_parser()` to build a `RequestParser`, use it extract user request data,
and padding the data into model instance.
If user passed a model class, instead of model instance, create a new instance use the extracted data.
... |
java | @Override
public java.util.concurrent.Future<TagQueueResult> tagQueueAsync(String queueUrl, java.util.Map<String, String> tags) {
return tagQueueAsync(new TagQueueRequest().withQueueUrl(queueUrl).withTags(tags));
} |
python | def safe_send(self, connection, target, message, *args, **kwargs):
"""
Safely sends a message to the given target
"""
# Compute maximum length of payload
prefix = "PRIVMSG {0} :".format(target)
max_len = 510 - len(prefix)
for chunk in chunks(message.format(*args,... |
java | @Override
public void initialize(ExtensionContext context) {
ROOT_LOGGER.debug("Initializing Deployment Scanner Extension");
if (context.getProcessType().isHostController()) {
throw DeploymentScannerLogger.ROOT_LOGGER.deploymentScannerNotForDomainMode();
}
final Subsyst... |
python | def is_all_field_none(self):
"""
:rtype: bool
"""
if self._BunqMeFundraiserResult is not None:
return False
if self._BunqMeTab is not None:
return False
if self._BunqMeTabResultInquiry is not None:
return False
if self._Bunq... |
java | public byte []
readByteArray(int len) throws WireParseException {
require(len);
byte [] out = new byte[len];
byteBuffer.get(out, 0, len);
return out;
} |
java | public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, java.io.IOException
{
if (flavor.isMimeTypeEqual(OJBMETADATA_FLAVOR))
return selectedDescriptors;
else
throw new UnsupportedFlavorException(flavor);
} |
java | private long getFastLong(int columnIndex) throws SQLException, NumberFormatException {
byte[] bytes = thisRow[columnIndex - 1];
if (bytes.length == 0) {
throw FAST_NUMBER_FAILED;
}
long val = 0;
int start;
boolean neg;
if (bytes[0] == '-') {
neg = true;
start = 1;
... |
java | public SampleSetEQOracle<I, D> addAll(MembershipOracle<I, D> oracle, Collection<? extends Word<I>> words) {
if (words.isEmpty()) {
return this;
}
List<DefaultQuery<I, D>> newQueries = new ArrayList<>(words.size());
for (Word<I> w : words) {
newQueries.add(new Defa... |
java | public <RET> RET save(final Object iContent) {
return (RET) save(iContent, (String) null, OPERATION_MODE.SYNCHRONOUS, null);
} |
python | def exception(self, *args, **kwargs):
"""Defines how this API should handle the provided exceptions"""
kwargs['api'] = self.api
return exception(*args, **kwargs) |
python | def init(opts=None):
'''
Required.
Initialize device connection using ssh or nxapi connection type.
'''
global CONNECTION
if __opts__.get('proxy').get('connection') is not None:
CONNECTION = __opts__.get('proxy').get('connection')
if CONNECTION == 'ssh':
log.info('NXOS PROXY... |
java | public String getUnencodedJavaScriptHtmlCookieString(String name, String value) {
return getUnencodedJavaScriptHtmlCookieString(name, value, null);
} |
python | def source(self, format='xml', accessible=False):
"""
Args:
format (str): only 'xml' and 'json' source types are supported
accessible (bool): when set to true, format is always 'json'
"""
if accessible:
return self.http.get('/wda/accessibleSource').val... |
java | public void errorCommon(String msgCode, Object[] objects) {
if (!bInboundSupported) {
Tr.error(tcCommon, msgCode, objects);
}
} |
java | private static Type extractEntityTypeFromReturnType(HttpResponseDecodeData decodeData) {
Type token = decodeData.returnType();
if (token != null) {
if (TypeUtil.isTypeOrSubTypeOf(token, Mono.class)) {
token = TypeUtil.getTypeArgument(token);
} else if (TypeUtil.is... |
java | @EachBean(DataSource.class)
DataSourceTransactionManager dataSourceTransactionManager(
DataSource dataSource) {
DataSourceTransactionManager dataSourceTransactionManager = new DataSourceTransactionManager(dataSource);
dataSourceTransactionManager.afterPropertiesSet();
return data... |
python | def log_default(self, timestamp_from_dt=None, timestamp_to_dt=None,
limit=None, rel_filepath=None, stop_on_copy=False,
revision_from=None, revision_to=None, changelist=False,
use_merge_history=False):
"""Allow for the most-likely kind of log listing: t... |
python | def upgrade_code(self):
'''
For installers which follow the Microsoft Installer standard, returns
the ``Upgrade code``.
Returns:
value (str): ``Upgrade code`` GUID for installed software.
'''
if not self.__squid:
# Must have a valid squid for an u... |
java | public static MozuUrl deleteLocalizedContentUrl(String attributeFQN, String localeCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent/{localeCode}");
formatter.formatUrl("attributeFQN", attributeFQN);
formatter.formatUr... |
java | public final void write(Throwable e) throws IOException {
indent();
newLine();
write(e.toString());
StackTraceElement[] elements = e.getStackTrace();
for (int i = 0; i < elements.length; i++) {
newLine();
write(elements[i].toString());
}
Throwable cause = e.getCause();
if ... |
java | private void addChangeListener(JavaScriptObject changeListener, String changeScope) {
try {
System.out.println("Adding native listener for scope " + changeScope);
m_entityObserver.addEntityChangeListener(new CmsEntityChangeListenerWrapper(changeListener), changeScope);
} ca... |
java | public NumericAttribute plus(com.gs.fw.finder.attribute.NumericAttribute attribute)
{
return MappedAttributeUtil.plus(this, (NumericAttribute) attribute);
} |
python | def get_ytvideos(query, ilogger):
"""
Gets either a list of videos from a playlist or a single video, using the
first result of a YouTube search
Args:
query (str): The YouTube search query
ilogger (logging.logger): The logger to log API calls to
Returns:
queue (list): The i... |
python | def delete_label(self, lang=None):
"""Deletes all the `label` metadata properties on your Thing/Point for this language
Raises `ValueError` containing an error message if the parameters fail validation
`lang` (optional) (string) The two-character ISO 639-1 language code to identify your label.... |
python | def set_cpu_property(self, property_p, value):
"""Sets the virtual CPU boolean value of the specified property.
in property_p of type :class:`CPUPropertyType`
Property type to query.
in value of type bool
Property value.
raises :class:`OleErrorInvalidarg`
... |
java | @Override
public boolean addAll(IntSet c)
{
if (c == null || c.isEmpty() || this == c) {
return false;
}
final FastSet other = convert(c);
int wordsInCommon = Math.min(firstEmptyWord, other.firstEmptyWord);
boolean modified = false;
if (firstEmptyWord < other.firstEmptyW... |
java | @Override
public Account getAccountInfo() throws DigitalOceanException, RequestUnsuccessfulException {
return (Account) perform(new ApiRequest(ApiAction.GET_ACCOUNT_INFO)).getData();
} |
java | private int mutateColourComponent(int component)
{
int mutatedComponent = (int) Math.round(component + mutationAmount.nextValue());
mutatedComponent = Maths.restrictRange(mutatedComponent, 0, 255);
return mutatedComponent;
} |
python | def task_annotate(self, task, annotation):
""" Annotates a task. """
self._execute(
task['uuid'],
'annotate',
'--',
annotation
)
id, annotated_task = self.get_task(uuid=task[six.u('uuid')])
return annotated_task |
java | public static CompletableFuture<IMessageSession> acceptSessionFromConnectionStringAsync(String amqpConnectionString, String sessionId, ReceiveMode receiveMode) {
Utils.assertNonNull("amqpConnectionString", amqpConnectionString);
return acceptSessionFromConnectionStringBuilderAsync(new ConnectionStringBu... |
python | def get(name, *default):
# type: (str, Any) -> Any
""" Get config value with the given name and optional default.
Args:
name (str):
The name of the config value.
*default (Any):
If given and the key doesn't not exist, this will be returned
instead. If it'... |
python | def getList(self, listtype):
'''
listtype must be a Zooborg constant
'''
if listtype not in [ZooConst.CLIENT, ZooConst.WORKER, ZooConst.BROKER]:
raise Exception('Zooborg.getList: invalid type')
self.initconn()
return self.zk.get_children('/distark/' + listtype... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.