language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def extra_info(self):
"""Retrieve the log string generated when opening the file."""
info = _ffi.new("char[]", 2**14)
_snd.sf_command(self._file, _snd.SFC_GET_LOG_INFO,
info, _ffi.sizeof(info))
return _ffi.string(info).decode('utf-8', 'replace') |
java | public static String getMD5Checksum(String str) throws IOException {
InputStream is = new ByteArrayInputStream(str.getBytes());
return getMD5Checksum(is);
} |
python | def p_statement_foreach(p):
'statement : FOREACH LPAREN expr AS foreach_variable foreach_optional_arg RPAREN foreach_statement'
if p[6] is None:
p[0] = ast.Foreach(p[3], None, p[5], p[8], lineno=p.lineno(1))
else:
p[0] = ast.Foreach(p[3], p[5], p[6], p[8], lineno=p.lineno(1)) |
python | def codepoint_included(self, codepoint):
"""Check if codepoint matches any of the defined codepoints."""
if self.codepoints == None:
return True
for cp in self.codepoints:
mismatch = False
for i in range(len(cp)):
if (cp[i] is not None) and (cp... |
java | private void parseAccessLog(Map<String, Object> config) {
String filename = (String) config.get("access.filePath");
if (null == filename || 0 == filename.trim().length()) {
return;
}
try {
this.ncsaLog = new AccessLogger(filename.trim());
} catch (Throwabl... |
java | public static void isTrue (@Nonnull final BooleanSupplier aValue, @Nonnull final Supplier <? extends String> aMsg)
{
if (isEnabled ())
if (!aValue.getAsBoolean ())
throw new IllegalArgumentException ("The expression must be true but it is not: " + aMsg.get ());
} |
java | @Nonnull
public static CSSExpression createString (@Nonnull @Nonempty final String sValue)
{
return new CSSExpression ().addString (sValue);
} |
python | def SLIT_DIFFRACTION(x,g):
"""
Instrumental (slit) function.
"""
y = zeros(len(x))
index_zero = x==0
index_nonzero = ~index_zero
dk_ = pi/g
x_ = dk_*x[index_nonzero]
w_ = sin(x_)
r_ = w_**2/x_**2
y[index_zero] = 1
y[index_nonzero] = r_/g
return y |
python | def to_bytes(data):
"""Takes an input str or bytes object and returns an equivalent bytes object.
:param data: Input data
:type data: str or bytes
:returns: Data normalized to bytes
:rtype: bytes
"""
if isinstance(data, six.string_types) and not isinstance(data, bytes):
return codec... |
java | protected SofaResponse doInvokeSync(SofaRequest request, int timeout) throws InterruptedException,
ExecutionException, TimeoutException {
HttpResponseFuture future = new HttpResponseFuture(request, timeout);
AbstractHttpClientHandler callback = new SyncInvokeClientHandler(transportConfig.getCons... |
java | public void exportResources(String exportFile, String pathList) throws Exception {
exportResources(exportFile, pathList, false);
} |
python | def verified_funds(pronac, dt):
"""
Responsable for detecting anomalies in projects total verified funds.
"""
dataframe = data.planilha_comprovacao
project = dataframe.loc[dataframe['PRONAC'] == pronac]
segment_id = project.iloc[0]["idSegmento"]
pronac_funds = project[
["idPlanilhaAp... |
java | public void write(EntitySet entitySet) throws XMLStreamException {
LOG.debug("Writing entity set {} of type {}", entitySet.getName(), entitySet.getTypeName());
xmlWriter.writeStartElement(ENTITY_SET);
xmlWriter.writeAttribute(NAME, entitySet.getName());
xmlWriter.writeAttribute(ENTITY_... |
python | def toggle_settings(
toolbar=False, nbname=False, hideprompt=False, kernellogo=False):
"""Toggle main notebook toolbar (e.g., buttons), filename,
and kernel logo."""
toggle = ''
if toolbar:
toggle += 'div#maintoolbar {margin-left: 8px !important;}\n'
toggle += '.toolbar.containe... |
java | @Override
public void onError(Throwable t) {
addEntry("adding an error ResultQueueEntry", ResultQueueEntry.<FlatRow> fromThrowable(t));
markerCounter.incrementAndGet();
} |
java | public void removeBundle(ExtendedBundle bundle) {
if (classResolverRegistration == null) {
throw new IllegalStateException("The service is stoped and no more bundles could be removed");
}
synchronized (bundles) {
bundles.remove(bundle.getBundle().getSymbolicName());
... |
python | def get_error(time, x, sets, err_type='block', tool='gmx analyze'):
"""To estimate error using block averaging method
.. warning::
To calculate errors by using ``error = 'acf'`` or ``error = 'block'``,
GROMACS tool ``g_analyze`` or ``gmx analyze`` should be present in ``$PATH``.
Pa... |
python | def fill_missing_info(info: dict, site_url: str = DEFAULT_SITE) -> dict:
"Add missing info in a censored post info dict."
try:
md5, ext = find_censored_md5ext(info["id"])
except TypeError: # None returned by find_..
return info
sample_ext = "jpg" if ext != "zip" else "webm"
if inf... |
python | def gen_rsd_cdf(K, delta, c):
"""The CDF of the RSD on block degree, precomputed for
sampling speed"""
mu = gen_mu(K, delta, c)
return [sum(mu[:d+1]) for d in range(K)] |
python | def _init_imu(self):
"""
Internal. Initialises the IMU sensor via RTIMU
"""
if not self._imu_init:
self._imu_init = self._imu.IMUInit()
if self._imu_init:
self._imu_poll_interval = self._imu.IMUGetPollInterval() * 0.001
# Enable ev... |
java | public static IProcessingInstructionProcessor wrap(final IProcessingInstructionProcessor processor, final IProcessorDialect dialect) {
Validate.notNull(dialect, "Dialect cannot be null");
if (processor == null) {
return null;
}
return new ProcessingInstructionProcessorWrapper... |
python | def create_supercut(composition, outputfile, padding):
"""Concatenate video clips together and output finished video file to the
output directory.
"""
print("[+] Creating clips.")
demo_supercut(composition, padding)
# add padding when necessary
for (clip, nextclip) in zip(composition, compo... |
java | public boolean setXML(String strXML)
{
Document doc = Util.convertXMLToDOM(strXML);
return this.setDOM(doc);
} |
java | private void sendListenerCall(int oldPosition, int newPosition, boolean forcedSelection) {
if (mTabSelectedListener != null) {
// && oldPosition != -1) {
if (forcedSelection) {
mTabSelectedListener.onTabSelected(newPosition);
} else {
if (ol... |
python | def extract_images(filename):
"""Extract the images into a 4D uint8 numpy array [index, y, x, depth]."""
with gzip.open(filename) as bytestream:
magic = _read32(bytestream)
if magic != 2051:
raise ValueError(
'Invalid magic number %d in MNIST image file: %s' %
... |
java | public void write4BE(final long n) {
write((byte) ((n & 0xff000000) >> 24));
write((byte) ((n & 0xff0000) >> 16));
write((byte) ((n & 0xff00) >> 8));
write((byte) (n & 0xff));
} |
java | StringBuilder fwdQuote(char q) {
StringBuilder sb = new StringBuilder();
while (hasNext()) {
next();
sb.append(buffer[pos]);
if (isCurr(q)) {
if (isNext(q)) { // consecutive quote sign
next();
}
else {
break;
}
}
}
if (sb.length() > 0) sb.setLength(sb.length() - 1); // r... |
java | private boolean typesAreCompatible(Class<?>[] paramTypes, Class<?>[] constructorParamTypes) {
boolean matches = true;
for (int i = 0; i < paramTypes.length; i++) {
Class<?> paramType = paramTypes[i];
if (paramType != null) {
Class<?> inputParamType = translateFro... |
java | public final void mSTRING_WITH_QUOTE() throws RecognitionException {
try {
int _type = STRING_WITH_QUOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:149... |
java | public ConnectionDefinitionType<OutboundResourceadapterType<T>> getOrCreateConnectionDefinition()
{
List<Node> nodeList = childNode.get("connection-definition");
if (nodeList != null && nodeList.size() > 0)
{
return new ConnectionDefinitionTypeImpl<OutboundResourceadapterType<T>>(this, "c... |
python | def dlafps(handle, descr):
"""
Find the segment preceding a specified segment in a DLA file.
https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dlafps_c.html
:param handle: Handle of open DLA file.
:type handle: c_int
:param descr: Descriptor of a segment in DLA file.
:type ... |
java | IterableOfProtosFluentAssertion<M> usingConfig(FluentEqualityConfig newConfig) {
Subject.Factory<IterableOfMessagesSubject<M>, Iterable<M>> factory =
iterableOfMessages(newConfig);
IterableOfMessagesSubject<M> newSubject = check().about(factory).that(actual());
if (internalCustomName() != null) {
... |
python | def on_send(self, frame):
"""
Add the heartbeat header to the frame when connecting, and bump
next outbound heartbeat timestamp.
:param Frame frame: the Frame object
"""
if frame.cmd == CMD_CONNECT or frame.cmd == CMD_STOMP:
if self.heartbeats != (0, 0):
... |
java | private MethodSpec generateContentValuesMethod(ObjectMappableAnnotatedClass clazz,
String mapperClassName, String className) {
ClassName typeName = ClassName.get(getPackageName(clazz), mapperClassName, className);
return MethodSpec.methodBuilder("contentValues")
.addJavadoc("Get a typesafe Conte... |
java | public <T> T queryForObject(String sql, Class<T> requiredType) throws SQLException {
return queryForObject(sql, getSingleColumnRowMapper(requiredType));
} |
python | def add(self, service, workers=1, args=None, kwargs=None):
"""Add a new service to the ServiceManager
:param service: callable that return an instance of :py:class:`Service`
:type service: callable
:param workers: number of processes/workers for this service
:type workers: int
... |
java | @SuppressWarnings("unchecked")
public EList<IfcTimeSeriesReferenceRelationship> getDocumentedBy() {
return (EList<IfcTimeSeriesReferenceRelationship>) eGet(
Ifc2x3tc1Package.Literals.IFC_TIME_SERIES__DOCUMENTED_BY, true);
} |
python | def croak(error, message_writer=message):
"""Throw an exception in the Maltego GUI containing error_msg."""
if isinstance(error, MaltegoException):
message_writer(MaltegoTransformExceptionMessage(exceptions=[error]))
else:
message_writer(MaltegoTransformExceptionMessage(exceptions=[MaltegoEx... |
java | public final int isPrefixValid(String prefix, String nsURI,
boolean isElement)
throws XMLStreamException
{
// Hmmm.... caller shouldn't really pass null.
if (nsURI == null) {
nsURI = "";
}
/* First thing is to see if specified p... |
java | public Class<? extends Throwable>[] getIgnoredExceptions()
{
IgnoredException ignoredException = method.getAnnotation( IgnoredException.class );
return ignoredException == null ? null : ignoredException.value();
} |
python | def days(start, end=None):
"""Iterate over the days between the given datetime_tzs.
Args:
start: datetime_tz to start from.
end: (Optional) Date to end at, if not given the iterator will never
terminate.
Returns:
An iterator which generates datetime_tz objects a day apart.
... |
python | def keep_absolute_resample__roc_auc(X, y, model_generator, method_name, num_fcounts=11):
""" Keep Absolute (resample)
xlabel = "Max fraction of features kept"
ylabel = "ROC AUC"
transform = "identity"
sort_order = 12
"""
return __run_measure(measures.keep_resample, X, y, model_generator, met... |
java | @Override
public void unregisterService(String serviceName, String providerId) {
boolean isOwned = false;
CachedProviderServiceInstance inst = getCachedServiceInstance(serviceName, providerId);
if(inst != null){
isOwned = true;
this.unregisterCachedServiceInstance(se... |
python | def make_otp_response(vres, client_key):
"""
Create validation response (signed, if a client key is supplied).
"""
if client_key is not None:
sig = make_signature(vres, client_key)
vres['h'] = sig
# produce "key=value" pairs from vres
pairs = [x + "=" + ''.join(vres[x]) for x in ... |
python | def _determine_termination_policies(termination_policies, termination_policies_from_pillar):
'''
helper method for present. ensure that termination_policies are set
'''
pillar_termination_policies = copy.deepcopy(
__salt__['config.option'](termination_policies_from_pillar, [])
)
if not ... |
python | def create_entry(self, group, **kwargs):
"""
Create a new Entry object.
The group which should hold the entry is needed.
image must be an unsigned int >0, group a Group.
:param group: The associated group.
:keyword title:
:keyword icon:
... |
python | def add_preceding_dict(config_entry, query_path, preceding_depth):
""" Adds the preceeding config keys to the config_entry to simulate the original full path to the config entry
:param config_entry: object, the entry that was requested and returned from the config
:param query_path: (str, list(... |
python | def datetime(self, field=None, val=None):
"""
Returns a random datetime. If 'val' is passed, a datetime within two
years of that date will be returned.
"""
if val is None:
def source():
tzinfo = get_default_timezone() if settings.USE_TZ else None
... |
java | public static String toLowerFirstChar(final String str)
{
return Character.toLowerCase(str.charAt(0)) + str.substring(1);
} |
java | public void marshall(BatchReadOperationResponse batchReadOperationResponse, ProtocolMarshaller protocolMarshaller) {
if (batchReadOperationResponse == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(b... |
python | def get_interfaces(self):
"""
Get interface details.
last_flapped is not implemented
Example Output:
{ u'Vlan1': { 'description': u'',
'is_enabled': True,
'is_up': True,
'last_flapped': -1.0,
... |
java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "groupName", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "name")
public JAXBElement<CodeType> createGroupName(CodeType value) {
return new JAXBElement<CodeType>(_GroupName_QNAME, CodeType.class, null, value... |
python | def _set_cfp(self, v, load=False):
"""
Setter method for cfp, mapped from YANG variable /brocade_interface_ext_rpc/get_media_detail/output/interface/cfp (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_cfp is considered as a private
method. Backends lookin... |
java | @Override
public DeleteTrafficPolicyResult deleteTrafficPolicy(DeleteTrafficPolicyRequest request) {
request = beforeClientExecution(request);
return executeDeleteTrafficPolicy(request);
} |
python | def list_address_scopes(self, retrieve_all=True, **_params):
"""Fetches a list of all address scopes for a project."""
return self.list('address_scopes', self.address_scopes_path,
retrieve_all, **_params) |
java | public Collection<ProposalResponse> sendTransactionProposal(TransactionProposalRequest transactionProposalRequest, Collection<Peer> peers) throws ProposalException, InvalidArgumentException {
return sendProposal(transactionProposalRequest, peers);
} |
python | def handle(self, *args, **options):
"""
Processes the converted data into the yacms database correctly.
Attributes:
yacms_user: the user to put this data in against
date_format: the format the dates are in for posts and comments
"""
yacms_user = options.... |
python | def generate_mix2pl_dataset(n, m, useDirichlet=True):
"""
Description:
Generate a mixture of 2 Plackett-Luce models dataset
and return the parameters and votes.
Parameters:
n: number of votes to generate
m: number of alternatives
useDiric... |
python | def call(self, action_name, container, instances=None, map_name=None, **kwargs):
"""
Generic function for running container actions based on a policy.
:param action_name: Action name.
:type action_name: unicode | str
:param container: Container name.
:type container: uni... |
java | public ServiceFuture<ServiceEndpointPolicyDefinitionInner> createOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName, ServiceEndpointPolicyDefinitionInner serviceEndpointPolicyDefinitions, final ServiceCallback<ServiceEndpointPolicyDefinitionInner> servic... |
python | def load(self, dtype_out_time, dtype_out_vert=False, region=False,
plot_units=False, mask_unphysical=False):
"""Load the data from the object if possible or from disk."""
msg = ("Loading data from disk for object={0}, dtype_out_time={1}, "
"dtype_out_vert={2}, and region="
... |
python | def add_eps(self, eps):
"""
Incorporate the list of EPs given by *eps*.
"""
# (nodeid, pred, label, args, lnk, surface, base)
_nodeids, _eps, _vars = self._nodeids, self._eps, self._vars
for ep in eps:
try:
if not isinstance(ep, ElementaryPredi... |
python | def __upload(self, resource, bytes):
"""Performs a single chunk upload."""
# note: string conversion required here due to open encoding bug in requests-oauthlib.
headers = {
'x-ton-expires': http_time(self.options.get('x-ton-expires', self._DEFAULT_EXPIRE)),
'content-len... |
python | def make_ujson_response(obj, status_code=200):
"""Encodes the given *obj* to json and wraps it in a response.
:return:
A Flask response.
"""
json_encoded = ujson.encode(obj, ensure_ascii=False, double_precision=-1)
resp = make_response(json_encoded)
resp.mimetype = 'application/json'
... |
java | public VaadinForHeroku withApplicationListener(final String... listeners){
checkVarArgsArguments(listeners);
this.applicationListeners.addAll(Arrays.asList(listeners));
return self();
} |
python | def array_violations(array, events, slots, beta=None):
"""Take a schedule in array form and return any violated constraints
Parameters
----------
array : np.array
a schedule in array form
events : list or tuple
of resources.Event instances
slots : list or tup... |
java | public File getCorePlatformDir() {
File platformDir = null;
File installDir = Utils.getInstallDir();
if (installDir != null) {
platformDir = new File(installDir, PLATFORM_DIR);
}
if (platformDir == null) {
throw new RuntimeException("Platform Directory n... |
java | protected <T extends DataSiftResult, A extends DataSiftResult> void unwrapFuture(FutureData<T> futureToUnwrap,
final FutureData<A>
futureRetur... |
python | def ufo_create_background_layer_for_all_glyphs(ufo_font):
# type: (defcon.Font) -> None
"""Create a background layer for all glyphs in ufo_font if not present to
reduce roundtrip differences."""
if "public.background" in ufo_font.layers:
background = ufo_font.layers["public.background"]
els... |
java | public void setAdd(java.util.Collection<CreateVolumePermission> add) {
if (add == null) {
this.add = null;
return;
}
this.add = new com.amazonaws.internal.SdkInternalList<CreateVolumePermission>(add);
} |
java | public static List<String> getDatabases( String host, String port, String existingDb, String user, String pwd )
throws Exception {
if (existingDb == null) {
existingDb = "postgres";
}
String url = EDb.POSTGRES.getJdbcPrefix() + host + ":" + port + "/" + existingDb;
... |
java | @Override
public JobExecutionResult execute(String jobName) throws Exception {
PlanExecutor executor = getExecutor();
Plan p = createProgramPlan(jobName);
// Session management is disabled, revert this commit to enable
//p.setJobId(jobID);
//p.setSessionTimeout(sessionTimeout);
JobExecutionResult result... |
java | void sortLostFiles(List<String> files) {
// TODO: We should first fix the files that lose more blocks
Comparator<String> comp = new Comparator<String>() {
public int compare(String p1, String p2) {
Codec c1 = null;
Codec c2 = null;
for (Codec codec : Codec.getCodecs()) {
... |
java | private static void smoothBlocks(List< Block > blocks) {
for (int i = 0; i < blocks.size(); i++) {
Block block = blocks.get(i);
EncodingMode last = (i > 0 ? blocks.get(i - 1).mode : EncodingMode.FALSE);
EncodingMode next = (i < blocks.size() - 1 ? blocks.get(i + 1).mode... |
python | def show_firmware_version_output_show_firmware_version_switchid(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
show_firmware_version = ET.Element("show_firmware_version")
config = show_firmware_version
output = ET.SubElement(show_firmware_versio... |
java | public static void changeRoboconfLogLevel( String logLevel, String etcDir )
throws IOException {
if( ! Utils.isEmptyOrWhitespaces( etcDir )) {
File f = new File( etcDir, AgentConstants.KARAF_LOG_CONF_FILE );
if( f.exists()) {
Properties props = Utils.readPropertiesFile( f );
props.put( "log4j.logger.... |
python | def CreateSignatureContract(publicKey):
"""
Create a signature contract.
Args:
publicKey (edcsa.Curve.point): e.g. KeyPair.PublicKey.
Returns:
neo.SmartContract.Contract: a Contract instance.
"""
script = Contract.CreateSignatureRedeemScript(publ... |
python | def dt_to_ts(value):
""" If value is a datetime, convert to timestamp """
if not isinstance(value, datetime):
return value
return calendar.timegm(value.utctimetuple()) + value.microsecond / 1000000.0 |
python | def next(self):
"""Returns next error checking strategy."""
# Where this link is in the chain:
location = self.chain.index(self)
if not self.end():
return self.chain[location + 1] |
python | def get_prediction(self, features=None, tag=None, namespaces=None):
"""Send an unlabeled example to the trained VW instance.
Uses any given features or namespaces, as well as any previously
added namespaces (using them up in the process).
Returns a VWResult object."""
if feature... |
java | static PemEncoded toPEM(ByteBufAllocator allocator, boolean useDirect,
X509Certificate... chain) throws CertificateEncodingException {
if (chain == null || chain.length == 0) {
throw new IllegalArgumentException("X.509 certificate chain can't be null or empty");
}
// We... |
python | def packet_get_bandwidth(data):
"""Gets the bandwidth of an Opus packet."""
data_pointer = ctypes.c_char_p(data)
result = _packet_get_bandwidth(data_pointer)
if result < 0:
raise OpusError(result)
return result |
python | def send(self, signum):
"""Send the given signal to the running process.
If the process is not running a RuntimeError with a message of "No such
process" should be emitted.
"""
if not isinstance(signum, int):
raise TypeError(
"Signals must be given a... |
java | @Override
public void removeByC_S(long CProductId, int status) {
for (CPDefinition cpDefinition : findByC_S(CProductId, status,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinition);
}
} |
java | public static String optionalStringAttribute(
final XMLStreamReader reader,
final String namespace,
final String localName,
final String defaultValue) {
final String value = reader.getAttributeValue(namespace, localName);
if (value != null) {
r... |
python | def create_user_dci(access_token):
"""Create the a dci user.
username=dci, password=dci, email=dci@distributed-ci.io"""
user_data = {'username': 'dci',
'email': 'dci@distributed-ci.io',
'enabled': True,
'emailVerified': True,
'credentials':... |
java | public static Media mediaUploadnews(String access_token, List<Article> articles) {
return MediaAPI.mediaUploadnews(access_token, articles);
} |
java | public void marshall(BatchAttachTypedLink batchAttachTypedLink, ProtocolMarshaller protocolMarshaller) {
if (batchAttachTypedLink == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(batchAttachTypedLin... |
java | public Pager<TreeItem> getTree(Object projectIdOrPath, String filePath, String refName, int itemsPerPage) throws GitLabApiException {
return (getTree(projectIdOrPath, filePath, refName, false, itemsPerPage));
} |
java | @Override
public int read(byte[] output, int offset, int length) throws IOException {
synchronized(this){
int value = 0;
if(closed) {
if (TraceComponent.isAnyTracingEnabled() && tc.isErrorEnabled())
Tr.error(tc, "stream.is.closed.no.read.write");
... |
java | public void doDelete(String url, HttpResponse result, Map<String, Object> headers, String contentType) {
httpClient.delete(url, result, headers, contentType);
} |
java | public final UptimeCheckConfig updateUptimeCheckConfig(UptimeCheckConfig uptimeCheckConfig) {
UpdateUptimeCheckConfigRequest request =
UpdateUptimeCheckConfigRequest.newBuilder().setUptimeCheckConfig(uptimeCheckConfig).build();
return updateUptimeCheckConfig(request);
} |
java | public String getBaselineStartText()
{
Object result = getCachedValue(TaskField.BASELINE_START);
if (result == null)
{
result = getCachedValue(TaskField.BASELINE_ESTIMATED_START);
}
if (!(result instanceof String))
{
result = null;
}
return (String) ... |
java | public boolean sendNotify(String subscriptionState, String termReason, String body, int timeLeft,
EventHeader eventHdr, SubscriptionStateHeader ssHdr, AcceptHeader accHdr,
ContentTypeHeader ctHdr, boolean viaProxy) {
return super.sendNotify(subscriptionState, termReason, body, timeLeft, eventHdr, ssHdr,... |
java | public static boolean any(Object self, Closure closure) {
BooleanClosureWrapper bcw = new BooleanClosureWrapper(closure);
for (Iterator iter = InvokerHelper.asIterator(self); iter.hasNext();) {
if (bcw.call(iter.next())) return true;
}
return false;
} |
python | def all_docs(self, **kwargs):
"""
Wraps the _all_docs primary index on the database, and returns the
results by value. This can be used as a direct query to the _all_docs
endpoint. More convenient/efficient access using keys, slicing
and iteration can be done through the ``resul... |
java | public long getNextTimeout(long lastTimeout)
{
// Perform basic validation of lastTimeout, which should be a value that
// was previously returned from getFirstTimeout.
if (lastTimeout < start)
{
throw new IllegalArgumentException("last timeout " + lastTimeout + " is bef... |
java | public static boolean isValidNCName(String ncName) {
final int length = ncName.length();
if (length == 0) {
return false;
}
char ch = ncName.charAt(0);
if (!isNCNameStart(ch)) {
return false;
}
for (int i = 1; i < length; ++i) {
ch = ncName.charAt(i);
if (!isNCName(ch... |
java | public String getXML()
{
Object root = null;
if (m_message != null)
root = m_message.getRawData();
if (root != null)
{
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
String strSOAPPackage = (String)((TrxMessageHe... |
python | def list_exports(exports='/etc/exports'):
'''
List configured exports
CLI Example:
.. code-block:: bash
salt '*' nfs.list_exports
'''
ret = {}
with salt.utils.files.fopen(exports, 'r') as efl:
for line in salt.utils.stringutils.to_unicode(efl.read()).splitlines():
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.