language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public void eUnset(int featureID) {
switch (featureID) {
case AfplibPackage.GSMC__CELLWI:
setCELLWI(CELLWI_EDEFAULT);
return;
case AfplibPackage.GSMC__CELLHI:
setCELLHI(CELLHI_EDEFAULT);
return;
}
super.eUnset(featureID);
} |
java | public final boolean isRecurring() {
return recurrenceRule != null && !(recurrenceRule.get() == null) && !recurrenceRule.get().trim().equals(""); //$NON-NLS-1$
} |
java | public void execute() throws MongobeeException {
if (!isEnabled()) {
logger.info("Mongobee is disabled. Exiting.");
return;
}
validateConfig();
if (this.mongoClient != null) {
dao.connectMongoDb(this.mongoClient, dbName);
} else {
dao.connectMongoDb(this.mongoClientURI, dbN... |
java | public ServiceFuture<ExpressRouteCircuitAuthorizationInner> createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback<ExpressRouteCircuitAuthorizationInner> serviceCallback) {
return ServiceFut... |
python | def printlet(flatten=False, **kwargs):
"""
Print chunks of data from a chain
:param flatten: whether to flatten data chunks
:param kwargs: keyword arguments as for :py:func:`print`
If ``flatten`` is :py:const:`True`, every chunk received is unpacked.
This is useful when passing around connecte... |
python | def _imgdata(self, width, height,
state_size=None, start='', dataset=''):
"""Generate image pixels.
Parameters
----------
width : `int`
Image width.
height : `int`
Image height.
state_size : `int` or `None`, optional
S... |
java | public MultiPolygonMarkers addMultiPolygonToMapAsMarkers(
GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
MultiPolygonOptions multiPolygon,
MarkerOptions polygonMarkerOptions,
MarkerOptions polygonMarkerHoleOptions,
PolygonOptions globalPolygonOptions) {
... |
java | public List<KbPredicate> getMethodPredicates() {
Set<KbPredicate> set = new HashSet<KbPredicate>();
for (MethodObj method : getMethods()) {
set.add(method.getPredicate());
}
List<KbPredicate> list = new ArrayList(set);
Collections.sort(list, new Comparator<KbPredicate>() {
@Override
... |
java | public byte[] getByteArray(final String key, final byte[] def) {
try {
return systemRoot.getByteArray(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system crash on system issues
return def;
}
} |
java | public String getLabel()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getLabel");
SibTr.exit(tc, "getLabel", label);
}
return label;
} |
python | def load_sequences_to_reference(self, sc=None, force_rerun=False):
"""Wrapper for _load_sequences_to_reference_gene"""
log.info('Loading sequences to reference GEM-PRO...')
from random import shuffle
g_ids = [g.id for g in self.reference_gempro.functional_genes]
shuffle(g_ids)
... |
java | protected long checksum_impl() {
long xs = 0x600DL;
int count = 0;
Field[] fields = Weaver.getWovenFields(this.getClass());
Arrays.sort(fields,
new Comparator<Field>() {
public int compare(Field field1, Field field2) {
return field1.get... |
python | def p_insertx(self,t):
"expression : kw_insert kw_into NAME opt_paren_namelist kw_values '(' commalist ')' opt_returnx"
t[0] = InsertX(t[3],t[4],t[7].children,t[9]) |
python | def standard_exc_info(self):
"""Standard python exc_info for re-raising"""
tb = self.frames[0]
# the frame will be an actual traceback (or transparent proxy) if
# we are on pypy or a python implementation with support for tproxy
if type(tb) is not TracebackType:
tb = ... |
java | private boolean connected(NodeCursor start, long end, int[][] typedDirections) {
try (RelationshipTraversalCursor relationship = ktx.cursors().allocateRelationshipTraversalCursor()) {
start.allRelationships(relationship);
while (relationship.next()) {
if (relationship.nei... |
python | def stop_notifications(self):
"""Stop the notifications thread.
:returns:
"""
with self._notifications_lock:
if not self.has_active_notification_thread:
return
thread = self._notifications_thread
self._notifications_thread = None
... |
java | public static void assertXpathsEqual(String controlXpath, String testXpath,
Document document)
throws XpathException {
assertXpathsEqual(controlXpath, document, testXpath, document);
} |
python | def getItemLocals(item):
'''
Iterate the locals of an item and yield (name,valu) pairs.
Example:
for name,valu in getItemLocals(item):
dostuff()
'''
for name in dir(item):
try:
valu = getattr(item, name, None)
yield name, valu
except Exc... |
java | private MultiValueMap<String, String> union(MultiValueMap<String, String> map1, MultiValueMap<String, String> map2) {
MultiValueMap<String, String> union = new LinkedMultiValueMap<String, String>(map1);
Set<Entry<String, List<String>>> map2Entries = map2.entrySet();
for (Iterator<Entry<String, List<String>>> entr... |
python | def handle_read(repo, **kwargs):
"""handles reading repo information"""
log.info('read: %s %s' %(repo, kwargs))
if type(repo) in [unicode, str]:
return {'name': 'Repo', 'desc': 'Welcome to Grit', 'comment': ''}
else:
return repo.serialize() |
python | def _first_of_quarter(self, day_of_week=None):
"""
Modify to the first occurrence of a given day of the week
in the current quarter. If no day_of_week is provided,
modify to the first day of the quarter. Use the supplied consts
to indicate the desired day_of_week, ex. pendulum.MO... |
java | public EEnum getPGPRGPGorient() {
if (pgprgpGorientEEnum == null) {
pgprgpGorientEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(125);
}
return pgprgpGorientEEnum;
} |
java | public Observable<LabAccountInner> createOrUpdateAsync(String resourceGroupName, String labAccountName, LabAccountInner labAccount) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, labAccountName, labAccount).map(new Func1<ServiceResponse<LabAccountInner>, LabAccountInner>() {
@Ove... |
python | def __method_descriptor(self, service, method_info,
protorpc_method_info):
"""Describes a method.
Args:
service: endpoints.Service, Implementation of the API as a service.
method_info: _MethodInfo, Configuration for the method.
protorpc_method_info: protorpc.remote._... |
python | def _get_gc2_coordinates_for_rupture(self, edge_sets):
"""
Calculates the GC2 coordinates for the nodes of the upper edge of the
fault
"""
# Establish GC2 length - for use with Ry0
rup_gc2t, rup_gc2u = self.get_generalised_coordinates(
edge_sets[:, 0], edge_s... |
java | public final void setDialogHeaderIcon(@DrawableRes final int resourceId) {
this.dialogHeaderIcon = AppCompatResources.getDrawable(getContext(), resourceId);
this.dialogHeaderIconBitmap = null;
this.dialogHeaderIconId = resourceId;
} |
java | public static Matrix reduce(Matrix source) {
Matrix response = Matrix.Factory.zeros(source.getRowCount(), 1);
for (int row = 0; row < source.getRowCount(); ++row) {
response.setAsDouble(row, row, 0);
}
return source.getRowCount() == source.getColumnCount() ? Ginv.reduce(source, response)
: response;
} |
python | def _normalize(image):
"""Normalize the image to zero mean and unit variance."""
offset = tf.constant(MEAN_RGB, shape=[1, 1, 3])
image -= offset
scale = tf.constant(STDDEV_RGB, shape=[1, 1, 3])
image /= scale
return image |
python | def parse_skewer_log(self, f):
""" Go through log file looking for skewer output """
fh = f['f']
regexes = {
'fq1': "Input file:\s+(.+)",
'fq2': "Paired file:\s+(.+)",
'r_processed': "(\d+) read|reads pairs? processed",
'r_short_filtered': "(\d+) \... |
java | @Nonnull
public final Launcher decorateByEnv(@Nonnull EnvVars _env) {
final EnvVars env = new EnvVars(_env);
final Launcher outer = this;
return new Launcher(outer) {
@Override
public boolean isUnix() {
return outer.isUnix();
}
... |
java | public static Observable<byte[]> encode(Observable<String> src, final CharsetEncoder charsetEncoder) {
return src.map(new Func1<String, byte[]>() {
@Override
public byte[] call(String str) {
CharBuffer cb = CharBuffer.wrap(str);
ByteBuffer bb;
... |
java | @Override
public Object getData() {
Object data = super.getData();
// Treat "empty" the same as null (ie no selection)
boolean empty = false;
if (data == null) {
empty = true;
} else if (data instanceof List<?>) {
empty = ((List<?>) data).isEmpty();
} else if (data instanceof Object[]) {
empty = ... |
python | def clean(bundle, before, after, keep_last):
"""Clean up data downloaded with the ingest command.
"""
bundles_module.clean(
bundle,
before,
after,
keep_last,
) |
python | def q_prior(q, m=1, gamma=0.3, qmin=0.1):
"""Default prior on mass ratio q ~ q^gamma
"""
if q < qmin or q > 1:
return 0
C = 1/(1/(gamma+1)*(1 - qmin**(gamma+1)))
return C*q**gamma |
java | public SqlBuilder having(String having) {
if (StrUtil.isNotBlank(having)) {
sql.append(" HAVING ").append(having);
}
return this;
} |
java | public static LongDeserializer getDeserializer(int longSize, ByteBuffer fromBuffer, int bufferOffset)
{
// The buffer needs to be duplicated since the byte order is changed
ByteBuffer buffer = fromBuffer.duplicate().order(ByteOrder.BIG_ENDIAN);
switch (longSize) {
case 1:
return new Size1Des... |
java | public boolean isSecuredByPermission(final String permission,
UserIdentityContext userIdentityContext) {
try {
checkPermission(permission,userIdentityContext);
return true;
} catch (AuthorizationException e) {
return false;
}
} |
python | def get_saved_rules(conf_file=None):
'''
Return a data structure of the rules in the conf file
CLI Example:
.. code-block:: bash
salt '*' nftables.get_saved_rules
'''
if _conf() and not conf_file:
conf_file = _conf()
with salt.utils.files.fopen(conf_file) as fp_:
... |
python | def _convert_sky_coords(self):
"""
Convert to sky coordinates
"""
parsed_angles = [(x, y)
for x, y in zip(self.coord[:-1:2], self.coord[1::2])
if (isinstance(x, coordinates.Angle) and isinstance(y, coordinates.Angle))
... |
python | def _convert_to_bytes(type_name, value):
"""Convert a typed value to a binary array"""
int_types = {'uint8_t': 'B', 'int8_t': 'b', 'uint16_t': 'H', 'int16_t': 'h', 'uint32_t': 'L', 'int32_t': 'l'}
type_name = type_name.lower()
if type_name not in int_types and type_name not in ['string', 'binary']:
... |
java | private void throwExStrParam(MethodVisitor mv, Class<?> exCls) {
String exSig = Type.getInternalName(exCls);
mv.visitTypeInsn(NEW, exSig);
mv.visitInsn(DUP);
mv.visitLdcInsn("mapping " + this.className + " failed to map field:");
mv.visitVarInsn(ALOAD, 2);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String... |
python | def attrget(self, groupname, attrname, rownr):
"""Get the value of an attribute in the given row in a group."""
return self._attrget(groupname, attrname, rownr) |
python | def harmonize_ocean(ocean, elevation, ocean_level):
"""
The goal of this function is to make the ocean floor less noisy.
The underwater erosion should cause the ocean floor to be more uniform
"""
shallow_sea = ocean_level * 0.85
midpoint = shallow_sea / 2.0
ocean_points = numpy.logical_and... |
java | private Kam lookupKam(KamNode kamNode, Dialect dialect,
final String errorMsg)
throws KamCacheServiceException, InvalidIdException,
RequestException {
KamStoreObjectRef kamNodeRef = Converter.decodeNode(kamNode);
KamInfo kamInfo = null;
try {
kamIn... |
java | public static <K, V> CacheEvent<K, V> creation(K newKey, V newValue, Cache<K, V> source) {
return new CreationEvent<>(newKey, newValue, source);
} |
python | def disconnect(self, message=""):
"""Hang up the connection.
Arguments:
message -- Quit message.
"""
try:
del self.connected
except AttributeError:
return
self.quit(message)
try:
self.socket.shutdown(socket.SHUT_... |
python | def source_headers(self):
""""Returns the headers for the resource source. Specifically, does not include any header that is
the EMPTY_SOURCE_HEADER value of _NONE_"""
t = self.schema_term
if t:
return [self._name_for_col_term(c, i)
for i, c in enumerate... |
python | def sigma2(self,R,log=False):
"""
NAME:
sigma2
PURPOSE:
return the radial velocity variance at this R
INPUT:
R - Galactocentric radius (/ro)
log - if True, return the log (default: False)
OUTPUT:
sigma^2(R)
HISTORY:
... |
java | @SuppressWarnings({"unchecked"})
public static <T> Iterator<T> cast(Iterator<? extends T> itr) {
return (Iterator)itr;
} |
java | public static base_response add(nitro_service client, iptunnel resource) throws Exception {
iptunnel addresource = new iptunnel();
addresource.name = resource.name;
addresource.remote = resource.remote;
addresource.remotesubnetmask = resource.remotesubnetmask;
addresource.local = resource.local;
addresource... |
python | def _agent_notification(self, context, method, hosting_devices, operation):
"""Notify individual Cisco cfg agents."""
admin_context = context.is_admin and context or context.elevated()
for hosting_device in hosting_devices:
agents = self._dmplugin.get_cfg_agents_for_hosting_devices(
... |
java | private void internalWrite(final byte[] data) throws IOException {
if (!canBeContinued(data, policies)) {
writer.close();
String fileName = path.resolve();
deleteBackups(path.getAllFiles(), backups);
writer = createByteArrayWriter(fileName, false, buffered, false, false);
for (Policy policy : policie... |
python | def _update_count(self, index):
"""Updates num_update.
Parameters
----------
index : int or list of int
The index to be updated.
"""
if not isinstance(index, (list, tuple)):
index = [index]
for idx in index:
if idx not in self.... |
java | @Override
public long next(){
long l;
do{
l = super.next();
} while (l >= loopSpot);
return offset + l % range;
} |
java | @SuppressWarnings("rawtypes")
@Override
protected Object convertToType(Class type, Object value) throws Throwable {
String[] strings = value.toString().split(",");
if (strings.length != 2) {
throw new ConversionException(
"GeoPt 'value' must be able to be splitted into 2 float values "
+ "by ','... |
java | protected final List<String> getSessionPermissions() {
if (sessionTracker != null) {
Session currentSession = sessionTracker.getSession();
return (currentSession != null) ? currentSession.getPermissions() : null;
}
return null;
} |
python | def download(self, obj, path=None, show_progress=True, resume=True,
auto_retry=True, proapi=False):
"""
Download a file
:param obj: :class:`.File` object
:param str path: local path
:param bool show_progress: whether to show download progress
:param bool... |
java | public static PortalRequest unwrapPortalRequest(HttpServletRequest request) {
do {
if (request instanceof PortalRequest) {
return (PortalRequest) request;
} else if (request instanceof HttpServletRequestWrapper) {
request = (HttpServletRequest) ((Http... |
python | def romanized(locale: str = '') -> Callable:
"""Romanize the Cyrillic text.
Transliterate the Cyrillic language from the Cyrillic
script into the Latin alphabet.
.. note:: At this moment it works only for `ru`, `uk`, `kk`.
:param locale: Locale code.
:return: Latinized text.
"""
def r... |
python | def filter(self, func):
"""Create a Catalog of a subset of entries based on a condition
Note that, whatever specific class this is performed on, the return
instance is a Catalog. The entries are passed unmodified, so they
will still reference the original catalog instance and include it... |
python | def parse_date_period(date):
"""
Parse the --date value and return a couple of datetime object.
The format is [YYYY]MMDD[,[YYYY]MMDD].
"""
import datetime
now = datetime.datetime.today()
date_len = len(date)
if date_len == 4:
date1 = str(now.year) + date
date2 =... |
java | public EClass getIfcLayeredItem() {
if (ifcLayeredItemEClass == null) {
ifcLayeredItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(958);
}
return ifcLayeredItemEClass;
} |
python | def _set_signed_in(self):
"""Populate the signed_in list with the names of currently
signed in users.
"""
names = [
controller.get_user_name(user, full_name=CONFIG['FULL_USER_NAMES'])
for user in controller.signed_in_users()
]
self.lbl_signedin_lis... |
python | def __compare_ips(first, second):
"""Compare IPs
Compares two IPs and returns a status based on which is greater
If first is less than second: -1
If first is equal to second: 0
If first is greater than second: 1
Arguments:
first {str} -- A string representing an IP address
second {str} -- A string r... |
python | def load_data(self, table_name, obj, database=None, **kwargs):
"""
Wraps the LOAD DATA DDL statement. Loads data into an MapD table by
physically moving data files.
Parameters
----------
table_name : string
obj: pandas.DataFrame or pyarrow.Table
database ... |
python | def add_tarball(self, tarball, package):
"""Add a tarball, possibly creating the directory if needed."""
if tarball is None:
logger.error(
"No tarball found for %s: probably a renamed project?",
package)
return
target_dir = os.path.join(sel... |
python | def wait_until_element_clickable(self, element, timeout=None):
"""Search element and wait until it is clickable
:param element: PageElement or element locator as a tuple (locator_type, locator_value) to be found
:param timeout: max time to wait
:returns: the web element if it is clickab... |
python | def slice_slice(old_slice, applied_slice, size):
"""Given a slice and the size of the dimension to which it will be applied,
index it with another slice to return a new slice equivalent to applying
the slices sequentially
"""
step = (old_slice.step or 1) * (applied_slice.step or 1)
# For now, u... |
python | def table_format(self, columns, content):
"""
Enumerate each table column.
"""
result = []
textw = TextWidget()
for row in content:
i = 0
result_row = []
for cell in row:
result_row.append(textw.render(cell, **columns[i]... |
python | def sequence(self, other, exclude_list_fields=None):
"""Return a copy of this object which combines all the fields common to both `self` and `other`.
List fields will be concatenated.
The return type of this method is the type of `self` (or whatever `.copy()` returns), but the
`other` argument can be ... |
java | public static CmsResource initResource(
CmsObject cms,
String resourceName,
HttpServletRequest req,
HttpServletResponse res)
throws CmsException {
return OpenCmsCore.getInstance().initResource(cms, resourceName, req, res);
} |
java | public static <G extends Relatable<?>> Context downset(final CompleteLattice lattice) {
List<Object> elements = Arrays.asList(lattice.toArray());
return new Context(elements, elements, new NotGreaterOrEqual());
} |
java | public static Object invoke(ApplicationContext context, String beanName,
MethodInfo methodInfo, final Object[] params) throws IllegalArgumentException,
IllegalAccessException, InvocationTargetException {
Object bean = context.getBean(beanName);
Method handlerMethod = methodInfo.getMethod();
ReflectionUtils... |
java | private FileSystem getFileSystemSafe() throws IOException
{
try {
fs.getFileStatus(new Path("/"));
return fs;
}
catch (NullPointerException e) {
throw new IOException("file system not initialized");
}
} |
python | def parse_nni_variable(code):
"""Parse `nni.variable` expression.
Return the name argument and AST node of annotated expression.
code: annotation string
"""
name, call = parse_annotation_function(code, 'variable')
assert len(call.args) == 1, 'nni.variable contains more than one arguments'
a... |
python | def resolve_job_references(io_hash, job_outputs, should_resolve=True):
'''
:param io_hash: an input or output hash in which to resolve any job-based object references possible
:type io_hash: dict
:param job_outputs: a mapping of finished local jobs to their output hashes
:type job_outputs: dict
... |
python | def set_session(s):
"""
Configures the default connection with a preexisting :class:`cassandra.cluster.Session`
Note: the mapper presently requires a Session :attr:`~.row_factory` set to ``dict_factory``.
This may be relaxed in the future
"""
try:
conn = get_connection()
except CQL... |
python | def get_repository(name):
'''
Get the details of a local PSGet repository
:param name: Name of the repository
:type name: ``str``
CLI Example:
.. code-block:: bash
salt 'win01' psget.get_repository MyRepo
'''
# Putting quotes around the parameter protects against command i... |
python | def get_data_port_m(self, data_port_id):
"""Searches and returns the model of a data port of a given state
The method searches a port with the given id in the data ports of the given state model. If the state model
is a container state, not only the input and output data ports are looked at, bu... |
java | private void evaluateDeferredAfterMaskUpdate() {
final Iterator<DeferredAction<M>> it = this.deferred.iterator();
while (it.hasNext()) {
final DeferredAction<M> d = it.next();
/* is the current action still masked? */
if (masks.stream().anyMatch(p -> p.test(d.metadata))) {
continue;
... |
python | def wait_for_task(upid, timeout=300):
'''
Wait until a the task has been finished successfully
'''
start_time = time.time()
info = _lookup_proxmox_task(upid)
if not info:
log.error('wait_for_task: No task information '
'retrieved based on given criteria.')
raise... |
python | def has_same_unique_benchmark(self):
"True if all suites have one benchmark with the same name"
if any(len(suite) > 1 for suite in self.suites):
return False
names = self.suites[0].get_benchmark_names()
return all(suite.get_benchmark_names() == names
for su... |
java | public static Map<String, Object> getCommonParams(JsonNode paramsNode)
{
Map<String, Object> parameters = new HashMap<>();
for (JsonNode child : paramsNode)
{
// If there isn't a name then the response from GS must be erroneous.
if (!child.hasNonNull("name"))
{
logger.error("Com... |
python | def lit_count(self):
"""
The number of LEDs on the bar graph actually lit up. Note that just
like :attr:`value`, this can be negative if the LEDs are lit from last
to first.
"""
lit_value = self.value * len(self)
if not isinstance(self[0], PWMLED):
lit... |
python | def imread(img, color=None, dtype=None):
'''
dtype = 'noUint', uint8, float, 'float', ...
'''
COLOR2CV = {'gray': cv2.IMREAD_GRAYSCALE,
'all': cv2.IMREAD_COLOR,
None: cv2.IMREAD_ANYCOLOR
}
c = COLOR2CV[color]
if callable(img):
img... |
java | public OAuthHmacCredential load10aCredential(String userId) throws IOException {
if (getCredentialStore() == null) {
return null;
}
OAuthHmacCredential credential = new10aCredential(userId);
if (!getCredentialStore().load(userId, credential)) {
return null;
... |
java | public static com.liferay.commerce.model.CommerceOrderItem createCommerceOrderItem(
long commerceOrderItemId) {
return getService().createCommerceOrderItem(commerceOrderItemId);
} |
java | public void marshall(User user, ProtocolMarshaller protocolMarshaller) {
if (user == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(user.getConsoleAccess(), CONSOLEACCESS_BINDING);
protoc... |
python | def log_reject( self, block_id, vtxindex, op, op_data ):
"""
Log a rejected operation
"""
debug_op = self.sanitize_op( op_data )
if 'history' in debug_op:
del debug_op['history']
log.debug("REJECT %s at (%s, %s) data: %s", op_get_opcode_name( op ), block_id,... |
python | def get_risk_models(oqparam, kind='vulnerability vulnerability_retrofitted '
'fragility consequence'):
"""
:param oqparam:
an OqParam instance
:param kind:
a space-separated string with the kinds of risk models to read
:returns:
a dictionary riskid -> loss_typ... |
java | public void marshall(UpdateGlobalSecondaryIndexAction updateGlobalSecondaryIndexAction, ProtocolMarshaller protocolMarshaller) {
if (updateGlobalSecondaryIndexAction == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMar... |
python | def _get_value_from_json(self, dict_path, metrics_json):
"""
Get a value from a dictionary under N keys, represented as str("key1.key2...key{n}")
"""
for key in dict_path.split('.'):
if key in metrics_json:
metrics_json = metrics_json.get(key)
else... |
java | @Override
protected void executeImpl() throws TaskExecutionFailedException {
try {
String account = task.getAccount();
String storeId = task.getStoreId();
String spaceId = task.getSpaceId();
String contentId = task.getContentId();
String action = ... |
python | def registerContextEngineId(self, contextEngineId, pduTypes, processPdu):
"""Register application with dispatcher"""
# 4.3.2 -> no-op
# 4.3.3
for pduType in pduTypes:
k = contextEngineId, pduType
if k in self._appsRegistration:
raise error.Protoco... |
python | def sample_gtf(data, D, k, likelihood='gaussian', prior='laplace',
lambda_hyperparams=None, lam_walk_stdev=0.01, lam0=1.,
dp_hyperparameter=None, w_hyperparameters=None,
iterations=7000, burn=2000, thin=10,
robus... |
python | def option(self, *args, **kwargs):
"""
Registers a click.option which falls back to a configmanager Item
if user hasn't provided a value in the command line.
Item must be the last of ``args``.
Examples::
config = Config({'greeting': 'Hello'})
@click.co... |
python | def close(self):
""" Close the object nicely and release all the data
arrays from memory YOU CANT GET IT BACK, the pointers
and data are gone so use the getData method to get
the data array returned for future use. You can use
putData to reattach a new data array ... |
java | private Runnable getTask() {
boolean timedOut = false; // Did the last poll() time out?
for (;;) {
int c = ctl.get();
int rs = runStateOf(c);
// Check if queue empty only if necessary.
if (rs >= SHUTDOWN && (rs >= STOP || workQueue.isEmpty())) {
... |
java | private static Map<TypeVariable<?>, Type> invert(Map<TypeVariable<?>, Type> m) {
final TypeVariableMap result = new TypeVariableMap();
for (Map.Entry<TypeVariable<?>, Type> e : m.entrySet()) {
if (e.getValue() instanceof TypeVariable<?>) {
result.put((TypeVariable<?>) e.getVa... |
python | def inheritanceTree(self):
"""
Returns the inheritance tree for this schema, traversing up the hierarchy for the inherited schema instances.
:return: <generator>
"""
inherits = self.inherits()
while inherits:
ischema = orb.system.schema(inherits)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.