language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def volume(self):
"""int: The speaker's volume.
An integer between 0 and 100.
"""
response = self.renderingControl.GetVolume([
('InstanceID', 0),
('Channel', 'Master'),
])
volume = response['CurrentVolume']
return int(volume) |
java | private void simulateCommitBean(BeanO beanO, ContainerTx containerTx) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "simulateCommitBean");
// React to exceptions the same as afterCompletion, insure
// bot... |
java | public BuildTaskInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).toBlocking().single().body();
} |
python | def read(self, vals):
"""Read values.
Args:
vals (list): list of strings representing values
"""
i = 0
if len(vals[i]) == 0:
self.holiday_name = None
else:
self.holiday_name = vals[i]
i += 1
if len(vals[i]) == 0:
... |
python | def disk_io_counters(device=None):
'''
Return disk I/O statistics.
CLI Example:
.. code-block:: bash
salt '*' ps.disk_io_counters
salt '*' ps.disk_io_counters device=sda1
'''
if not device:
return dict(psutil.disk_io_counters()._asdict())
else:
stats = psu... |
python | def _get_openscm_var_from_filepath(filepath):
"""
Determine the OpenSCM variable from a filepath.
Uses MAGICC's internal, implicit, filenaming conventions.
Parameters
----------
filepath : str
Filepath from which to determine the OpenSCM variable.
Returns
-------
str
... |
python | def env(ctx, *args, **kwargs):
"""
print debug info about running environment
"""
import sys, platform, os, shutil
from pkg_resources import get_distribution, working_set
print("\n##################\n")
print("Information about the running environment of brother_ql.")
print("(Please prov... |
python | def select(self, selector, index_only=False):
"""
Retrieves a subset of :class:`.Paper`\s based on selection criteria.
There are a variety of ways to select :class:`.Paper`\s.
.. code-block:: python
>>> corpus = Corpus(papers)
>>> corpus[0] # Integer indices y... |
java | @Override
protected ResolutionResult resolveDependencies(String projectFolder, String topLevelFolder, Set<String> paketDependenciesFiles) {
boolean installSuccess = true;
Collection<DependencyInfo> dependencies = new ArrayList<>();
List<String> excludes = new LinkedList<>();
if (pake... |
java | final void destroyTaskJVM(TaskControllerContext context) {
Thread taskJVMDestroyer = new Thread(new DestroyJVMTaskRunnable(context));
taskJVMDestroyer.start();
if (waitForConfirmedKill) {
try {
taskJVMDestroyer.join();
} catch (InterruptedException e) {
throw new IllegalStateExce... |
java | public final void loadRepository(ClassLoader classLoader, String repositoryPackage, String repositoryName){
try{
Class repositoryClass = classLoader.loadClass(repositoryPackage + "." + repositoryName);
Repository<T> instance = (Repository<T>) repositoryClass.newInstance();
ge... |
python | def find_servers(self, *args, **kwargs):
"""
Wraps :meth:`bang.providers.openstack.Nova.find_servers` to apply
hpcloud specialization, namely pulling IP addresses from the hpcloud's
non-standard return values.
"""
servers = super(HPNova, self).find_servers(*args, **kwarg... |
java | @PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions(I18nPermissions.KEY_WRITE)
public Response updateKey(KeyRepresentation representation) throws URISyntaxException {
WebAssertions.assertNotNull(representation, THE_KEY_SHOULD_NOT_BE_NULL);
... |
python | def read_line(self, time_limit=None):
"""
Read a line from the process.
On Windows, this the time_limit has no effect, it always blocks.
"""
if self.proc is not None:
return self.proc.stdout.readline().decode()
else:
return None |
python | def differentiator(self, A):
"""Differentiate a set of Chebyshev polynomial expansion
coefficients
Originally from http://www.scientificpython.net/pyblog/chebyshev-differentiation
+ (lots of) bug fixing + pythonisation
"""
m = len(A)
SA = (A.T* 2*np.a... |
python | def get_built_image_info(self):
"""
query docker about built image
:return dict
"""
logger.info("getting information about built image '%s'", self.image)
image_info = self.tasker.get_image_info_by_image_name(self.image)
items_count = len(image_info)
if it... |
java | @Override
public int compareTo(final SelectorSpecificity other) {
if (fieldA_ != other.fieldA_) {
return fieldA_ - other.fieldA_;
}
else if (fieldB_ != other.fieldB_) {
return fieldB_ - other.fieldB_;
}
else if (fieldC_ != other.fieldC_) {
... |
python | def parse_bool(cls, value, default=None):
"""Convert ``string`` or ``bool`` to ``bool``."""
if value is None:
return default
elif isinstance(value, bool):
return value
elif isinstance(value, str):
if value == 'True':
return True
... |
java | protected void appendCapacityContextAwareWrapper(SarlCapacity source, JvmGenericType inferredJvmType) {
final JvmGenericType innerType = this.typesFactory.createJvmGenericType();
innerType.setInterface(false);
innerType.setAbstract(false);
innerType.setVisibility(JvmVisibility.PUBLIC);
innerType.setStatic(tru... |
python | def consume_vertices(self):
"""
Consumes all consecutive vertices.
NOTE: There is no guarantee this will consume all vertices since other
statements can also occur in the vertex list
"""
while True:
# Vertex color
if len(self.values) == 7:
... |
python | def stop(context):
"""Stop application server.
"""
config = context.obj["config"]
pidfile = select(config, "application.pidfile", DEFAULT_PIDFILE)
daemon_stop(pidfile) |
java | private void lockAndRegisterReferences(ClassDescriptor cld, Object sourceObject, int lockMode, List registeredObjects) throws LockNotGrantedException
{
if (implicitLocking)
{
Iterator i = cld.getObjectReferenceDescriptors(true).iterator();
while (i.hasNext())
... |
java | @Override
public String getSignature(String baseString, String apiSecret, String tokenSecret) {
try {
final Signature signature = Signature.getInstance(RSA_SHA1);
signature.initSign(privateKey);
signature.update(baseString.getBytes(UTF8));
return BASE_64_ENCOD... |
python | def annotate(self, out, filename=None, commandline=None, relative_path=False):
"""
Dump annotated source code with current profiling statistics to "out"
file.
Time unit: second.
out (file-ish opened for writing)
Destination of annotated sources.
filename (str,... |
python | def delete(self):
"""
Deletes the resource on the server.
"""
if 'delete' in self._URL:
extra = {'resource': self.__class__.__name__, 'query': {
'id': self.id}}
logger.info("Deleting {} resource.".format(self), extra=extra)
self._api.de... |
python | def _get_jail_path(jail):
'''
.. versionadded:: 2016.3.4
Return the jail's root directory (path) as shown in jls
jail
The jid or jail name
'''
jls = salt.utils.path.which('jls')
if not jls:
raise CommandNotFoundError('\'jls\' command not found')
jails = __salt__['cmd.ru... |
python | def serializeTransform(transformObj):
"""
Reserializes the transform data with some cleanups.
"""
return ' '.join([command + '(' + ' '.join([scourUnitlessLength(number) for number in numbers]) + ')'
for command, numbers in transformObj]) |
python | def python_2_unicode_compatible(klass):
"""
A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
To support Python 2 and 3 with a single code base, define a __str__ method
returning text and apply this decorator to the class.
"""
if PY2:
... |
java | public Task revertToCurrentSnapshot_Task(HostSystem host) throws VmConfigFault, SnapshotFault, TaskInProgress, InvalidState, InsufficientResourcesFault, NotFound, RuntimeFault, RemoteException {
return revertToCurrentSnapshot_Task(host, null);
} |
python | def _init_display(self):
"""!
\~english
Initialize the SSD1306 display chip
\~chinese
初始化SSD1306显示芯片
"""
self._command([
# 0xAE
self.CMD_SSD1306_DISPLAY_OFF,
#Stop Scroll
self.CMD_SSD1306_SET_SCROLL_DEACTIVE,
... |
java | public Map<String, List<CmsRelation>> validateRelations(
CmsRequestContext context,
CmsPublishList publishList,
I_CmsReport report)
throws Exception {
Map<String, List<CmsRelation>> result = null;
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
... |
java | @SuppressWarnings("unchecked")
@Override
public void setSelectedItem(final Object anItem)
{
selectedItem = (T)anItem;
this.fireContentsChanged(this, 0, getSize());
} |
java | JCExpression literal(Name prefix, int pos) {
JCExpression t = errorTree;
switch (token.kind) {
case INTLITERAL:
try {
t = F.at(pos).Literal(
TypeTag.INT,
Convert.string2int(strval(prefix), token.radix()));
} catch (N... |
python | def validate_backup(configuration, backup_data):
"""Celery task.
It will extract the backup archive into a unique folder
in the temporary directory specified in the configuration.
Once extracted, a Docker container will be started and will
start a restoration procedure. The worker will wait for the... |
java | static final public LocalRateOptions parseRateOptions(boolean rate, String spec) {
if (!rate || spec.length() < 6) {
return new LocalRateOptions();
}
String[] parts = spec.split(spec.substring(5, spec.length() - 1), ',');
if (parts.length < 1 || parts.length > 3) {
return new LocalRateOptio... |
java | @Override
public final boolean satisfiedForFlowOrdering(FilterOutcomes outcomes) {
if (isAlwaysSatisfiedRequirement()) {
return true;
}
final ComponentRequirement componentRequirement = _hasComponentRequirement.getComponentRequirement();
if (componentRequirement == null)... |
python | def savecands(d, cands, domock=False):
""" Save all candidates in pkl file for later aggregation and filtering.
domock is option to save simulated cands file
"""
with open(getcandsfile(d, domock=domock), 'w') as pkl:
pickle.dump(d, pkl)
pickle.dump(cands, pkl) |
python | def build_request(self, input_data=None, api_data=None, aux_data=None, *args, **kwargs):
"""
Builds request
:param input_data:
:param api_data:
:param aux_data:
:param args:
:param kwargs:
:return:
"""
if input_data is not None:
... |
python | def get_version(
here_path,
default_version=DEFAULT_VERSION,
):
"""tries to resolve version number
Args:
here_path (str): path to project local dir
default_version (str): what version to return if all else fails
Returns:
str: semantic_version information for library... |
java | public static MozuUrl deleteCustomRouteSettingsUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/customroutes");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} |
java | public static void setMetaClass(GroovyObject self, MetaClass metaClass) {
// this method was introduced as to prevent from a stack overflow, described in GROOVY-5285
if (metaClass instanceof HandleMetaClass)
metaClass = ((HandleMetaClass)metaClass).getAdaptee();
self.setMetaClass(me... |
python | def _check_model_types(self, models):
""" Check types of passed models for correctness and in case raise exception
:rtype: set
:returns: set of models that are valid for the class"""
if not hasattr(models, "__iter__"):
models = {models}
if not all([isinstance(model, ... |
python | def remove_update_callback(self, group, name=None, cb=None):
"""Remove the supplied callback for a group or a group.name"""
if not cb:
return
if not name:
if group in self.group_update_callbacks:
self.group_update_callbacks[group].remove_callback(cb)
... |
java | @Override
public CommercePriceEntry findByCompanyId_First(long companyId,
OrderByComparator<CommercePriceEntry> orderByComparator)
throws NoSuchPriceEntryException {
CommercePriceEntry commercePriceEntry = fetchByCompanyId_First(companyId,
orderByComparator);
if (commercePriceEntry != null) {
return co... |
java | public static boolean isInstalled(int major, int minor, String targetMachine, IJIAuthInfo session) throws JIException, UnknownHostException {
IJIWinReg registry = JIWinRegFactory.getSingleTon().getWinreg(session,targetMachine,true);
JIPolicyHandle hklm=null;
JIPolicyHandle key=null;
try... |
python | def add_to_current_action(self, controller):
"""Add a controller to the current action."""
item = self.current_item
self._history[self._index] = item + (controller,) |
java | public CProgram convert(String path, ProgramType program) {
ImmutableList.Builder<PDeclaredDescriptor<?>> declaredTypes = ImmutableList.builder();
ImmutableList.Builder<CConst> constants = ImmutableList.builder();
ImmutableMap.Builder<String, String> typedefs = ImmutableMap.builder();
Im... |
java | public AsyncMethodType<SessionBeanType<T>> getOrCreateAsyncMethod()
{
List<Node> nodeList = childNode.get("async-method");
if (nodeList != null && nodeList.size() > 0)
{
return new AsyncMethodTypeImpl<SessionBeanType<T>>(this, "async-method", childNode, nodeList.get(0));
}
ret... |
python | def deserialize(stream_or_string, **options):
'''
Deserialize any string of stream like object into a Python data structure.
:param stream_or_string: stream or string to deserialize.
:param options: options given to lower yaml module.
'''
options.setdefault('Loader', Loader)
try:
r... |
python | def pub_date(soup):
"""
Return the publishing date in struct format
pub_date_date, pub_date_day, pub_date_month, pub_date_year, pub_date_timestamp
Default date_type is pub
"""
pub_date = first(raw_parser.pub_date(soup, date_type="pub"))
if pub_date is None:
pub_date = first(raw_parse... |
python | def _add_debugging_fields(gelf_dict, record):
"""Add debugging fields to the given ``gelf_dict``
:param gelf_dict: dictionary representation of a GELF log.
:type gelf_dict: dict
:param record: :class:`logging.LogRecord` to extract debugging
fields from to insert into the gi... |
java | @Override
public void sendRequestWait(final KNXAddress dst, final Priority p, final byte[] nsdu)
throws KNXTimeoutException, KNXLinkClosedException
{
final int mc = mode == TUNNELING ? CEMILData.MC_LDATA_REQ : CEMILData.MC_LDATA_IND;
send(mc, dst, p, nsdu, true);
} |
java | public void marshall(DisableTopicRuleRequest disableTopicRuleRequest, ProtocolMarshaller protocolMarshaller) {
if (disableTopicRuleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(disableTop... |
java | private static boolean isIdentifier( StringBuilder builder ) {
char ch = 0;
int i;
for( i = 0; i < builder.length(); ) {
ch = builder.charAt( i++ );
if( !Character.isWhitespace( ch ) ) {
break;
}
}
FIRST: do {
switch... |
python | def normalize_pipeline_name(name=''):
"""Translate unsafe characters to underscores."""
normalized_name = name
for bad in '\\/?%#':
normalized_name = normalized_name.replace(bad, '_')
return normalized_name |
java | public static AsmGauge registerWorkerGauge(String topologyId, String name, AsmGauge gauge) {
return (AsmGauge) registerWorkerMetric(
MetricUtils.workerMetricName(topologyId, host, 0, name, MetricType.GAUGE), gauge);
} |
python | def replace(self, text, to_template='{name} ({url})', from_template=None,
name_matcher=Matcher(looks_like_name), url_matcher=Matcher(r'.*[^:]+$')):
""" Replace all occurrences of rendered from_template in text with `template` rendered from each match.groupdict()
TODO: from_template
... |
python | def disable_auth_method(self, path):
"""Disable the auth method at the given auth path.
Supported methods:
DELETE: /sys/auth/{path}. Produces: 204 (empty body)
:param path: The path the method was mounted on. If not provided, defaults to the value of the "method_type"
a... |
python | def get_task_df(self):
'''
Returns
-------
'''
term_time_df = self._get_term_time_df()
terms_to_include = (
term_time_df
.groupby('term')['top']
.sum()
.sort_values(ascending=False)
.iloc[:self.num_terms_to_include].index
)
task_df = (
term_time_df[term_time_df.term.isin(terms_to_... |
python | def get_relationship_query_session(self):
"""Gets the ``OsidSession`` associated with the relationship query service.
return: (osid.relationship.RelationshipQuerySession) - a
``RelationshipQuerySession``
raise: OperationFailed - unable to complete request
raise: Unimpl... |
python | def compiler_version():
""" Return the version of the installed solc. """
version_info = subprocess.check_output(['solc', '--version'])
match = re.search(b'^Version: ([0-9a-z.-]+)/', version_info, re.MULTILINE)
if match:
return match.group(1) |
python | def draw_quality_plot(db_file, plot_file, position_select, title):
"""Draw a plot of remapped qualities using ggplot2.
Remapping information is pulled from the sqlite3 database using sqldf
according to the position select attribute, which is a selection phrase like
'> 50' or '=28'.
plyr is used to... |
python | def _scalar_from_string(
self,
value: str,
) -> Union[Period, Timestamp, Timedelta, NaTType]:
"""
Construct a scalar type from a string.
Parameters
----------
value : str
Returns
-------
Period, Timestamp, or Timedelta, or NaT... |
python | def restore_descriptor(self, dataframe):
"""Restore descriptor from Pandas
"""
# Prepare
fields = []
primary_key = None
# Primary key
if dataframe.index.name:
field_type = self.restore_type(dataframe.index.dtype)
field = {
... |
python | def sendCommand(self, **msg):
"""
Sends a raw command to the Slack server, generating a message ID automatically.
"""
assert 'type' in msg, 'Message type is required.'
msg['id'] = self.next_message_id
self.next_message_id += 1
if self.next_message_id >= maxint:
self.next_message_id = 1
self.sendMe... |
python | def add_time_variables(df, reindex = True):
"""
Return a DataFrame with variables for weekday index, weekday name, timedelta
through day, fraction through day, hours through day and days through week
added, optionally with the index set to datetime and the variable `datetime`
removed. It is assumed ... |
java | public void encodeData(AsnOutputStream asnOs) throws MAPException {
if (this.pdpType == null || this.qosSubscribed == null || this.apn == null) {
throw new MAPException("pdpType, qosSubscribed and apn parameters must not be null");
}
try {
asnOs.writeInteger((int) this.... |
java | public synchronized void setExecutors(ExecutorService svc) {
ExecutorService old = this.executors;
this.executors = svc;
// gradually executions will be taken over by a new pool
old.shutdown();
} |
python | def cmd_sync(self, low):
'''
Execute a salt-ssh call synchronously.
.. versionadded:: 2015.5.0
WARNING: Eauth is **NOT** respected
.. code-block:: python
client.cmd_sync({
'tgt': 'silver',
'fun': 'test.ping',
'arg': ... |
java | public HourRange joinWithNextDay(@NotNull final HourRange other) {
Contract.requireArgNotNull("other", other);
if (!this.to.equals(new Hour(24, 0))) {
throw new ConstraintViolationException("The 'to' hour value of this instance is not '24:00', but was: '" + this.to + "'");
}
... |
python | def generichash_blake2b_update(state, data):
"""Update the blake2b hash state
:param state: a initialized Blake2bState object as returned from
:py:func:`.crypto_generichash_blake2b_init`
:type state: :py:class:`.Blake2State`
:param data:
:type data: bytes
"""
ensure(is... |
java | public int getMaxFieldLenth()
{
//get max field name
int maxLen = 0;
for ( String s : keys )
{
maxLen = s.length() > maxLen ? s.length() : maxLen;
}
return maxLen+1;
} |
python | def get(self, *args, **kwargs):
"""
The base activation logic; subclasses should leave this method
alone and implement activate(), which is called from this
method.
"""
extra_context = {}
try:
activated_user = self.activate(*args, **kwargs)
ex... |
python | def sbo_network(self):
"""View slackbuilds packages
"""
flag = []
options = [
"-n",
"--network"
]
additional_options = [
"--checklist",
"--case-ins"
]
for add in additional_options:
if add in self... |
java | public List<String> getServiceImplementations(String serviceTypeName) {
final List<String> strings = services.get(serviceTypeName);
return strings == null ? Collections.<String>emptyList() : Collections.unmodifiableList(strings);
} |
python | def outgoing_edges(self, node):
"""
Returns a ``tuple`` of outgoing edges for a **node object**.
Arguments:
- node(``object``) **node object** present in the graph to be queried
for outgoing edges.
"""
#TODO: pls make outgoig_ed... |
java | public <T> T fromCursor(Cursor c, Class<T> klass) {
DaoAdapter<T> adapter = getAdapter(klass);
return adapter.fromCursor(c, adapter.createInstance());
} |
java | public Vector2d transformPosition(double x, double y, Vector2d dest) {
return dest.set(m00 * x + m10 * y + m20, m01 * x + m11 * y + m21);
} |
java | static List<DistributionSetCreate> dsFromRequest(final Collection<MgmtDistributionSetRequestBodyPost> sets,
final EntityFactory entityFactory) {
return sets.stream().map(dsRest -> fromRequest(dsRest, entityFactory)).collect(Collectors.toList());
} |
java | public static smtp_server[] get(nitro_service client) throws Exception
{
smtp_server resource = new smtp_server();
resource.validate("get");
return (smtp_server[]) resource.get_resources(client);
} |
java | public static LinkedList<Class<?>> getLIFOSuperClassesList(Class<?> interceptorClass)
{
LinkedList<Class<?>> supers = new LinkedList<Class<?>>();
supers.addFirst(interceptorClass);
Class<?> interceptorSuperClass = interceptorClass.getSuperclass();
while (interceptorSuperClass != null... |
java | public void loadMithraCache(List<MithraObjectPortal> portals, int threads) throws MithraBusinessException
{
this.configManager.loadMithraCache(portals, threads);
} |
python | def list_metrics():
"""List metrics available."""
for name, operator in ALL_OPERATORS.items():
print(f"{name} operator:")
if len(operator.cls.metrics) > 0:
print(
tabulate.tabulate(
headers=("Name", "Description", "Type"),
tabul... |
python | def get(self, stream, start_time, end_time, start_id=None, limit=None,
order=ResultOrder.ASCENDING, namespace=None, timeout=None):
"""
Queries a stream with name `stream` for all events between `start_time` and
`end_time` (both inclusive). An optional `start_id` allows the client to
restart f... |
java | public EEnum getIfcLoadGroupTypeEnum() {
if (ifcLoadGroupTypeEnumEEnum == null) {
ifcLoadGroupTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(856);
}
return ifcLoadGroupTypeEnumEEnum;
} |
python | def crt_nrl_tc(aryMdlRsp, aryCnd, aryOns, aryDrt, varTr, varNumVol,
varTmpOvsmpl, lgcPrint=True):
"""Create temporally upsampled neural time courses.
Parameters
----------
aryMdlRsp : 2d numpy array, shape [n_x_pos * n_y_pos * n_sd, n_cond]
Responses of 2D Gauss models to spatial... |
python | def mask_to_n_loudest_clustered_events(self, n_loudest=10,
ranking_statistic="newsnr",
cluster_window=10):
"""Edits the mask property of the class to point to the N loudest
single detector events as ranked by ranking s... |
java | @Override
public void markElementEvictionIneligible(CacheElement cacheElement)
{
Element element = (Element) cacheElement;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "markEvictionIneligible", element.key);
synchronized (element.ivBucket) {... |
java | public <T extends HalRepresentation> Optional<T> getResourceAs(final Class<T> type,
final EmbeddedTypeInfo embeddedTypeInfo,
final EmbeddedTypeInfo... moreEmbeddedTypeInfos) throws IOExc... |
java | public java.util.List<org.tensorflow.framework.OpDef.ArgDef> getOutputArgList() {
return outputArg_;
} |
python | def search(self, ** args):
"""
Checks email inbox every 15 seconds that match the criteria
up until timeout.
Search criteria should be keyword args eg
TO="selenium@gmail.com". See __imap_search docstring for list
of valid criteria. If content_type is not defined, will r... |
java | protected String date (int style, Object arg)
{
Date when = massageDate(arg);
if (when == null) {
return "<!" + arg + ">";
}
return DateFormat.getDateInstance(style, getLocale()).format(when);
} |
java | public byte[] transform(byte[] classfileBuffer, Configuration configuration) {
InstrumentationActions instrumentationActions = calculateTransformationParameters(classfileBuffer, configuration);
if (!instrumentationActions.includeClass) {
return classfileBuffer;
}
return transform(classfileBuffer, instrumenta... |
java | protected <T extends DObject> void doSubscribe (ObjectAction<T> action)
{
// Log.info("doSubscribe: " + oid + ": " + target);
int oid = action.oid;
Subscriber<T> target = action.target;
// first see if we've already got the object in our table
@SuppressWarnings("unchecked")... |
java | @JRubyMethod(frame=true)
public static IRubyObject load_documents(IRubyObject self, IRubyObject port, Block proc) {
Ruby runtime = self.getRuntime();
ThreadContext ctx = runtime.getCurrentContext();
IRubyObject input = ((RubyHash)self.callMethod(ctx, "options")).op_aref(ctx, runtime.newSymb... |
java | public static FramesConfig imports(Xml root)
{
Check.notNull(root);
final Xml node = root.getChild(NODE_FRAMES);
final int horizontals = node.readInteger(ATT_HORIZONTAL);
final int verticals = node.readInteger(ATT_VERTICAL);
final int offsetX = node.readInteger(0, ATT... |
java | private String getIndentation() {
final StringBuilder buf = new StringBuilder();
for (int i=0; i<indentLevel; i++) {
buf.append("\t");
}
return buf.toString();
} |
java | private List<List<Double>> deepCopy(final List<List<Double>> original) {
final List<List<Double>> result = new ArrayList<>(original.size());
for (final List<Double> originalRow : original) {
final List<Double> row = new ArrayList<>(originalRow.size());
for (final double element : originalRow) {
... |
python | def getAttributeValueData(self, index):
"""
Return the data of the attribute at the given index
:param index: index of the attribute
"""
offset = self._get_attribute_offset(index)
return self.m_attributes[offset + const.ATTRIBUTE_IX_VALUE_DATA] |
python | def find(self, filter=None, sort=None, skip=None, limit=None,
*args, **kwargs):
"""
Finds all matching results
:param query: dictionary representing the mongo query
:return: cursor containing the search results
"""
if self.table is None:
self.bui... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.