language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static String suppressWhiteSpace(String str) {
int len = str.length();
StringBuilder sb = new StringBuilder(len);
// boolean wasWS=false;
char c;
char buffer = 0;
for (int i = 0; i < len; i++) {
c = str.charAt(i);
if (c == '\n' || c == '\r') buffer = '\n';
else if (isWhiteSpace(c)) {
if (... |
java | protected static String toNormalizedString(
PrefixConfiguration prefixConfiguration,
SegmentValueProvider lowerValueProvider,
SegmentValueProvider upperValueProvider,
Integer prefixLength,
int segmentCount,
int bytesPerSegment,
int bitsPerSegment,
int segmentMaxValue,
char separator,
int r... |
python | def i18n_support_locale(lc_parent):
"""
Find out whether lc is supported. Returns all child locales (and eventually lc) which do have support.
:param lc_parent: Locale for which we want to know the child locales that are supported
:return: list of supported locales
"""
log.debug('i18n_support_lo... |
java | @Override
public void cleanUpNullReferences() {
List<K> keys = new LinkedList<>();
for (Map.Entry<K, V> entry : map.entrySet()) {
K key = entry.getKey();
V value = entry.getValue();
if (null == value
|| (value instanceof SoftReference && null ... |
java | @Override
public synchronized void remove(URI jobURI) {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
try {
long startTime = System.currentTimeMillis();
JobSpec jobSpec = getJobSpec(jobURI);
Path jobSpecPath = getPathForUR... |
java | public String encodeIntArray(int[] input) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
int length = input.length;
dos.writeInt(length);
for (int i=0; i < length; i++) {
dos.writeInt(inp... |
java | public static Long getGeneratedKeyOfLong(PreparedStatement ps) throws SQLException {
ResultSet rs = null;
try {
rs = ps.getGeneratedKeys();
Long generatedKey = null;
if (rs != null && rs.next()) {
try {
generatedKey = rs.getLong(1);
} catch (SQLException e) {
// 自增主键不为数字或者为Oracle... |
java | private static int findMinimumLeadingSpaces(String line, int count) {
int length = line.length();
int index = 0;
while (index < length && index < count && Character.isWhitespace(line.charAt(index))) index++;
return index;
} |
java | void reconfigure(com.couchbase.lite.internal.database.sqlite.SQLiteDatabaseConfiguration configuration) {
mOnlyAllowReadOnlyOperations = false;
// Remember what changed.
boolean foreignKeyModeChanged = configuration.foreignKeyConstraintsEnabled
!= mConfiguration.foreignKeyConstr... |
python | def call(func, args):
"""Call the function with args normalized and cast to the correct types.
Args:
func: The function to call.
args: The arguments parsed by docopt.
Returns:
The return value of func.
"""
assert hasattr(func, '__call__'), 'Cannot call func: {}'.format(
... |
java | private void jTreeGraph1MouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_jTreeGraph1MouseClicked
{//GEN-HEADEREND:event_jTreeGraph1MouseClicked
if (evt.getClickCount() == 2) {
TreePath[] paths = jTreeGraph1.getSelectionPaths();
if (paths != null && paths.length == 1) {
... |
python | def _load_user(self):
'''Loads user from session or remember_me cookie as applicable'''
if self._user_callback is None and self._request_callback is None:
raise Exception(
"Missing user_loader or request_loader. Refer to "
"http://flask-login.readthedocs.io/#... |
python | def eval(self):
""" Returns a list of Command objects that can be evaluated as their
string values. Each command will track it's preliminary dependencies,
but these values should not be depended on for running commands.
"""
max_size = _get_max_size(self.parts)
parts_list ... |
python | def construct_all(templates, **unbound_var_values):
"""Constructs all the given templates in a single pass without redundancy.
This is useful when the templates have a common substructure and you want the
smallest possible graph.
Args:
templates: A sequence of templates.
**unbound_var_values: The unbo... |
java | public static synchronized VelocityEngine getVelocityEngine() {
if (engine == null) {
VelocityEngine newEngine = new VelocityEngine();
// Class Loader
newEngine.addProperty("resource.loader", "class");
newEngine.addProperty("class.resource.loader.class",
"org.apache.velocity.runtime.resource.loader.... |
python | def return_dat(self, chan, begsam, endsam):
"""Return the data as 2D numpy.ndarray.
Parameters
----------
chan : int or list
index (indices) of the channels to read
begsam : int
index of the first sample
endsam : int
index of the last ... |
python | def fetch(self, conf):
"""
1. Fetch URL
2. Run automation.
3. Return HTML.
4. Close the tab.
"""
url = conf['url']
# If Firefox is broken, it will raise here, causing kibitzr restart:
self.driver.set_window_size(1366, 800)
self.driver.impli... |
python | def validate(self, bigchain, current_transactions=[]):
"""Validate election transaction
NOTE:
* A valid election is initiated by an existing validator.
* A valid election is one where voters are validators and votes are
allocated according to the voting power of each validato... |
java | @Nonnull
public static String normalizeFolder(@Nullable String path) {
if (path == null) {
path = "";
} else {
path = normalizeFile(path, null);
}
if (!path.endsWith("/")) {
path = path + "/";
}
return path;
} |
java | public static String createCustomExpressionInvocationText(CustomExpression customExpression, String customExpName, boolean usePreviousFieldValues) {
String stringExpression;
if (customExpression instanceof DJSimpleExpression) {
DJSimpleExpression varexp = (DJSimpleExpression) customExpressio... |
java | public List<Flow> getFlowSeries(String cluster, String user, String appId,
int limit) throws IOException {
return getFlowSeries(cluster, user, appId, null, false, limit);
} |
python | def by_col(cls, df, e, b, x_grid, y_grid, geom_col='geometry', **kwargs):
"""
Compute smoothing by columns in a dataframe. The bounding box and point
information is computed from the geometry column.
Parameters
-----------
df : pandas.DataFrame
a... |
java | @Override
public void bind(TransactionResource resource)
{
if (resource != null && resource instanceof Neo4JTransaction)
{
((Neo4JTransaction) resource).setGraphDb(factory.getConnection());
this.resource = resource;
}
else
{
throw new K... |
python | def _draw(self):
"""Draw all the things"""
self._compute()
self._compute_x_labels()
self._compute_x_labels_major()
self._compute_y_labels()
self._compute_y_labels_major()
self._compute_secondary()
self._post_compute()
self._compute_margin()
... |
python | def layers(self):
'''Construct Keras input layers for the given transformer
Returns
-------
layers : {field: keras.layers.Input}
A dictionary of keras input layers, keyed by the corresponding
field keys.
'''
from keras.layers import Input
... |
java | public AsciiTable setTextAlignment(TextAlignment textAlignment){
for(AT_Row row : this.rows){
if(row.getType()==TableRowType.CONTENT){
row.setTextAlignment(textAlignment);
}
}
return this;
} |
python | def open_mfdataset(paths, chunks=None, concat_dim=_CONCAT_DIM_DEFAULT,
compat='no_conflicts', preprocess=None, engine=None,
lock=None, data_vars='all', coords='different',
autoclose=None, parallel=False, **kwargs):
"""Open multiple files as a single dataset.
... |
java | @Deprecated
public DomainEntry withOptions(java.util.Map<String, String> options) {
setOptions(options);
return this;
} |
java | public static <T extends ImageBase<T>>
boolean invokeNativeGaussian(T input, T output, double sigma , int radius, T storage) {
boolean processed = false;
if( BOverrideBlurImageOps.gaussian != null ) {
try {
BOverrideBlurImageOps.gaussian.processGaussian(input,output,sigma,radius,storage);
processed = tr... |
java | private void helpAction(String arg) {
if (arg == null) {
printMainUsage();
return;
}
String helpTarget = arg.toLowerCase();
if (helpTarget.equals(ACTION_VIEW)) {
printViewUsage();
} else if (helpTarget.equals(ACTION_COPY)) {
print... |
java | public static CsvSchema convert(RowTypeInfo rowType) {
final Builder builder = new CsvSchema.Builder();
final String[] fields = rowType.getFieldNames();
final TypeInformation<?>[] types = rowType.getFieldTypes();
for (int i = 0; i < rowType.getArity(); i++) {
builder.addColumn(new Column(i, fields[i], conver... |
java | @Override
@SuppressWarnings({ "unchecked" })
public boolean perform(TherianContext context, final Convert<?, ?> convert) {
return new Delegate(convert).perform(context, convert);
} |
java | public void doProcess(BasicServlet servlet, HttpServletRequest req, HttpServletResponse res, PrintWriter out)
throws ServletException, IOException
{
Map<String,Object> propRequest = this.getRequestProperties(req, true);
String strBaseURL = (String)propRequest.get(DBParams.BASE_URL);
... |
java | @SuppressWarnings("unchecked")
@Override
public Future<?> runBatchAsync(Batch<T> batch, AfterExecute<T> afterExecute) {
for (Map.Entry<Address, T> entry : batch.getMap().entrySet()) {
Address address = entry.getKey();
T opFromBatch = entry.getValue();
BoxedByteArray... |
python | def _get_secrets(self, secure_data_path, version=None):
"""
Return full json secrets based on the secure data path
Keyword arguments:
secure_data_path (string) -- full path in the secret deposit box that contains the key
/shared/sdb-path/secret
... |
java | public GeocodingResult toGeocodingResult(
final GeoServiceGeocodingResult gsResult) {
if (gsResult == null) {
return null;
}
final GeocodingResult result = new GeocodingResult();
final AddressComponent[] addressComponents =
gsResult.getAddressCompo... |
java | private final ByteArrayOutputStream getByteArrayStream()
{
ByteArrayOutputStream rtnBaos = null;
// Get a ByteArrayOutputStream from the pool. Note that this must be
// synchronized as multiple threads may be accessing this pool, and the
// pool may return null if empty. ... |
python | def uncheck_all(self, name):
"""Remove the *checked*-attribute of all input elements with
a *name*-attribute given by ``name``.
"""
for option in self.form.find_all("input", {"name": name}):
if "checked" in option.attrs:
del option.attrs["checked"] |
java | public static synchronized ProviderList beginThreadProviderList(ProviderList list) {
// if (ProviderList.debug != null) {
// ProviderList.debug.println("ThreadLocal providers: " + list);
// }
ProviderList oldList = threadLists.get();
threadListsUsed++;
threadLists.set(li... |
python | def ignore(self, tube):
"""Remove the given tube from the watchlist.
:param tube: Name of tube to remove from the watchlist
If all tubes are :func:`ignore()` d, beanstalk will auto-add "default" to the watchlist
to prevent the list from being empty. See :func:`watch()` for more unforma... |
java | @Override
public SearchUsersResult searchUsers(SearchUsersRequest request) {
request = beforeClientExecution(request);
return executeSearchUsers(request);
} |
python | def add_new_spawn_method(obj):
"""
TODO
"""
def new_spawn(self):
# TODO/FIXME: Check that this does the right thing:
# (i) the spawned generator is independent of the original one (i.e. they can be reset independently without altering the other's behaviour)
# (ii) ensure that it... |
java | @Override
public void init(PlayerConfig config) throws InitializationFailedException {
super.init(config);
String bulkSize = config.get(ES_BATCH_SIZE_KEY);
if (bulkSize != null && !"".equals(bulkSize.trim())) {
this.bulkSize = Integer.parseInt(bulkSize);
}
events = new ArrayList<SimpleDataEv... |
python | def bed12(self, feature, block_featuretype=['exon'],
thick_featuretype=['CDS'], thin_featuretype=None,
name_field='ID', color=None):
"""
Converts `feature` into a BED12 format.
GFF and GTF files do not necessarily define genes consistently, so this
method pro... |
java | public static void free(ByteBuffer buffer) {
if (SUPPORTED && buffer != null && buffer.isDirect()) {
try {
if (UNSAFE != null) {
//use the JDK9 method
cleanerClean.invoke(UNSAFE, buffer);
} else {
Object clea... |
java | @Override
public CreateVocabularyResult createVocabulary(CreateVocabularyRequest request) {
request = beforeClientExecution(request);
return executeCreateVocabulary(request);
} |
python | def validator_factory(name, bases=None, namespace={}):
""" Dynamically create a :class:`~cerberus.Validator` subclass.
Docstrings of mixin-classes will be added to the resulting
class' one if ``__doc__`` is not in :obj:`namespace`.
:param name: The name of the new class.
:type name: :class:... |
python | def path_only_contains_dirs(self, path):
"""Return boolean on whether a path only contains directories."""
pathlistdir = os.listdir(path)
if pathlistdir == []:
return True
if any(os.path.isfile(os.path.join(path, i)) for i in pathlistdir):
return False
ret... |
java | @Override
public AttachmentResource getLicense(Locale loc) throws RepositoryBackendException, RepositoryResourceException {
AttachmentSummary s = matchByLocale(getAttachmentImpls(), AttachmentType.LICENSE, loc);
AttachmentResource result = null;
if (s instanceof AttachmentResource)
... |
python | def parse_log(log, context_size=3):
"""Parses latex log output and tries to extract error messages.
Requires ``-file-line-error`` to be active.
:param log: The contents of the logfile as a string.
:param context_size: Number of lines to keep as context, including the
original ... |
java | public final ListCrawledUrlsPagedResponse listCrawledUrls(String parent) {
ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().setParent(parent).build();
return listCrawledUrls(request);
} |
python | def always(self, method, path=None, headers=None, text=None, json=None):
'''
Sends response every time matching parameters are found util :func:`Server.reset` is called
:type method: str
:param method: request method: ``'GET'``, ``'POST'``, etc. can be some custom string
:type ... |
java | public boolean addAll(Collection<E> items){
boolean modified = false;
for(E e : items){
modified = add(e) || modified;
}
return modified;
} |
python | def generate_sync_h5_file(in_paths, channels=('channel_1', 'channel_1'), new_path='sync_file.h5'):
"""
-----
Brief
-----
This function allows to generate a h5 file with synchronised signals from the input file(s).
-----------
Description
-----------
OpenSignals files follow a specif... |
java | public static List<NetFlowV9Template> parseTemplates(ByteBuf bb, NetFlowV9FieldTypeRegistry typeRegistry) {
final ImmutableList.Builder<NetFlowV9Template> templates = ImmutableList.builder();
int len = bb.readUnsignedShort();
int p = 4; // flow set id and length field itself
while (p < ... |
java | @Override
public void addInstanceChangeListener(String serviceName, ServiceInstanceChangeListener listener) throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
if (listener == null) {
thr... |
python | def reinverted(n, r):
"""Integer with reversed and inverted bits of n assuming bit length r.
>>> reinverted(1, 6)
31
>>> [reinverted(x, 6) for x in [7, 11, 13, 14, 19, 21, 22, 25, 26, 28]]
[7, 11, 19, 35, 13, 21, 37, 25, 41, 49]
"""
result = 0
r = 1 << (r - 1)
while n:
if n... |
java | public static void render(List<Contour> contours , int colors[] , BufferedImage out) {
colors = checkColors(colors,contours.size());
for( int i = 0; i < contours.size(); i++ ) {
Contour c = contours.get(i);
int color = colors[i];
for(Point2D_I32 p : c.external ) {
out.setRGB(p.x,p.y,color);
}
}... |
java | public String columnToProperty(String columnName) {
StringBuilder sb = new StringBuilder();
boolean uppercase = false;
for(int i=0;i<columnName.length();i++){
char c = columnName.charAt(i);
if(c == '_'){
uppercase = true;
} else {
... |
python | def add(self, name, attributes):
"""
Add the relation to the Schema.
:param name: The name of a relation.
:param attributes: A list of attributes for the relation.
:raise RelationReferenceError: Raised if the name already exists.
"""
if name in self._data:
... |
java | @Override
public byte[] encodeParam(Charset charset) {
// 运行时参数在此计算值
this.fileNameByteLengh = path.getBytes(charset).length;
this.metaDataByteLength = getMetaDataSetByteSize(charset);
return super.encodeParam(charset);
} |
python | def normalize_auth(settings, admin=True, readonly=True, readonly_first=False):
"""Transform the readonly/admin user and password to simple user/password,
as expected by QueryEngine. If return value is true, then
admin or readonly password will be in keys "user" and "password".
:param settings: Connecti... |
python | def fetch(self, vault_client, backends):
"""Updates local resource with context on whether this
backend is actually mounted and available"""
if not is_mounted(self.backend, self.path, backends) or \
self.tune_prefix is None:
return
backend_details = get_backend(se... |
python | def _addLink(self, dirTree, dirID, dirSeq, dirPath, name):
""" Add tree reference and name. (Hardlink). """
logger.debug("Link %d-%d-%d '%s%s'", dirTree, dirID, dirSeq, dirPath, name)
# assert dirTree != 0, (dirTree, dirID, dirSeq, dirPath, name)
assert (dirTree, dirID, dirSeq) not in s... |
java | @Throws(IllegalEqualException.class)
public static boolean notEquals(final boolean expected, final boolean check, @Nonnull final String message) {
if (expected == check) {
throw new IllegalEqualException(message, check);
}
return check;
} |
java | public void deselect(int position, @Nullable Iterator<Integer> entries) {
Item item = mFastAdapter.getItem(position);
if (item == null) {
return;
}
deselect(item, position, entries);
} |
python | def _process(self, metric):
"""
Decorator for processing handlers with a lock, catching exceptions
"""
if not self.enabled:
return
try:
try:
self.lock.acquire()
self.process(metric)
except Exception:
... |
java | @Override
public void log(StopWatch sw)
{
if( !m_queue.offer( sw.freeze() ) ) m_rejectedStopWatches.getAndIncrement();
if( m_collectorThread == null )
{
synchronized(this)
{
//
// Ensure that there is no race condition starting th... |
java | public Object getObject(int key) {
if (key < 0) Kit.codeBug();
if (values != null) {
int index = findIndex(key);
if (0 <= index) {
return values[index];
}
}
return null;
} |
python | def dist(self,*args,**kwargs):
"""
NAME:
dist
PURPOSE:
return distance from the observer in kpc
INPUT:
t - (optional) time at which to get dist
obs=[X,Y,Z] - (optional) position of observer (in kpc)
(default=Object-wid... |
java | public boolean doSeek(String strSeekSign) throws DBException
{
try {
BaseBuffer buffer = m_pTable.seek(strSeekSign, this);
this.doSetHandle(buffer, DBConstants.DATA_SOURCE_HANDLE);
return (buffer != null);
} catch (DBException ex) {
throw Database... |
java | private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;
// int line=data.srcCode.getLine();
comments(data);
Expression expr = super.expression(data);
comments(data);
if (!data.srcCode.forwardIfCurrent(':')) th... |
python | def list_vdirs(site, app=_DEFAULT_APP):
'''
Get all configured IIS virtual directories for the specified site, or for
the combination of site and application.
Args:
site (str): The IIS site name.
app (str): The IIS application.
Returns:
dict: A dictionary of the virtual dir... |
java | public ApiResponse<Void> postHandshakeWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = postHandshakeValidateBeforeCall(null, null);
return apiClient.execute(call);
} |
java | public int size() {
int count=0;
for(Value val: map.values())
count+=val.count();
return count;
} |
java | public CreateApplicationRequest withCloudWatchLoggingOptions(CloudWatchLoggingOption... cloudWatchLoggingOptions) {
if (this.cloudWatchLoggingOptions == null) {
setCloudWatchLoggingOptions(new java.util.ArrayList<CloudWatchLoggingOption>(cloudWatchLoggingOptions.length));
}
for (Clou... |
java | public ApiResponse<GetAnyLocationsResponse> getAnyLocationsWithHttpInfo(String region) throws ApiException {
com.squareup.okhttp.Call call = getAnyLocationsValidateBeforeCall(region, null, null);
Type localVarReturnType = new TypeToken<GetAnyLocationsResponse>(){}.getType();
return apiClient.exe... |
java | public void initSummaryWriter(String fileName) throws FileNotFoundException {
closeSummary();
summaryWriter = new PrintWriter(new FileOutputStream(fileName));
configurationValues.put(ConfigurationOption.SUMMARY, fileName);
} |
java | public ApplicationDescription withVersions(String... versions) {
if (this.versions == null) {
setVersions(new com.amazonaws.internal.SdkInternalList<String>(versions.length));
}
for (String ele : versions) {
this.versions.add(ele);
}
return this;
} |
java | public static boolean isSelfSigned(X509Certificate cert,
String sigProvider) {
if (isSelfIssued(cert)) {
try {
if (sigProvider == null) {
cert.verify(cert.getPublicKey());
} else {
cert.verify(cert.getPublicKey(), sigPro... |
java | private static int partition(Object[] a, int start, int end, Comparator<Object> cmp) {
final int p = median(a, start, end, cmp);
final Object pivot = a[p];
a[p] = a[start];
a[start] = pivot;
int i = start;
int j = end + 1;
while (true) {
while (cmp.c... |
python | def write_edge (self, node):
"""Write edge from parent to node."""
source = dotquote(self.nodes[node["parent_url"]]["label"])
target = dotquote(node["label"])
self.writeln(u' "%s" -> "%s" [' % (source, target))
self.writeln(u' label="%s",' % dotquote(node["edge"]))
if... |
python | def sortedby(item_list, key_list, reverse=False):
""" sorts ``item_list`` using key_list
Args:
list_ (list): list to sort
key_list (list): list to sort by
reverse (bool): sort order is descending (largest first)
if reverse is True else acscending (smallest first)... |
java | public final void resumeState(final WebDriver webDriver) {
Validate.validState(crawlFrontier != null, "Cannot resume state at this point.");
start(webDriver, true);
} |
python | def match_hail_sizes(model_tracks, obs_tracks, track_pairings):
"""
Given forecast and observed track pairings, maximum hail sizes are associated with each paired forecast storm
track timestep. If the duration of the forecast and observed tracks differ, then interpolation is used for the
... |
python | def fill(text, delimiter="", width=70):
"""
Wrap text with width per line
"""
texts = []
for i in xrange(0, len(text), width):
t = delimiter.join(text[i:i + width])
texts.append(t)
return "\n".join(texts) |
java | @Override
public void initialize() {
this.fileAlterationObserver = new FileAlterationObserver(directory, fileFilter);
this.fileAlterationObserver.addListener(this);
try {
this.fileAlterationObserver.initialize();
} catch (Exception e) {
}
} |
java | public Stream<? extends TrieNode> getChildren() {
if (getData().firstChildIndex >= 0) {
return IntStream.range(0, getData().numberOfChildren)
.mapToObj(i -> new TrieNode(this.trie, getData().firstChildIndex + i, TrieNode.this));
}
else {
return Stream.empty();
}
} |
java | public JRecordExtractor<T, SparseLabeledPoint>
extractWithSettingsSparseLabeledPoint(String settings) {
return new JRecordExtractor<>(JavaOps.extractWithSettingsSparseLabeledPoint(self, settings));
} |
java | public void setOrientation (float ax, float ay, float az, float ux, float uy, float uz)
{
if (_ax != ax || _ay != ay || _az != az || _ux != ux || _uy != uy || _uz != uz) {
_vbuf.put(_ax = ax).put(_ay = ay).put(_az = az);
_vbuf.put(_ux = ux).put(_uy = uy).put(_uz = uz).rewind();
... |
python | def delete_handler(Model, name=None, **kwds):
"""
This factory returns an action handler that deletes a new instance of
the specified model when a delete action is recieved, assuming the
action follows nautilus convetions.
Args:
Model (nautilus.BaseModel): The model to d... |
python | def prop2qid(prop, value, endpoint='https://query.wikidata.org/sparql'):
"""
Lookup a wikidata item ID from a property and string value. For example, get the item QID for the
item with the entrez gene id (P351): "899959"
>>> prop2qid('P351','899959')
:param prop: property
:type prop: str
:p... |
java | public static void writeVocabCache(@NonNull VocabCache<VocabWord> vocabCache, @NonNull OutputStream stream)
throws IOException {
try (PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream, StandardCharsets.UTF_8)))) {
// saving general vocab information
... |
java | public synchronized void setSelector(Selector v)
{
if (selector != null && selector instanceof NotificationListener)
{
listeners.remove((NotificationListener)selector);
}
selector = v;
if (selector != null && selector instanceof NotificationListener)
{
listener... |
java | public static String byteArrayAsString(final Object bytearray) throws ParseException
{
try
{
return new String((byte[]) bytearray, "ISO-8859-1");
} catch (final UnsupportedEncodingException e)
{
throw new ParseException("Literal required, " + e.getMessage(), ... |
java | public OvhWLAN serviceName_modem_wifi_wifiName_GET(String serviceName, String wifiName) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/wifi/{wifiName}";
StringBuilder sb = path(qPath, serviceName, wifiName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhWLAN.cl... |
java | public void committed()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "committed");
try
{
_aiStream =
new AIStream(
streamId,
itemStream,
AnycastInputHandler.this,
_msUpdateThread,
... |
python | def psd(t, y, pow2=False, window=None, rescale=False):
"""
Single-sided power spectral density, assuming real valued inputs. This goes
through the numpy fourier transform process, assembling and returning
(frequencies, psd) given time and signal data y.
Note it is defined such that sum(psd)*d... |
python | def disconnect(self, callback: Callable) -> None:
"""
Disconnects the given callback.
The callback will no longer receive events from this signal.
No action is taken if the callback is not on the list of listener callbacks.
:param callback: the callable to remove
"""
... |
python | def export_public_key(vk, label):
"""
Export public key to text format.
The resulting string can be written into a .pub file or
appended to the ~/.ssh/authorized_keys file.
"""
key_type, blob = serialize_verifying_key(vk)
log.debug('fingerprint: %s', fingerprint(blob))
b64 = base64.b64e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.