language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void removeChild(HierarchicalFormModel child) {
Assert.notNull(child, "child");
child.removeParent();
children.remove(child);
child.removePropertyChangeListener(DIRTY_PROPERTY, childStateChangeHandler);
child.removePropertyChangeListener(COMMITTABLE_PROPERTY, childStateChangeHandler);
// when dynamic... |
java | private T loadResourceValue(final URL resource)
{
try (final InputStream is = resource.openStream())
{
cached = null; // Prevent the old value from being used
return setCached(clazz.cast(factory.getInstance(clazz).deserialise(is)));
}
catch (IOException e)
{
throw new RuntimeException("Error loadin... |
java | public JobExecutionInner create(String resourceGroupName, String serverName, String jobAgentName, String jobName) {
return createWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName).toBlocking().last().body();
} |
java | public final long plus(final long value, @Nonnull final TimeUnit timeUnit) {
return this.millis.addAndGet(timeUnit.toMillis(value));
} |
python | def _GetStat(self):
"""Retrieves the stat object.
Returns:
VFSStat: stat object.
Raises:
BackEndError: when the SQLite blob file-like object is missing.
"""
stat_object = super(SQLiteBlobFileEntry, self)._GetStat()
if not self._is_virtual:
file_object = self.GetFileObject()
... |
java | public static base_response enable(nitro_service client, String monitorname) throws Exception {
lbmonitor enableresource = new lbmonitor();
enableresource.monitorname = monitorname;
return enableresource.perform_operation(client,"enable");
} |
python | def get_callback_function(setting_name, default=None):
"""
Resolve a callback function based on a setting name.
If the setting value isn't set, default is returned. If the setting value
is already a callable function, that value is used - If the setting value
is a string, an attempt is made to import it. Anythi... |
python | def infer(args: argparse.Namespace) -> None:
"""
:args: An argparse.Namespace object.
This is the function called when the 'infer' sub-command is passed as an
argument to the CLI.
"""
try:
last_tag = last_git_release_tag(git_tags())
except NoGitTagsException:
print(SemVer(0,... |
python | def cpmap(cores=1):
"""Configurable parallel map context manager.
Returns appropriate map compatible function based on configuration:
- Local single core (the default)
- Multiple local cores
"""
if int(cores) == 1:
yield itertools.imap
else:
if futures is None:
r... |
java | @Override
public CPAttachmentFileEntry remove(Serializable primaryKey)
throws NoSuchCPAttachmentFileEntryException {
Session session = null;
try {
session = openSession();
CPAttachmentFileEntry cpAttachmentFileEntry = (CPAttachmentFileEntry)session.get(CPAttachmentFileEntryImpl.class,
primaryKey);
... |
python | def _bounding_ellipsoids(points, ell, pointvol=0., vol_dec=0.5,
vol_check=2.):
"""
Internal method used to compute a set of bounding ellipsoids when a
bounding ellipsoid for the entire set has already been calculated.
Parameters
----------
points : `~numpy.ndarray` with... |
python | def osm_poi_download(polygon=None, amenities=None, north=None, south=None, east=None, west=None,
timeout=180, max_query_area_size=50*1000*50*1000):
"""
Get points of interests (POIs) from OpenStreetMap based on selected amenity types.
Parameters
----------
poly : shapely.geomet... |
java | public static String decorateEncryption(char[] password)
{
if(password == null || password.length == 0)
return null;
return new StringBuilder(ENCRYPTED_PASSWORD_PREFIX)
.append(encrypt(password)).append(ENCRYPTED_PASSWORD_SUFFIX)
.toString();
} |
python | def histogram(self, column='r', filename=None, log10=False, **kwargs):
"""Plot a histogram of one data column"""
return_dict = HS.plot_histograms(self.data, column)
if filename is not None:
return_dict['all'].savefig(filename, dpi=300)
return return_dict |
python | def decode(cls, root_element):
"""
Decode the object to the object
:param root_element: the parsed xml Element
:type root_element: xml.etree.ElementTree.Element
:return: the decoded Element as object
:rtype: object
"""
new_object = cls()
field_nam... |
java | private void voidCommand(final String command) throws IOException {
synchronized (this.asyncMutex) {
this.out.write(command + "\n");
this.out.flush();
}
} |
java | public final ControlAck createNewControlAck() throws MessageCreateFailedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createNewControlAck");
ControlAck msg = null;
try {
msg = new ControlAckImpl(MfpConstants.CONSTRUCTOR_NO_OP);
}
catch (MessageDe... |
python | def popen_uci(cls, command: Union[str, List[str]], *, timeout: Optional[float] = 10.0, debug: bool = False, setpgrp: bool = False, **popen_args: Any) -> "SimpleEngine":
"""
Spawns and initializes an UCI engine.
Returns a :class:`~chess.engine.SimpleEngine` instance.
"""
return cl... |
java | @Override
public String getConnectionInfo() throws Exception
{
Connection connection = ds.getConnection();
String info = String.format("Connected to database: %s using driver: %s as user :%s",
connection.getMetaData().getDatabaseProductName(),
... |
java | public String asHex() throws IOException {
byte[] bytes = asByteArray();
char[] hex = new char[bytes.length * 2];
for ( int j = 0; j < bytes.length; j++ ) {
int v = bytes[j] & 0xFF;
hex[j * 2] = HEX_ARRAY[v >>> 4];
hex[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
... |
java | private static long simulate(long bytesPerSecond, long latency, int bytes, long timeTaken, boolean roundUp) {
if ( bytesPerSecond <= 0) { //< defensive code
return 0;
}
// workout how much we should have waited to read this amount of bytes
double d = ((double) bytes / bytesP... |
java | public Logger getOrCreateLogger(String clazz) {
Logger logger = appenderLoggerMap.get(clazz);
if (logger == null) {
// If multiple threads do the puts, that is fine as it is a one time thing
logger = Logger.getLogger(clazz);
appenderLoggerMap.put(clazz, logger);
}
r... |
java | @Override
public final void process(final Map<String, Object> pReqVars,
final IRequestData pRequestData) throws Exception {
retrieveStartData(pReqVars);
List<PriceCategory> defPcs = this.srvOrm.retrieveListWithConditions(pReqVars, PriceCategory.class, "where DFOL=1");
if (defPcs.size() != 1) {
t... |
python | def host_trigger(trg_queue, user=None, group=None, mode=None):
'''Installs a host trigger for the specified queue.'''
trigger(trg_queue, user=user, group=group, mode=mode,
trigger=_c.FSQ_HOSTS_TRIGGER) |
java | public void setAttributeMethodInfos(JmxAttributeMethodInfo[] attributeMethodInfos) {
if (this.attributeMethodInfos == null) {
this.attributeMethodInfos = arrayToList(attributeMethodInfos);
} else {
for (JmxAttributeMethodInfo attributeMethodInfo : attributeMethodInfos) {
this.attributeMethodInfos.add(attr... |
python | def _package_transform(package, fqdn, start=1, *args, **kwargs):
"""Applies the specified package transform with `fqdn` to the package.
Args:
package: imported package object.
fqdn (str): fully-qualified domain name of function in the package. If it
does not include the package name, ... |
java | @Override
public void getBindingsResult(int resultCode,
List<RegistrationBinding> bindings) {
ServerTransaction serverTransaction = getRegisterTransactionToReply();
if (serverTransaction == null) {
tracer.warning("failed to find SIP server tx to send response");
return;
}
try {
if (resultCode < 300... |
java | public static long getLong(String propertyName, long defaultValue) {
String tmpObj = get(propertyName);
if (tmpObj != null) {
try {
return Long.parseLong(tmpObj);
} catch (NumberFormatException e) {
}
}
return defaultValue;
} |
java | public EClass getIfcExternallyDefinedSymbol() {
if (ifcExternallyDefinedSymbolEClass == null) {
ifcExternallyDefinedSymbolEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(217);
}
return ifcExternallyDefinedSymbolEClass;
} |
python | def ts_func(f):
"""
This wraps a function that would normally only accept an array
and allows it to operate on a DataFrame. Useful for applying
numpy functions to DataFrames.
"""
def wrap_func(df, *args):
# TODO: should vectorize to apply over all columns?
return Chromatogram(f(d... |
python | def add_v3(vec1, m):
"""Return a new Vec3 containing the sum of our x, y, z, and arg.
If argument is a float or vec, addt it to our x, y, and z.
Otherwise, treat it as a Vec3 and add arg.x, arg.y, and arg.z from
our own x, y, and z.
"""
if type(m) in NUMERIC_TYPES:
return Vec3(vec1.x +... |
python | def to_binary_string(self):
"""Pack the feedback to binary form and return it as string."""
timestamp = datetime_to_timestamp(self.when)
token = binascii.unhexlify(self.token)
return struct.pack(self.FORMAT_PREFIX + '{0}s'.format(len(token)),
timestamp, len(tok... |
java | @SuppressWarnings("rawtypes")
public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException {
if (loaderClass != null && loaderClass.getClassLoader() != null)
return loaderClass.getClassLoader().loadClass(name);
return loadClass(name);
} |
python | def main():
'''This is where the example starts and the FSM state transitions are
defined. Note that states are strings (such as 'INIT'). This is not
necessary, but it makes the example easier to read. '''
f = FSM ('INIT', [])
f.set_default_transition (Error, 'INIT')
f.add_transition_any ('IN... |
java | public XWPFRun insertNewHyperLinkRun(int pos, String link) {
if (pos >= 0 && pos <= paragraph.getRuns().size()) {
PackageRelationship relationship = paragraph.getDocument().getPackagePart()
.addExternalRelationship(link, XWPFRelation.HYPERLINK.getRelation());
CTHyperl... |
python | def _grid_widgets(self):
"""Puts all the child widgets in the correct position."""
self._font_family_header.grid(row=0, column=1, sticky="nswe", padx=5, pady=5)
self._font_label.grid(row=1, column=1, sticky="nswe", padx=5, pady=(0, 5))
self._font_family_list.grid(row=2, rowspan=3, column... |
python | def shapes_to_geojson(
feed: "Feed", shape_ids: Optional[List[str]] = None
) -> Dict:
"""
Return a (decoded) GeoJSON FeatureCollection of LineString features
representing ``feed.shapes``.
Each feature will have a ``shape_id`` property.
The coordinates reference system is the default one for GeoJ... |
java | private static Node binaryOp(Token token, Node expr1, Node expr2) {
checkState(mayBeExpression(expr1), expr1);
checkState(mayBeExpression(expr2), expr2);
return new Node(token, expr1, expr2);
} |
java | protected void setProfileFactory(final Function<Object[], P> profileFactory) {
CommonHelper.assertNotNull("profileFactory", profileFactory);
this.newProfile = profileFactory;
} |
java | public ServiceFuture<List<RecommendedElasticPoolMetricInner>> listMetricsAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName, final ServiceCallback<List<RecommendedElasticPoolMetricInner>> serviceCallback) {
return ServiceFuture.fromResponse(listMetricsWithServiceResponseAsync(r... |
java | public static vpntrafficpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{
vpntrafficpolicy_vpnglobal_binding obj = new vpntrafficpolicy_vpnglobal_binding();
obj.set_name(name);
vpntrafficpolicy_vpnglobal_binding response[] = (vpntrafficpolicy_vpnglobal_binding[]) obj.get_resourc... |
python | def set_continuous(self, freq, amplitude, offset, output_state=True):
"""Programs the Stanford MW function generator to output a continuous sine wave.
External 'triggering' is accomplished using the MW switch."""
commands = ['MODL 0', #disable any modulation
'FREQ {... |
java | public BrokerServiceAccessor getServiceAccessor(String serviceId) {
for (BrokerServiceAccessor serviceAccessor : serviceAccessors) {
if (serviceId.equals(serviceAccessor.getServiceDescription().getId())) {
return serviceAccessor;
}
}
throw new NotFoundExc... |
java | public <T, P1> T getPrototypeBean(final ConstructorWithBeansAnd1Parameter<T, P1> creator,
final P1 param1) {
final PrototypeProvider provider = new PrototypeProvider(name, beans -> creator.create(beans, param1));
return provider.getBean(this, dryRun);
} |
python | def cache_master(self, saltenv='base', cachedir=None):
'''
Download and cache all files on a master in a specified environment
'''
ret = []
for path in self.file_list(saltenv):
ret.append(
self.cache_file(
salt.utils.url.create(path... |
java | public void setChemicalList(int i, Chemical v) {
if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null)
jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getR... |
java | public Span[][] tag(final int numTaggings, final String[] tokens) {
final Sequence[] bestSequences = this.model.bestSequences(numTaggings,
tokens, null, this.contextGenerator, this.sequenceValidator);
final Span[][] tags = new Span[bestSequences.length][];
for (int i = 0; i < tags.length; i++) {
... |
java | public String[] getAxisLabel() {
String[] array = new String[axis.length];
for (int i = 0; i < array.length; i++) {
array[i] = axis[i].getAxisLabel();
}
return array;
} |
java | private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) {
// TODO make async
// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user
// may not iterate over entire range
Map<Bytes, Set<Column>> columnsToRead = new HashMap<>();
for (Entry<B... |
python | def _find_git_info(self, gitdir):
"""
Find information about the git repository, if this file is in a clone.
:param gitdir: path to the git repo's .git directory
:type gitdir: str
:returns: information about the git clone
:rtype: dict
"""
res = {'remotes'... |
python | def load(path, cache=None, precache=False):
""" Parse from file.
"""
parser = Stylesheet(cache)
return parser.load(path, precache=precache) |
java | private Map<String, List<String>> findImplementations(ClassLoader loader,
List<Class<?>> interfaceClasses) throws MojoExecutionException {
Map<String, List<String>> serviceImplementations = new HashMap<String, List<String>>();
for (String interfa... |
java | public String readFile(String filename)
{
String path = m_fileSource.getParent();
String string = Utility.transferURLStream("file:" + path + '/' + filename, null, null, null);
if (string != null)
{
int start = string.indexOf("<repository");
if (start != -1)
... |
java | public static void multiply(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
{
result.r = a.r*b.r;
result.theta = a.theta + b.theta;
} |
java | void complete()
{
_file=_stack[_top].getFileName()+":"+_stack[_top].getLineNumber();
_method=_stack[_top].getClassName()+"."+_stack[_top].getMethodName();
_depth=_stack.length-_top;
_thread = Thread.currentThread().getName();
} |
java | public final EObject ruleJvmTypeReference() throws RecognitionException {
EObject current = null;
EObject this_JvmParameterizedTypeReference_0 = null;
EObject this_XFunctionTypeRef_3 = null;
enterRule();
try {
// InternalSARL.g:15881:2: ( ( (this_JvmParameteriz... |
java | public static servicegroup_servicegroupentitymonbindings_binding[] get(nitro_service service, String servicegroupname) throws Exception{
servicegroup_servicegroupentitymonbindings_binding obj = new servicegroup_servicegroupentitymonbindings_binding();
obj.set_servicegroupname(servicegroupname);
servicegroup_servi... |
python | def reffinder(sectionObj):
"""
add reference indeces to sectionobj['references']
:param sectionObj
:return: a section obj w references: field
"""
text = sectionObj['text']
reftags = [x for x in refTagRegEx.finditer(text)]
if reftags:
references = []
for tag in reftags:
... |
java | static MetadataVersion parsePreRelease(String preRelease) {
VersionParser parser = new VersionParser(preRelease);
return parser.parsePreRelease();
} |
java | public static void createDirectory( File directory ) throws IOException {
if( ! directory.exists()
&& ! directory.mkdirs())
throw new IOException( "The directory " + directory + " could not be created." );
} |
python | def get_install_requires_odoo_addons(addons_dir,
depends_override={},
external_dependencies_override={},
odoo_version_override=None):
""" Get the list of requirements for a directory containing addons """
... |
python | def encrypt_assertion(self, statement, enc_key, template, key_type='des-192', node_xpath=None):
"""
Will encrypt an assertion
:param statement: A XML document that contains the assertion to encrypt
:param enc_key: File name of a file containing the encryption key
:param template... |
java | @Override
public void addPermissions(IPermission[] permissions) throws AuthorizationException {
if (permissions.length > 0) {
getPermissionStore().add(permissions);
if (this.cachePermissions) {
removeFromPermissionsCache(permissions);
}
}
} |
python | def make_obj_iter(text_iter, query):
"""
convert text cdx stream to CDXObject/IDXObject.
"""
if query.secondary_index_only:
cls = IDXObject
else:
cls = CDXObject
return (cls(line) for line in text_iter) |
python | def defragment(path):
'''
Defragment mounted BTRFS filesystem.
In order to defragment a filesystem, device should be properly mounted and writable.
If passed a device name, then defragmented whole filesystem, mounted on in.
If passed a moun tpoint of the filesystem, then only this mount point is de... |
python | def ConvertToWireFormat(self, value):
"""Encode the nested protobuf into wire format."""
data = value.SerializeToString()
return (self.encoded_tag, VarintEncode(len(data)), data) |
python | def create_domain(self, domain_name):
"""
Create a SimpleDB domain.
:type domain_name: string
:param domain_name: The name of the new domain
:rtype: :class:`boto.sdb.domain.Domain` object
:return: The newly created domain
"""
params = {'DomainName':domai... |
java | private final IMessage playVOD(boolean withReset, long itemLength) throws IOException {
IMessage msg = null;
// change state
subscriberStream.setState(StreamState.PLAYING);
if (withReset) {
releasePendingMessage();
}
sendVODInitCM(currentItem.get());
/... |
python | def do_work_unit(self, args):
'''print basic details about work units'''
work_spec_name = self._get_work_spec_name(args)
for work_unit_name in args.unit:
status = self.task_master.get_work_unit_status(work_spec_name,
work_uni... |
java | public static void checkHeaderTypes(Map<String, Object> headers) {
if (headers.containsKey(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER)) {
String number = headers.get(IntegrationMessageHeaderAccessor.SEQUENCE_NUMBER).toString();
headers.put(IntegrationMessageHeaderAccessor.SEQUENCE_... |
java | public static List<Integer> getCurrentRowIndex(final WComponent component) {
UIContext uic = UIContextHolder.getCurrent();
// Check have correct context
if (!(uic instanceof SubUIContext)) {
return null;
}
// Find the table
WTable table = WebUtilities.getAncestorOfClass(WTable.class, component);
if (t... |
java | public boolean contain(OidcTokenImplBase token) { //(IdToken token) {
String key = token.getJwtId();
if (key == null) {
return false;
}
key = getCacheKey(token);
long currentTimeMilliseconds = (new Date()).getTime();
synchronized (primaryTable) {
... |
java | @SuppressWarnings("deprecation")
private boolean isRedirectType(int typeId) {
try {
return typeId == OpenCms.getResourceManager().getResourceType(RECOURCE_TYPE_NAME_REDIRECT).getTypeId();
} catch (Exception e) {
return false;
}
} |
python | def send_request(url, method, data,
args, params, headers, cookies, timeout, is_json, verify_cert):
"""
Forge and send HTTP request.
"""
## Parse url args
for p in args:
url = url.replace(':' + p, str(args[p]))
try:
if data:
if is_json:
headers['Content-Type'] = 'application/json'
data = json.du... |
python | def replace_many(expression: Expression, replacements: Sequence[Tuple[Sequence[int], Replacement]]) -> Replacement:
r"""Replaces the subexpressions of *expression* at the given positions with the given replacements.
The original *expression* itself is not modified, but a modified copy is returned. If the repla... |
python | def download_without_progress(url):
"""
Download data from a URL, returning a BytesIO containing the loaded data.
Parameters
----------
url : str
A URL that can be understood by ``requests.get``.
Returns
-------
data : BytesIO
A BytesIO containing the downloaded data.
... |
java | public int intersectAab(Vector3fc min, Vector3fc max, int mask, int startPlane) {
return intersectAab(min.x(), min.y(), min.z(), max.x(), max.y(), max.z(), mask, startPlane);
} |
python | def update(self, photo, **kwds):
"""
Endpoint: /photo/<id>/update.json
Updates a photo with the specified parameters.
Returns the updated photo object.
"""
result = self._client.post("/photo/%s/update.json" %
self._extract_id(photo),
... |
java | @SuppressWarnings("unchecked")
public static <OBJ> JsonResponse<OBJ> asEmptyBody() { // user interface
return (JsonResponse<OBJ>) new JsonResponse<Object>(DUMMY).ofEmptyBody();
} |
java | public void initialRead() {
try {
this.buffer = this.isc.getRequestBodyBuffer();
if (null != this.buffer) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Buffer returned from getRequestBodyBuffer : " + this.buffer);
... |
python | def unregister(self, fileobj):
""" Unregister a file object from being monitored. """
try:
key = self._fd_to_key.pop(self._fileobj_lookup(fileobj))
except KeyError:
raise KeyError("{0!r} is not registered".format(fileobj))
# Getting the fileno of a closed socket ... |
java | @Override
public void activate(RuleBlock ruleBlock) {
if (FuzzyLite.isDebugging()) {
FuzzyLite.logger().log(Level.FINE, "Activation: {0} {1}",
new String[]{getClass().getName(), parameters()});
}
TNorm conjunction = ruleBlock.getConjunction();
SNorm di... |
python | def usage(self, period=None, start=None, end=None):
""" Get account usage information
:param period: Period is one of either hourly, daily or monthly
:type period: str
:param start: Determines time period of the usage
:type start: int
:param end: Dete... |
python | def refine_from_user_input(parent_requirements, specification, jamfile_module,
location):
"""Refines requirements with requirements provided by the user.
Specially handles "-<property>value" syntax in specification
to remove given requirements.
- parent-requirements -- prope... |
python | def format_sql_storage_update_settings(result):
'''
Formats the SqlStorageUpdateSettings object removing arguments that are empty
'''
from collections import OrderedDict
# Only display parameters that have content
order_dict = OrderedDict()
if result.disk_count is not None:
order_dic... |
python | def _domino_hand(d, hands):
'''
:param Domino d: domino to find within the hands
:param list hands: hands to find domino in
:return: index of the hand that contains the specified domino
:raises NoSuchDominoException: if no hand contains the specified domino
'''
for i, hand in enumerate(hands... |
java | @Override
public boolean getBooleanCellValue() {
CellType cellType = getCellType();
switch(cellType) {
case BLANK:
return false;
case BOOLEAN:
return rawContents != null && TRUE_AS_STRING.equals(rawContents);
case FORMULA:
throw new NotSupportedException();
defa... |
python | def send_security_email(data):
"""Celery task to send security email.
:param data: Contains the email data.
"""
msg = Message()
msg.__dict__.update(data)
current_app.extensions['mail'].send(msg) |
python | def cmd_feed():
"""
Показывает последние операции в ленте.
"""
r = rocket.operations.cool_feed.get()
r = handle_error(r)
j = r.json()
lines = []
for date, operations in sorted(list(j["dates"].items())):
lines += [[
click.style("===== %s =====" % date, fg="blue", bol... |
java | private TileResultSet retrieveSortedTileResults(
BoundingBox projectedRequestBoundingBox, TileMatrix tileMatrix) {
TileResultSet tileResults = null;
if (tileMatrix != null) {
// Get the tile grid
TileGrid tileGrid = TileBoundingBoxUtils.getTileGrid(
coverageBoundingBox, tileMatrix.getMatrixWidth(),... |
python | def _horizontalShift(self):
"""List should be plased such way, that typed text in the list is under
typed text in the editor
"""
strangeAdjustment = 2 # I don't know why. Probably, won't work on other systems and versions
return self.fontMetrics().width(self.model().typedText())... |
java | public FutureData<PylonResult> analyze(PylonQuery query) {
if (query == null) {
throw new IllegalArgumentException("A valid analyze request body is required to analyze a stream");
}
FutureData<PylonResult> future = new FutureData<PylonResult>();
URI uri = newParams().forURL(c... |
java | private Deferred<Object> addPointInternal(final long timestamp,
final byte[] value, final short flags) {
if (row == null) {
throw new IllegalStateException("setSeries() never called!");
}
final boolean ms_timestamp = (timestamp & Const.SECOND_MASK) != 0;
// we only accept unix epoch timesta... |
python | def handle_get_request(self, environ, start_response):
"""Handle a long-polling GET request from the client."""
connections = [
s.strip()
for s in environ.get('HTTP_CONNECTION', '').lower().split(',')]
transport = environ.get('HTTP_UPGRADE', '').lower()
if 'upgrad... |
java | public static <T> T getOrCreate(T instance, ClassLoader classLoader, String className) {
if (instance != null) {
return instance;
} else if (className != null) {
try {
return ClassLoaderUtil.newInstance(classLoader, className);
} catch (Exception e) {
... |
python | def clone_pod(self, source, dest, **kwargs):
"""Clone an existing pod to a new one.
:param source: Name of the pod the be cloned.
:type source: str
:param dest: Name of the target pod to clone into
:type dest: str
:param \*\*kwargs: See the REST API Guide on your array f... |
java | void parseCmdLine(String[] args) {
JCommander parser = new JCommander(this, args);
parser.setProgramName("GA4GHPicardRunner");
LOG.info("Cmd line parsed");
} |
python | def rs_find_error_evaluator(synd, err_loc, nsym):
'''Compute the error (or erasures if you supply sigma=erasures locator polynomial, or errata) evaluator polynomial Omega from the syndrome and the error/erasures/errata locator Sigma. Omega is already computed at the same time as Sigma inside the Berlekamp-Massey im... |
python | def publish(self, topic, payload, qos, retain):
"""Publish an MQTT message."""
self._mqttc.publish(topic, payload, qos, retain) |
java | public Container withNetworkInterfaces(NetworkInterface... networkInterfaces) {
if (this.networkInterfaces == null) {
setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList<NetworkInterface>(networkInterfaces.length));
}
for (NetworkInterface ele : networkInterfaces) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.