language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def list_sas(self, filters=None):
"""Retrieve active IKE_SAs and associated CHILD_SAs.
:param filters: retrieve only matching IKE_SAs (optional)
:type filters: dict
:return: list of active IKE_SAs and associated CHILD_SAs
:rtype: list
"""
_, sa_list = self.handle... |
python | def __validInputs(self):
"""Validates the inputs of the constructor."""
#if not isinstance(self.__column, Column):
# raise Sitools2Exception("column must be an instance of Column")
try:
float(self.__minVal)
except ValueError as ex:
raise Sitools2Excepti... |
java | public <R extends BProgramRunnerListener> R addListener(R aListener) {
listeners.add(aListener);
return aListener;
} |
java | public static STSClient createSTSClient(Bus bus, Map<String, String> stsProps) {
STSClient stsClient = createClient(bus, stsProps);
stsClient.setWsdlLocation(stsProps.get(STS_WSDL_LOCATION));
stsClient.setEndpointQName(new QName(stsProps.get(STS_NAMESPACE), stsProps.get(STS_ENDPOINT_NAME)))... |
python | def get_constraints(clusters, quota=(1, 1), Nmax=0):
"""
Check pairwise cluster comparison, if they overlap then mark edge as conflict
"""
qa, qb = quota
eclusters = make_range(clusters, extend=-Nmax)
# (1-based index, cluster score)
nodes = [(i+1, c[-1]) for i, c in enumerate(eclusters)]
... |
java | public void marshall(FilteredLogEvent filteredLogEvent, ProtocolMarshaller protocolMarshaller) {
if (filteredLogEvent == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(filteredLogEvent.getLogStreamNa... |
java | private synchronized ApptentiveNotificationObserverList resolveObserverList(String name) {
ApptentiveNotificationObserverList list = observerListLookup.get(name);
if (list == null) {
list = new ApptentiveNotificationObserverList();
observerListLookup.put(name, list);
}
return list;
} |
java | @Override
public void readFragmentFrom(MwsReader r) {
sellerId = r.read("SellerId", String.class);
createdAfter = r.read("CreatedAfter", XMLGregorianCalendar.class);
createdBefore = r.read("CreatedBefore", XMLGregorianCalendar.class);
lastUpdatedAfter = r.read("LastUpdatedAfter", XML... |
python | def add(self, anchor):
"""Add a new anchor to the repository.
This will create a new ID for the anchor and provision new storage for
it.
Returns: The storage ID for the Anchor which can be used to retrieve
the anchor later.
"""
anchor_id = uuid.uuid4().hex
... |
java | private void encodeIntern(final LNGVector<Literal> vars) {
if (vars.size() <= this.groupSize)
for (int i = 0; i + 1 < vars.size(); i++)
for (int j = i + 1; j < vars.size(); j++)
this.result.addClause(vars.get(i).negate(), vars.get(j).negate());
else {
final LNGVector<Literal> l1 = ... |
python | def conf_as_dict(conf_filename, encoding=None, case_sensitive=False):
"""
读入 ini 配置文件,返回根据配置文件内容生成的字典类型变量;
:param:
* conf_filename: (string) 需要读入的 ini 配置文件长文件名
* encoding: (string) 文件编码
* case_sensitive: (bool) 是否大小写敏感,默认为 False
:return:
* flag: (bool) 读取配置文件是否正确,正确返回 Tr... |
java | public SemanticVersion findSupportingVersion(SemanticVersion... versions)
{
for (SemanticVersion version : versions)
{
if (isSupportedBy(version))
return version;
}
return null;
} |
python | def cut(self, sentence, cut_all=False, HMM=True):
'''
The main function that segments an entire sentence that contains
Chinese characters into separated words.
Parameter:
- sentence: The str(unicode) to be segmented.
- cut_all: Model type. True for full pattern, ... |
python | def render(self, filename=None, directory=None, view=False, cleanup=False,
format=None, renderer=None, formatter=None):
"""Save the source to file and render with the Graphviz engine.
Args:
filename: Filename for saving the source (defaults to ``name`` + ``'.gv'``)
... |
java | @Override
public final <WB extends WaveBean> Wave returnData(final Class<? extends Service> serviceClass, final WaveType waveType, final WB waveBean) {
return sendWaveIntoJit(createWave(WaveGroup.RETURN_DATA, waveType, serviceClass, waveBean));
} |
java | public ListIdentitiesResult withIdentities(IdentityDescription... identities) {
if (this.identities == null) {
setIdentities(new java.util.ArrayList<IdentityDescription>(identities.length));
}
for (IdentityDescription ele : identities) {
this.identities.add(ele);
... |
python | def evaluate_inkml(inkml_file_path):
"""Evaluate an InkML file.
Parameters
----------
inkml_file_path : string
path to an InkML file
Returns
-------
dictionary
The dictionary contains the keys 'filename' and 'results', where
'results' itself is a list of dictionarie... |
java | @Override
public ListT<W,T> onEmptyGet(final Supplier<? extends T> supplier) {
return (ListT<W,T>) FoldableTransformerSeq.super.onEmptyGet(supplier);
} |
java | public static ProtocolNegotiator serverTls(final SslContext sslContext) {
Preconditions.checkNotNull(sslContext, "sslContext");
return new ProtocolNegotiator() {
@Override
public ChannelHandler newHandler(GrpcHttp2ConnectionHandler handler) {
return new ServerTlsHandler(sslContext, handler);... |
java | private static SecuredCEK secureCEK(SecretKey cek,
EncryptionMaterials materials, S3KeyWrapScheme kwScheme,
SecureRandom srand, Provider p, AWSKMS kms,
AmazonWebServiceRequest req) {
final Map<String,String> matdesc;
if (materials.isKMSEnabled()) {
matdes... |
java | public double[] getConditionalDistribution(int[] sequence, int position) {
double[] result = scoresOf(sequence, position);
ArrayMath.logNormalize(result);
// System.out.println("marginal: " + ArrayMath.toString(marginal,
// nf));
// System.out.println("conditional: " + ArrayMath.... |
java | public static List<CommerceTaxFixedRateAddressRel> findByCommerceTaxMethodId(
long commerceTaxMethodId, int start, int end,
OrderByComparator<CommerceTaxFixedRateAddressRel> orderByComparator) {
return getPersistence()
.findByCommerceTaxMethodId(commerceTaxMethodId, start, end,
orderByComparator);
} |
java | private boolean filter(final String classpathElementPath) {
if (scanSpec.classpathElementFilters != null) {
for (final ClasspathElementFilter filter : scanSpec.classpathElementFilters) {
if (!filter.includeClasspathElement(classpathElementPath)) {
return false;
... |
java | public void setUserService(
com.liferay.portal.kernel.service.UserService userService) {
this.userService = userService;
} |
java | protected void handleExceptions(MessageEvent messageEvent, Exception exception) {
logger.error("Unknown exception. Internal Server Error.", exception);
writeErrorResponse(messageEvent,
HttpResponseStatus.INTERNAL_SERVER_ERROR,
"Internal Server Error"... |
java | public TokenResult getEditToken(String pageTitle, String type)
throws Exception {
pageTitle = normalizeTitle(pageTitle);
String editversion = "";
String action = "query";
String params = "&meta=tokens";
TokenMode tokenMode;
if (getVersion().compareToIgnoreCase("Mediawiki 1.24") >= 0) {
... |
python | def strip_rightmost(self):
"""
Strip the rightmost part of the language range. If the new rightmost
part is a singleton or ``x`` (i.e. starts an extension or private use
part), it is also stripped.
Return the newly created :class:`LanguageRange`.
"""
parts = sel... |
java | public static int getIntValue(String primaryKey) {
Object val = CFG.get(primaryKey);
if (val == null) {
throw new SofaRpcRuntimeException("Not found key: " + primaryKey);
} else {
return Integer.parseInt(val.toString());
}
} |
python | def top_hits(hits, num, column, reverse):
"""
get top hits after sorting by column number
"""
hits.sort(key = itemgetter(column), reverse = reverse)
for hit in hits[0:num]:
yield hit |
java | public Stream<T> tailStream(T key, boolean inclusive, boolean parallel)
{
return StreamSupport.stream(tailSpliterator(key, inclusive), parallel);
} |
java | public BigDecimal remainder(BigDecimal divisor, MathContext mc) {
BigDecimal divrem[] = this.divideAndRemainder(divisor, mc);
return divrem[1];
} |
java | private void initMeasures() {
durationMeasure = new DurationMeasure();
iterations = new CountingMeasure(0);
solutionListMeasure = new BasicMeasure<>();
measureManager = new SimpleMeasureManager();
measureManager.setPullMeasure("currentExecutionTime", durationMeasure);
measureManager.setPullMeasure("curre... |
java | protected ClassMapping readClassMapping ()
throws IOException, ClassNotFoundException
{
// create our classmap if necessary
if (_classmap == null) {
_classmap = Lists.newArrayList();
// insert a zeroth element
_classmap.add(null);
}
// rea... |
java | @Override
public SortedMap<String, Meter> getMeters(MetricFilter filter) {
return getMetrics(Meter.class, filter);
} |
java | public void startHawkularAgent(Configuration newConfig) {
if (newConfig == null) {
super.startHawkularAgent();
} else {
Configuration oldConfig = getConfigurationManager().getConfiguration();
boolean doNotChangeConfig = (oldConfig != null && oldConfig.getSubsystem().g... |
java | @Nonnull
public CSSDeclaration setProperty (@Nonnull final ECSSProperty eProperty)
{
ValueEnforcer.notNull (eProperty, "Property");
return setProperty (eProperty.getName ());
} |
java | private synchronized void addResolved( Artifact artifact )
{
String path =
artifact.getGroupId().replace( '.', '/' ) + '/' + artifact.getArtifactId() + "/" + artifact.getVersion();
Map<String, Artifact> artifactMapper = this.children.get( path );
if ( artifactMapper == null )
... |
python | def debug_shell(user_ns, user_global_ns, traceback=None, execWrapper=None):
"""
Spawns some interactive shell. Tries to use IPython if available.
Falls back to :func:`pdb.post_mortem` or :func:`simple_debug_shell`.
:param dict[str] user_ns:
:param dict[str] user_global_ns:
:param traceback:
... |
java | @Override
public <T> CompletionStage<T> post(URI uri, Map<String, String> headers, String data, JsonParser<T> parser) {
return request(uri, headers, data, parser);
} |
python | def select(*cases):
"""
Select the first case that becomes ready.
If a default case (:class:`goless.dcase`) is present,
return that if no other cases are ready.
If there is no default case and no case is ready,
block until one becomes ready.
See Go's ``reflect.Select`` method for an analog
... |
java | public static <T> Observable<T> cache(final Observable<T> source, final long duration,
final TimeUnit unit, final Scheduler.Worker worker) {
final AtomicReference<CachedObservable<T>> cacheRef = new AtomicReference<CachedObservable<T>>();
CachedObservable<T> cache... |
python | def accessible_organisms(user, orgs):
"""Get the list of organisms accessible to a user, filtered by `orgs`"""
permission_map = {
x['organism']: x['permissions']
for x in user.organismPermissions
if 'WRITE' in x['permissions'] or
'READ' in x['permissions'] or
'ADMINISTRAT... |
java | private void validateRelationship(String baseTableName,
String relatedTableName, String relationName) {
// Verify the base and related tables exist
if (!geoPackage.isTable(baseTableName)) {
throw new GeoPackageException(
"Base Relationship table does not exist: " + baseTableName
+ ", Relation: " ... |
python | def replace_mutating_webhook_configuration(self, name, body, **kwargs):
"""
replace the specified MutatingWebhookConfiguration
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.replace_mutati... |
java | private boolean computeSearchDirection() {
// Compute the function's gradient
function.computeGradient(temp0_Nx1.data);
// compute the change in gradient
for( int i = 0; i < N; i++ ) {
y.data[i] = temp0_Nx1.data[i] - g.data[i];
g.data[i] = temp0_Nx1.data[i];
}
// Update the inverse Hessian matrix
... |
python | def router_removed_from_hosting_device(self, context, router):
"""Notify cfg agent about router removed from hosting device."""
self._notification(context, 'router_removed_from_hosting_device',
[router], operation=None, shuffle_agents=False) |
java | public static Set<String> getNamespaces(File file) throws ParserConfigurationException, SAXException, IOException {
return getNamespaces(new InputSource(new FileReader(file)));
} |
python | def create_cache_cluster(name, wait=600, security_groups=None,
region=None, key=None, keyid=None, profile=None, **args):
'''
Create a cache cluster.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster \
... |
python | def partition_seq(seq, size):
"""
Splits a sequence into an iterable of subsequences. All subsequences are of the given size,
except the last one, which may be smaller. If the input list is modified while the returned
list is processed, the behavior of the program is undefined.
:param seq: the list... |
python | def create_package_level_rst_index_file(
package_name, max_depth, modules, inner_packages=None):
"""Function for creating text for index for a package.
:param package_name: name of the package
:type package_name: str
:param max_depth: Value for max_depth in the index file.
:type max_depth:... |
python | def clear_usersettings_cache(sender, **kwargs):
"""
Clears the cache (if primed) each time a ``UserSettings`` is saved or deleted
"""
instance = kwargs['instance']
try:
del USERSETTINGS_CACHE[instance.site.pk]
except KeyError:
pass |
java | private static int notifyProgress(UploadProgress notifier, File file, int bytesWritten, int bytesTotal, int prevPct) {
if (notifier != null) {
int pct = (int) ((bytesWritten * 100L) / bytesTotal);
// We don't want to inform about the same pct twice
if (prevPct !=... |
java | public static SpriteTiled loadSpriteTiled(ImageBuffer surface, int tileWidth, int tileHeight)
{
return new SpriteTiledImpl(surface, tileWidth, tileHeight);
} |
python | def _upload_or_replace_fb(self,directory,fn,_album_id,\
_megapixels=None,resize_request=None,movealbum_request=None,\
changetitle_request=None,_title=None):
"""Does the actual upload to fb.
if resize_request, will resize picture only if
it already exists and the geometry ... |
java | private void addAliasDefinition(AliasDefinition aliasDef) {
// Prerequisites:
assert aliasDef != null;
assert !m_aliasDefMap.containsKey(aliasDef.getName());
assert aliasDef.getTableName().equals(this.getTableName());
m_aliasDefMap.put(aliasDef.getName(), aliasDef)... |
python | def create_warped_grid(image, grid_step=10, grid_width=2, grid_directions=(True, True),
fixed_reference_image=None, transform=None, foreground=1, background=0):
"""
Deforming a grid is a helpful way to visualize a deformation field.
This function enables a user to define the grid par... |
java | @Override
public long convert(int[] input, int inPos) {
int Y = input[inPos++] & 0xFF;
int Cb = input[inPos++] & 0xFF;
int Cr = input[inPos] & 0xFF;
byte r = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y + Cr2R[Cr]];
byte g = (byte) sampleRangeLimitTable[sampleRang... |
java | public static Iterable<MutableIntTuple> vonNeumannNeighborhoodIterable(
IntTuple center, final int radius)
{
final IntTuple localCenter = IntTuples.copy(center);
return new Iterable<MutableIntTuple>()
{
@Override
public Iterator<MutableIntTuple> iterato... |
python | def _getframe(level=0):
'''
A reimplementation of `sys._getframe`.
`sys._getframe` is a private function, and isn't guaranteed to exist in all
versions and implementations of Python.
This function is about 2 times slower than the native implementation. It
relies on the asumption that the trace... |
python | def getLocalFactories(self, From, to, protocolName):
"""
Returns a list of 2-tuples of (protocolFactory, description) to handle
this from/to/protocolName
@param From:
@param to:
@param protocolName:
@return:
"""
result = []
x = self.loca... |
java | public List<byte[]> getSubAuthorities() {
final List<byte[]> res = new ArrayList<>(getSubAuthorityCount());
for (byte[] sub : subAuthorities) {
if (sub != null) {
res.add(Arrays.copyOf(sub, sub.length));
}
}
return Collections.unmodifiableList(res)... |
java | public final void entryRuleXConstructorCall() throws RecognitionException {
try {
// InternalXbase.g:1259:1: ( ruleXConstructorCall EOF )
// InternalXbase.g:1260:1: ruleXConstructorCall EOF
{
if ( state.backtracking==0 ) {
before(grammarAccess.getXC... |
java | public PagedList<BuildArgumentInner> listBuildArguments(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) {
ServiceResponse<Page<BuildArgumentInner>> response = listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName)... |
python | def make_view_field(field, obj=None, types_convert_map=None, fields_convert_map=None,
value=__default_value__, auto_convert=True):
"""
If auto_convert, then all values will be converted to string format, otherwise
remain the orignal value
"""
from uliweb.utils.textconvert import text2html... |
java | public static Executor newFixedThreadPool(RateRule... rules) {
int nThreads = Integer.MAX_VALUE;
for (RateRule r : rules) {
if (r.getRequests() < nThreads) {
nThreads = r.getRequests();
}
}
if (nThreads == Integer.MAX_VALUE) {
nThreads = DEFAULT_FIXED_POOL_SIZE;
}
return Executors.newF... |
python | def _generic_search(cls, name, search_string, metadata={}, ignore=''):
""" Searches for a specific string given three types of regex search types. Also auto-checks for camel casing.
:param name: str, name of object in question
:param search_string: str, string to find and insert into the searc... |
java | public void setOnKeyUp(String onkeyup)
{
AbstractHtmlState tsh = getState();
tsh.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONKEYUP, onkeyup);
} |
python | def chart(
symbols=("AAPL", "GLD", "GOOG", "$SPX", "XOM", "msft"),
start=datetime.datetime(2008, 1, 1),
end=datetime.datetime(2009, 12, 31), # data stops at 2013/1/1
normalize=True,
):
"""Display a graph of the price history for the list of ticker symbols provided
Arguments:
symbols... |
python | def register_name(self, register_index):
"""Retrives and returns the name of an ARM CPU register.
Args:
self (JLink): the ``JLink`` instance
register_index (int): index of the register whose name to retrieve
Returns:
Name of the register.
"""
resul... |
java | private void readStreamResult(InH3 hIn, HeadersAmp headers)
throws IOException
{
ServiceRefAmp serviceRef = readToAddress(hIn);
long id = hIn.readLong();
QueryRefAmp queryRef = serviceRef.getQueryRef(id);
if (queryRef != null) {
ClassLoader loader = queryRef.getClassLoader();
T... |
java | @Override
public void apply() throws ContradictionException {
if (branch == 1) {
if (to == -1) {
assignment.apply(var, from, this);
} else {
assignment.apply(var, from, to, this);
}
} else if (branch == 2) {
if (to == -1) {
assignment.unapply(var, from, this);
} else {
assignment.una... |
java | @Override
public <P> void pojoDaoCreated(PojoDaoFactoryEvent<P> event) {
String tableName = event.getTableName();
Schema schema = new Schema();
event.getPojoBinding().describe(schema.createTable(tableName), schema);
schema.items().forEach(schemaItem -> {
final String key... |
python | def epubcheck_help():
"""Return epubcheck.jar commandline help text.
:return unicode: helptext from epubcheck.jar
"""
# tc = locale.getdefaultlocale()[1]
with open(os.devnull, "w") as devnull:
p = subprocess.Popen(
[c.JAVA, '-Duser.language=en', '-jar', c.EPUBCHECK, '-h'],
... |
java | private void attemptMatch(BasicBlock basicBlock, BasicBlock.InstructionIterator instructionIterator)
throws DataflowAnalysisException {
work(new State(basicBlock, instructionIterator, pattern.getFirst()));
} |
python | def fast_lyapunov_max(w0, hamiltonian, dt, n_steps, d0=1e-5,
n_steps_per_pullback=10, noffset_orbits=2, t1=0.,
atol=1E-10, rtol=1E-10, nmax=0, return_orbit=True):
"""
Compute the maximum Lyapunov exponent using a C-implemented estimator
that uses the DOPRI853 inte... |
python | def download(self, filename=None):
"""
Download snapshot to filename
:param str filename: fully qualified path including filename .zip
:raises EngineCommandFailed: IOError occurred downloading snapshot
:return: None
"""
if not filename:
filename = '{}... |
python | def parse(self, limit=None):
"""
We process each of the postgres tables in turn.
The order of processing is important here, as we build up a hashmap of
internal vs external identifers (unique keys by type to FB id).
These include allele, marker (gene), publication, strain, genoty... |
java | @Override
protected com.itextpdf.text.Image createImage(PdfContentByte canvas, Object data, float opacity) throws VectorPrintException, BadElementException {
if (getImageBeingProcessed()!=null) {
return getImageBeingProcessed();
}
this.data = data;
boolean doFooter = getSettings().ge... |
python | def num_model_per_iteration(self):
"""Get number of models per iteration.
Returns
-------
model_per_iter : int
The number of models per iteration.
"""
model_per_iter = ctypes.c_int(0)
_safe_call(_LIB.LGBM_BoosterNumModelPerIteration(
self.... |
python | async def save(self, request, response):
"""Save session to response cookies."""
if isinstance(response, Response) and SESSION_KEY in request and not response.prepared:
session = request[SESSION_KEY]
if session.save(response.set_cookie):
self.app.logger.debug('Ses... |
python | def parse_args(self, ap_mac, ssid, passphrase,
channel=None,
# KRACK attack options
double_3handshake=True,
encrypt_3handshake=True,
wait_3handshake=0,
double_gtk_refresh=True,
arp_target... |
java | public UntagResourceRequest withTagsToRemove(String... tagsToRemove) {
if (this.tagsToRemove == null) {
setTagsToRemove(new java.util.ArrayList<String>(tagsToRemove.length));
}
for (String ele : tagsToRemove) {
this.tagsToRemove.add(ele);
}
return this;
... |
python | def unCompressed(self):
""" Derive uncompressed key """
public_key = repr(self._pk)
prefix = public_key[0:2]
if prefix == "04":
return public_key
assert prefix == "02" or prefix == "03"
x = int(public_key[2:], 16)
y = self._derive_y_from_x(x, (prefix =... |
python | def _write_cache(self, lines, append=False):
"""Write virtualenv metadata to cache."""
mode = 'at' if append else 'wt'
with open(self.filepath, mode, encoding='utf8') as fh:
fh.writelines(line + '\n' for line in lines) |
python | def from_start_and_end(cls, start, end, aa=None, major_pitch=225.8,
major_radius=5.07, major_handedness='l',
minor_helix_type='alpha', orientation=1,
phi_c_alpha=0.0, minor_repeat=None):
"""Creates a `HelicalHelix` between a `start... |
python | def zoom_out(self, decr=1.0):
"""Zoom out a level.
Also see :meth:`zoom_to`.
Parameters
----------
decr : float (optional, defaults to 1)
The value to decrease the zoom level
"""
level = self.zoom.calc_level(self.t_['scale'])
self.zoom_to(lev... |
python | def inspect(config_file, profile):
"""Inspect existing configuration/profile."""
try:
section = load_profile_from_files(
[config_file] if config_file else None, profile)
click.echo("Configuration file: {}".format(config_file if config_file else "auto-detected"))
click.echo(... |
python | def _public(self, command, **params):
"""Invoke the 'command' public API with optional params."""
params['command'] = command
response = self.session.get(self._public_url, params=params)
return response |
python | def get_controller_list(self):
"""
Returns an iterable of tuples containing (index, controller_name) pairs.
Controller indexes start at 0.
You may easily transform this to a {name: index} mapping by using:
>>> controllers = {name: index for index, name in raildriver.get_contro... |
java | public static String getJarManifestValue(Class clazz, String attrName) {
URL url = getResource("/" + clazz.getName().replace('.', '/')
+ ".class");
if (url != null)
try {
URLConnection uc = url.openConnection();
if (uc instanceof java.net.JarUR... |
python | def _cmdloop(self) -> bool:
"""Repeatedly issue a prompt, accept input, parse an initial prefix
off the received input, and dispatch to action methods, passing them
the remainder of the line as argument.
This serves the same role as cmd.cmdloop().
:return: True implies the enti... |
python | def getWinners(self, profile, sampleFileName = None):
"""
Returns a list of all winning candidates when we use MCMC approximation to compute Bayesian
utilities for an election profile.
:ivar Profile profile: A Profile object that represents an election profile.
:ivar str... |
java | public static String escapeRegExp(final String value) {
final StringBuilder buff = new StringBuilder();
if (value == null || value.length() == 0) {
return "";
}
int index = 0;
// $( )+.[^{\
while (index < value.length()) {
final char current = valu... |
java | public void destroy() {
final String methodName = "destroy";
if (TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName);
}
RELOADING_MESSAGING_ENGINES.remove(_messagingEngine.getUuid()
.toString());
synchronized (MESSAGING_ENGINES) {
... |
java | public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
throw SQLError.noSupport();
} |
python | def post(self, uri, params={}, data={}):
'''A generic method to make POST requests to the OpenDNS Investigate API
on the given URI.
'''
return self._session.post(
urljoin(Investigate.BASE_URL, uri),
params=params, data=data, headers=self._auth_header,
... |
python | def install_theme(theme=None,
monofont=None,
monosize=11,
nbfont=None,
nbfontsize=13,
tcfont=None,
tcfontsize=13,
dffontsize=93,
outfontsize=85,
mathfontsize=100,
... |
java | public void subtract (Area area) {
if (area == null || isEmpty() || area.isEmpty()) {
return;
}
if (isPolygonal() && area.isPolygonal()) {
subtractPolygon(area);
} else {
subtractCurvePolygon(area);
}
if (areaBoundsSquare() < Geometry... |
python | def list_installed():
'''
Return a list of all installed kernels.
CLI Example:
.. code-block:: bash
salt '*' kernelpkg.list_installed
'''
pkg_re = re.compile(r'^{0}-[\d.-]+-{1}$'.format(
_package_prefix(), _kernel_type()))
pkgs = __salt__['pkg.list_pkgs'](versions_as_list=... |
java | @Handler
public void onRequestCompleted(
Request.In.Completed event, IOSubchannel appChannel)
throws InterruptedException {
final Request.In requestEvent = event.event();
// A check that also works with null.
if (Boolean.TRUE.equals(requestEvent.get())
|| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.