language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public static void initDefaultParameterValues(Connection conn, QueryParameter param,
Map<String, Object> parameterValues) throws QueryException {
List<Serializable> defValues;
if ((param.getDefaultValues() != null) && (param.getDefaultValues().size() > 0... |
python | def write_message(msg, indent=False, mtype='standard', caption=False):
"""Writes message if verbose mode is set."""
if (mtype == 'debug' and config.DEBUG) or (mtype != 'debug' and config.VERBOSE) or mtype == 'error':
message(msg, indent=indent, mtype=mtype, caption=caption) |
python | def MI_modifyInstance(self,
env,
modifiedInstance,
previousInstance,
propertyList,
cimClass):
# pylint: disable=invalid-name
"""Modify a CIM instance
Implements the ... |
python | def updateClusterSize(self, estimatedNodeCounts):
"""
Given the desired and current size of the cluster, attempts to launch/remove instances to
get to the desired size. Also attempts to remove ignored nodes that were marked for graceful
removal.
Returns the new size of the clust... |
python | def get_prediction(self, u=0):
"""
Predicts the next state of the filter and returns it without
altering the state of the filter.
Parameters
----------
u : np.array
optional control input
Returns
-------
(x, P) : tuple
S... |
java | public void setTags(java.util.Collection<Tag> tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.ibm.cloud.objectstorage.internal.SdkInternalList<Tag>(tags);
} |
python | def __setup_connection(self):
"""
each operation requested represents a session
the session holds information about the plugin running it
and establishes a project object
"""
if self.payload != None and type(self.payload) is dict and 'settings' in ... |
java | public static GrayS16 average( InterleavedS16 input , GrayS16 output ) {
if (output == null) {
output = new GrayS16(input.width, input.height);
} else {
output.reshape(input.width,input.height);
}
if( BoofConcurrency.USE_CONCURRENT ) {
ConvertInterleavedToSingle_MT.average(input,output);
} else {
... |
java | public static void fillItemDefault(Item resourceItem, CmsObject cms, CmsResource resource, Locale locale) {
if (resource == null) {
LOG.error("Error rendering item for 'null' resource");
return;
}
if (resourceItem == null) {
LOG.error("Error rendering 'null'... |
java | public static <T extends RunListener> Optional<T> getAttachedListener(Class<T> listenerType) {
return Run.getAttachedListener(listenerType);
} |
java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static <T> Collection<T> create(Class<?> collectionType) {
Collection<T> list = null;
if (collectionType.isAssignableFrom(AbstractCollection.class)) {
// 抽象集合默认使用ArrayList
list = new ArrayList<>();
}
// Set
else if (collectionType.isAssign... |
java | public int count(String column, Object value) {
return count(Operators.match(column, value));
} |
java | protected static <T> Action1<Throwable> onErrorFrom(final Observer<T> observer) {
return new Action1<Throwable>() {
@Override
public void call(Throwable t1) {
observer.onError(t1);
}
};
} |
java | private void addValues(final Document doc, final PropertyData prop) throws RepositoryException
{
int propType = prop.getType();
String fieldName = resolver.createJCRName(prop.getQPath().getName()).getAsString();
if (propType == PropertyType.BINARY)
{
InternalQName propName = prop.get... |
python | def match(self, models, results, relation):
"""
Match the eagerly loaded results to their parents.
:type models: list
:type results: Collection
:type relation: str
"""
dictionary = self._build_dictionary(results)
for model in models:
key = m... |
python | def hash(value, chars=None):
'Get N chars (default: all) of secure hash hexdigest of value.'
value = hash_func(value).hexdigest()
if chars: value = value[:chars]
return mark_safe(value) |
java | public void sendUpdateQuery(String queryString, SPARQLQueryBindingSet bindings, boolean includeInferred, String baseURI) throws IOException, RepositoryException, MalformedQueryException,UpdateExecutionException {
getClient().performUpdateQuery(queryString, bindings, this.tx, includeInferred, baseURI);
} |
python | def get_template_sources(self, template_name, template_dirs=None):
"""
Returns the absolute paths to "template_name", when appended to each
directory in "template_dirs". Any paths that don't lie inside one of the
template dirs are excluded from the result set, for security reasons.
... |
java | @Override
public boolean isSameState(Word<I> input1, S s1, Word<I> input2, S s2) {
return s1.equals(s2);
} |
python | def remove_handlers_bound_to_instance(self, obj):
"""
Remove all handlers bound to given object instance.
This is useful to remove all handler methods that are part of an instance.
:param object obj: Remove handlers that are methods of this instance
"""
for handler in se... |
python | def _the_view_kwd(self, postinfo):
'''
Generate the kwd dict for view.
:param postinfo: the postinfo
:return: dict
'''
kwd = {
'pager': '',
'url': self.request.uri,
'cookie_str': tools.get_uuid(),
'daohangstr': '',
... |
python | def implements(obj, protocol):
"""Does the object 'obj' implement the 'prococol'?"""
if isinstance(obj, type):
raise TypeError("First argument to implements must be an instance. "
"Got %r." % obj)
return isinstance(obj, protocol) or issubclass(AnyType, protocol) |
python | def register(reg_name):
"""Register a subclass of CustomOpProp to the registry with name reg_name."""
def do_register(prop_cls):
"""Register a subclass of CustomOpProp to the registry."""
fb_functype = CFUNCTYPE(c_int, c_int, POINTER(c_void_p), POINTER(c_int),
POI... |
java | public Peer addPeer(String url, String pem) {
Peer peer = new Peer(url, pem, this);
this.peers.add(peer);
return peer;
} |
python | def _blank_param_value(value):
"""Remove the content from *value* while keeping its whitespace.
Replace *value*\\ 's nodes with two text nodes, the first containing
whitespace from before its content and the second containing whitespace
from after its content.
"""
sval =... |
java | public void marshall(GetJobRequest getJobRequest, ProtocolMarshaller protocolMarshaller) {
if (getJobRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getJobRequest.getId(), ID_BINDING);
... |
python | def _set_load_balance(self, v, load=False):
"""
Setter method for load_balance, mapped from YANG variable /interface/port_channel/load_balance (enumeration)
If this variable is read-only (config: false) in the
source YANG file, then _set_load_balance is considered as a private
method. Backends looki... |
python | async def fetchmany(self, size=None):
"""Fetch many rows, just like DB-API
cursor.fetchmany(size=cursor.arraysize).
If rows are present, the cursor remains open after this is called.
Else the cursor is automatically closed and an empty list is returned.
"""
try:
... |
python | def pointspace(self, **kwargs):
"""
Returns a dictionary with the keys `data` and `fit`.
`data` is just `scipy_data_fitting.Data.array`.
`fit` is a two row [`numpy.ndarray`][1], the first row values correspond
to the independent variable and are generated using [`numpy.linspace... |
python | def set_mphone_calibration(self, sens, db):
"""Sets the microphone calibration, for the purpose of calculating recorded dB levels
:param sens: microphone sensitivity (V)
:type sens: float
:param db: dB SPL that the calibration was measured at
:type db: int
"""
se... |
python | def prefix_iter(self, ns_uri):
"""Gets an iterator over the prefixes for the given namespace."""
ni = self.__lookup_uri(ns_uri)
return iter(ni.prefixes) |
python | def get_all_responses(self, service_name, receive_timeout_in_seconds=None):
"""
Receive all available responses from the service as a generator.
:param service_name: The name of the service from which to receive responses
:type service_name: union[str, unicode]
:param receive_ti... |
python | def _create_update_from_file(mode='create', uuid=None, path=None):
'''
Create vm from file
'''
ret = {}
if not os.path.isfile(path) or path is None:
ret['Error'] = 'File ({0}) does not exists!'.format(path)
return ret
# vmadm validate create|update [-f <filename>]
cmd = 'vmad... |
java | public static int distance(String s1, String s2) {
if (s1.length() == 0)
return s2.length();
if (s2.length() == 0)
return s1.length();
int s1len = s1.length();
// we use a flat array for better performance. we address it by
// s1ix + s1len * s2ix. this modification improves performance
... |
java | public java.util.List<MetricDataResult> getMetricDataResults() {
if (metricDataResults == null) {
metricDataResults = new com.amazonaws.internal.SdkInternalList<MetricDataResult>();
}
return metricDataResults;
} |
python | def _api_help(self):
"""Glances API RESTful implementation.
Return the help data or 404 error.
"""
response.content_type = 'application/json; charset=utf-8'
# Update the stat
view_data = self.stats.get_plugin("help").get_view_data()
try:
plist = json... |
java | @Override
public double getValue(int idx) {
int vSize = MVecArray.count(varBeliefs);
if (idx < vSize) {
return MVecArray.getValue(idx, varBeliefs);
} else {
return MVecArray.getValue(idx - vSize, facBeliefs);
}
} |
python | def load_module(self, name):
"""
If we get this far, then there are hooks waiting to be called on
import of this module. We manually load the module and then run the
hooks.
@param name: The name of the module to import.
"""
self.loaded_modules.append(name)
... |
python | def get_qout(self,
river_id_array=None,
date_search_start=None,
date_search_end=None,
time_index_start=None,
time_index_end=None,
time_index=None,
time_index_array=None,
daily=False,
... |
python | def password_attributes_max_retry(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
password_attributes = ET.SubElement(config, "password-attributes", xmlns="urn:brocade.com:mgmt:brocade-aaa")
max_retry = ET.SubElement(password_attributes, "max-retry")
... |
python | def _windows_cpudata():
'''
Return some CPU information on Windows minions
'''
# Provides:
# num_cpus
# cpu_model
grains = {}
if 'NUMBER_OF_PROCESSORS' in os.environ:
# Cast to int so that the logic isn't broken when used as a
# conditional in templating. Also follows... |
python | def subparsers(self):
"""
Insantiates the subparsers for all commands
"""
if self._subparsers is None:
apkw = {
'title': 'commands',
'description': 'Commands for the %s program' % self.parser.prog,
}
self._subparsers = s... |
java | public static void validateHostnameOrIpAddress(X509Certificate certificate, String hostname) throws UaException {
boolean dnsNameMatches =
validateSubjectAltNameField(certificate, SUBJECT_ALT_NAME_DNS_NAME, hostname::equals);
boolean ipAddressMatches =
validateSubjectAlt... |
java | public void marshall(CurrentMetricResult currentMetricResult, ProtocolMarshaller protocolMarshaller) {
if (currentMetricResult == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(currentMetricResult.ge... |
java | private boolean isRecordAlreadyExistsException(SQLException e)
{
// Search in UPPER case
// MySQL 5.0.x - com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
// Duplicate entry '4f684b34c0a800030018c34f99165791-0' for key 1
// HSQLDB 8.x - java.sql.SQLException: Violati... |
python | def standardize_strings(arg, strtype=settings.MODERNRPC_PY2_STR_TYPE, encoding=settings.MODERNRPC_PY2_STR_ENCODING):
"""
Python 2 only. Lookup given *arg* and convert its str or unicode value according to MODERNRPC_PY2_STR_TYPE and
MODERNRPC_PY2_STR_ENCODING settings.
"""
assert six.PY2, "This funct... |
python | def getidfkeyswithnodes():
"""return a list of keys of idfobjects that hve 'None Name' fields"""
idf = IDF(StringIO(""))
keys = idfobjectkeys(idf)
keysfieldnames = ((key, idf.newidfobject(key.upper()).fieldnames)
for key in keys)
keysnodefdnames = ((key, (name for name in fdnames
... |
python | def target_temperature(self, temperature):
"""Set new target temperature."""
dev_temp = int(temperature * 2)
if temperature == EQ3BT_OFF_TEMP or temperature == EQ3BT_ON_TEMP:
dev_temp |= 0x40
value = struct.pack('BB', PROP_MODE_WRITE, dev_temp)
else:
s... |
python | def destripe_plus(inputfile, suffix='strp', stat='pmode1', maxiter=15,
sigrej=2.0, lower=None, upper=None, binwidth=0.3,
scimask1=None, scimask2=None,
dqbits=None, rpt_clean=0, atol=0.01,
cte_correct=True, clobber=False, verbose=True):
r"""Cali... |
java | public static <T> JSONObject getJsonFromObject(T t)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
Field[] fields = AnnotationUtils.filterDeepFields(t.getClass());
JSONObject json = new JSONObject();
for (Field field : fields) {
Metho... |
python | def parse_args(cliargs):
"""Parse the command line arguments and return a list of the positional
arguments and a dictionary with the named ones.
>>> parse_args(["abc", "def", "-w", "3", "--foo", "bar", "-narf=zort"])
(['abc', 'def'], {'w': '3', 'foo': 'bar', 'narf': 'zort'})
>>> parse_... |
python | def combine_duplicate_stmts(stmts):
"""Combine evidence from duplicate Statements.
Statements are deemed to be duplicates if they have the same key
returned by the `matches_key()` method of the Statement class. This
generally means that statements must be identical in terms of their
... |
java | public void resetResult(Object result)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resetResult");
if (result != null)
((TopicAclTraversalResults) result).reset();
// ((ArrayList) result).clear();
if (TraceComponent.isAnyTracingEnabled() && tc.i... |
python | def send(mail, server='localhost'):
"""
Sends the given mail.
:type mail: Mail
:param mail: The mail object.
:type server: string
:param server: The address of the mailserver.
"""
sender = mail.get_sender()
rcpt = mail.get_receipients()
session = smtplib.SMTP(server)
messa... |
python | def __get_condition(self, url):
"""
Gets the condition for a url and validates it.
:param str url: The url to get the condition for
"""
if self.__heuristics_condition is not None:
return self.__heuristics_condition
if "pass_heuristics_condition" in self.__sit... |
python | def _comparable(self):
"""Get a comparable version of the DatasetID.
Without this DatasetIDs often raise an exception when compared in
Python 3 due to None not being comparable with other types.
"""
return self._replace(
name='' if self.name is None else self.name,
... |
python | def enbase64(byte_str):
"""
Encode bytes/strings to base64.
Args:
- ``byte_str``: The string or bytes to base64 encode.
Returns:
- byte_str encoded as base64.
"""
# Python 3: base64.b64encode() expects type byte
if isinstance(byte_str, str) and not PYTHON2:
byte_s... |
java | static String unescape(final String text, final UriEscapeType escapeType, final String encoding) {
if (text == null) {
return null;
}
StringBuilder strBuilder = null;
final int offset = 0;
final int max = text.length();
int readOffset = offset;
fo... |
java | protected static <P extends ParaObject> void batchGet(Map<String, KeysAndAttributes> kna, Map<String, P> results) {
if (kna == null || kna.isEmpty() || results == null) {
return;
}
try {
BatchGetItemResult result = getClient().batchGetItem(new BatchGetItemRequest().
withReturnConsumedCapacity(ReturnCon... |
java | public static List<Field> getFirstLevelOfReferenceAttributes(Class<?> clazz) {
List<Field> references = new ArrayList<Field>();
List<String> referencedFields = ReflectionUtils.getReferencedAttributeNames(clazz);
for(String eachReference : referencedFields) {
Field referenceField = R... |
java | @Override
public synchronized List<RecordContext> getDataForContext (int contextId) throws DatabaseException {
try {
List<RecordContext> result = new ArrayList<>();
psGetAllDataForContext.setInt(1, contextId);
try (ResultSet rs = psGetAllDataForContext.executeQuery()) {
while (rs.next()) {
... |
python | def add_relationship(
self,
entity1_ilx: str,
relationship_ilx: str,
entity2_ilx: str) -> dict:
""" Adds relationship connection in Interlex
A relationship exists as 3 different parts:
1. entity with type term, cde, fde, or pde
2. entity with type... |
python | def hypot(x, y, context=None):
"""
Return the Euclidean norm of x and y, i.e., the square root of the sum of
the squares of x and y.
"""
return _apply_function_in_current_context(
BigFloat,
mpfr.mpfr_hypot,
(
BigFloat._implicit_convert(x),
BigFloat._i... |
python | def reparse_login_cookie_after_region_update(self, login_response):
"""
Sometimes, login cookie gets sent with region info instead of api.cloudgenix.com. This function
re-parses the original login request and applies cookies to the session if they now match the new region.
**Parameters:... |
python | def parse_args(self, *args, **kwargs):
"""Parse the arguments as usual, then add default processing."""
if _debug: ConfigArgumentParser._debug("parse_args")
# pass along to the parent class
result_args = ArgumentParser.parse_args(self, *args, **kwargs)
# read in the configurati... |
java | private JpaSoftwareModule touch(final SoftwareModule latestModule) {
// merge base distribution set so optLockRevision gets updated and audit
// log written because modifying metadata is modifying the base
// distribution set itself for auditing purposes.
final JpaSoftwareModule result =... |
java | public void handle(final HttpExchange pHttpExchange) throws IOException {
try {
checkAuthentication(pHttpExchange);
Subject subject = (Subject) pHttpExchange.getAttribute(ConfigKey.JAAS_SUBJECT_REQUEST_ATTRIBUTE);
if (subject != null) {
doHandleAs(subject, p... |
java | public static Map<String,List<String>> findImages( File rootDir ) {
File files[] = rootDir.listFiles();
if( files == null )
return null;
List<File> imageDirectories = new ArrayList<>();
for( File f : files ) {
if( f.isDirectory() ) {
imageDirectories.add(f);
}
}
Map<String,List<String>> out = ... |
python | def startLoop():
"""
Use nested asyncio event loop for Jupyter notebooks.
"""
def _ipython_loop_asyncio(kernel):
'''
Use asyncio event loop for the given IPython kernel.
'''
loop = asyncio.get_event_loop()
def kernel_handler():
kernel.do_one_iteration... |
java | public DefaultShardManagerBuilder setGatewayPool(ScheduledExecutorService pool, boolean automaticShutdown)
{
return setGatewayPoolProvider(pool == null ? null : new ThreadPoolProviderImpl<>(pool, automaticShutdown));
} |
java | public static void reportOpenTransactions(String scope, String streamName, int ongoingTransactions) {
DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, ongoingTransactions, streamTags(scope, streamName));
} |
python | def float2int(x):
"""
converts floats to int when only float() is not enough.
:param x: float
"""
if not pd.isnull(x):
if is_numeric(x):
x=int(x)
return x |
python | def by_classifiers(cls, session, classifiers):
"""
Get releases for given classifiers.
:param session: SQLAlchemy session
:type session: :class:`sqlalchemy.Session`
:param classifiers: classifiers
:type classifiers: unicode
:return: release instances
:r... |
python | def execute(self, logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
"""
Overrides the parent method to add log messages.
:param logger: the logger to use during parsing (optional: None is supported)
:param options:
:return:
"""
in_root_call = False
... |
java | public static void uncompressDirectory(File srcZipPath, File dstDirPath) throws IOException
{
ZipInputStream in = new ZipInputStream(new FileInputStream(srcZipPath));
ZipEntry entry = null;
try
{
while ((entry = in.getNextEntry()) != null)
{
File dstFil... |
java | public PooledObject<T> get() {
T data = pool.pollLast();
if (data == null) {
data = function.get();
}
return new PooledObjectImpl<>(data, pool);
} |
python | def clusters(l, K):
"""Partition list ``l`` in ``K`` partitions.
>>> l = [0, 1, 2]
>>> list(clusters(l, K=3))
[[[0], [1], [2]], [[], [0, 1], [2]], [[], [1], [0, 2]], [[0], [], [1, 2]], [[], [0], [1, 2]], [[], [], [0, 1, 2]]]
>>> list(clusters(l, K=2))
[[[0, 1], [2]], [[1], [0, 2]], [[0], [1, 2]]... |
python | def _normalize_sv_coverage_gatk(group_id, inputs, backgrounds, work_dir, back_files, out_files):
"""Normalize CNV coverage using panel of normals with GATK's de-noise approaches.
"""
input_backs = set(filter(lambda x: x is not None,
[dd.get_background_cnv_reference(d, "gatk-cnv"... |
java | @Override
public boolean isTrailersReady() {
if (!message.isChunkedEncodingSet()
|| !message.containsHeader(HttpHeaderKeys.HDR_TRAILER)
|| ((HttpBaseMessageImpl) message).getTrailersImpl() != null
|| (message.getVersionValue().getMajor() <= 1 && message.getVersionValue().... |
java | public void marshall(ImportCertificateRequest importCertificateRequest, ProtocolMarshaller protocolMarshaller) {
if (importCertificateRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(importC... |
java | public static String byteRegexToString(final String regexp) {
final StringBuilder buf = new StringBuilder();
for (int i = 0; i < regexp.length(); i++) {
if (i > 0 && regexp.charAt(i - 1) == 'Q') {
if (regexp.charAt(i - 3) == '*') {
// tagk
byte[] tagk = new byte[TSDB.tagk_width... |
java | public static AtomContactSet getAtomsInContact(Chain chain, double cutoff) {
return getAtomsInContact(chain, (String[]) null, cutoff);
} |
python | def main():
'''Main routine.'''
# validate command line arguments
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('--vmname', '-n', required=True, action='store', help='Name')
arg_parser.add_argument('--rgname', '-g', required=True, action='store',
help='R... |
python | def to_sdf(self):
""" Converts the 2D image to a 2D signed distance field.
Returns
-------
:obj:`numpy.ndarray`
2D float array of the signed distance field
"""
# compute medial axis transform
skel, sdf_in = morph.medial_axis(self.data, return_distance... |
python | def make_assertions(input_pipe, other_pipes, output_pipe):
"""
To assure that the pipe is correctly settled
:param input_pipe:
:param other_pipes: can be []
:param output_pipe:
:return:
"""
assert isinstance(input_pipe, elements.InPypElement), 'Wrong input... |
python | def conditions(self):
"""
conditions ::= condition | condition logical_binary_op conditions
Note: By default lpar and rpar arguments are suppressed.
"""
return operatorPrecedence(
baseExpr=self.condition,
opList=[(self.not_op, 1, opAssoc.RIGHT),
... |
python | def _transition_stage(self, step, total_steps, brightness=None):
"""
Get a transition stage at a specific step.
:param step: The current step.
:param total_steps: The total number of steps.
:param brightness: The brightness to transition to (0.0-1.0).
:return: The stage ... |
python | def generate_ticket(name, output=None, grain=None, key=None, overwrite=True):
'''
Generate an icinga2 ticket on the master.
name
The domain name for which this ticket will be generated
output
grain: output in a grain
other: the file to store results
None: output to the... |
python | def _LoadArtifactsFromDatastore(self):
"""Load artifacts from the data store."""
loaded_artifacts = []
# TODO(hanuszczak): Why do we have to remove anything? If some artifact
# tries to shadow system artifact shouldn't we just ignore them and perhaps
# issue some warning instead? The datastore bein... |
java | public static void hideView(View parentView, int id) {
if (parentView != null) {
View view = parentView.findViewById(id);
if (view != null) {
view.setVisibility(View.GONE);
} else {
Log.e("Caffeine", "View does not exist. Could not hide it.");
... |
java | private String createString(String f)
{
StringBuilder sb = new StringBuilder();
sb.append("addressMode="+"("+
CUaddress_mode.stringFor(addressMode[0])+","+
CUaddress_mode.stringFor(addressMode[1])+","+
CUaddress_mode.stringFor(addressMode[2])+")"+f);
... |
python | def ip_dns_name_server_name_server_ip(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
ip = ET.SubElement(config, "ip", xmlns="urn:brocade.com:mgmt:brocade-common-def")
dns = ET.SubElement(ip, "dns", xmlns="urn:brocade.com:mgmt:brocade-ip-administration")... |
java | public static String[] splitPreserveAllTokens(String value, char separatorChar) {
if (value == null) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
int len = value.length();
if (len == 0) {
return ArrayUtils.EMPTY_STRING_ARRAY;
}
List<String> list = new ArrayList<>();
int i = 0;
i... |
java | public static String toUnicodeHex(char ch) {
StringBuilder sb = new StringBuilder(6);
sb.append("\\u");
sb.append(DIGITS_LOWER[(ch >> 12) & 15]);
sb.append(DIGITS_LOWER[(ch >> 8) & 15]);
sb.append(DIGITS_LOWER[(ch >> 4) & 15]);
sb.append(DIGITS_LOWER[(ch) & 15]);
return sb.toString();
} |
python | def axis(origin_size=0.04,
transform=None,
origin_color=None,
axis_radius=None,
axis_length=None):
"""
Return an XYZ axis marker as a Trimesh, which represents position
and orientation. If you set the origin size the other parameters
will be set relative to it.
... |
python | def get_contact_from_id(self, contact_id):
"""
Fetches a contact given its ID
:param contact_id: Contact ID
:type contact_id: str
:return: Contact or Error
:rtype: Contact
"""
contact = self.wapi_functions.getContact(contact_id)
if contact is Non... |
python | def get_last_metrics(self):
"""Read all measurement events since last call of the method.
:return List[ScalarMetricLogEntry]
"""
read_up_to = self._logged_metrics.qsize()
messages = []
for i in range(read_up_to):
try:
messages.append(self._log... |
java | public final void setIsSyntheticBlock(boolean val) {
checkState(token == Token.BLOCK);
putBooleanProp(Prop.SYNTHETIC, val);
} |
python | def launch_protect(job, patient_data, univ_options, tool_options):
"""
The launchpad for ProTECT. The DAG for ProTECT can be viewed in Flowchart.txt.
:param dict patient_data: Dict of information regarding the input sequences for the patient
:param dict univ_options: Dict of universal options used by a... |
java | public java.util.List<Tape> getTapes() {
if (tapes == null) {
tapes = new com.amazonaws.internal.SdkInternalList<Tape>();
}
return tapes;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.