language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | ClassConstraints extractValidationRules() {
final ClassConstraints classConstraints = new ClassConstraints();
Set<Field> allFields = ReflectionUtils.getAllFields(clazz, buildAnnotationsPredicate());
for (Field field : allFields) {
if (isNotExcluded(field)) {
FieldConstraints fieldValidationRul... |
python | def incrementKeySequenceCounter(self, iIncrementValue=1):
"""increment the key sequence with a given value
Args:
iIncrementValue: specific increment value to be added
Returns:
True: successful to increment the key sequence with a given value
False: fail to i... |
java | public static <T> List<T> parseListFrom(final InputStream in, final Schema<T> schema)
throws IOException
{
int size = in.read();
if(size == -1)
return Collections.emptyList();
if(size > 0x7f)
size = CodedInput.readRawVarint32(in, size);
... |
python | def get_root_path():
"""Get the root path for the application."""
root_path = __file__
return os.path.dirname(os.path.realpath(root_path)) |
python | def output_files(self):
"""Returns all output files from all of the current module's rules."""
for dep in self.subgraph.successors(self.address):
dep_rule = self.subgraph.node[dep]['target_obj']
for out_file in dep_rule.output_files:
yield out_file |
java | @SuppressWarnings("unchecked")
private static <T> T newRegisteredInstance(Map<Class<?>, Class<?>> implementationsRegistry, Type interfaceType) throws BugError
{
Class<?> implementation = getImplementation(implementationsRegistry, interfaceType);
try {
return (T)implementation.newInstance();
... |
java | protected void init(int initialMaxSize, Class<T> type, Factory<T> factory) {
this.size = 0;
this.type = type;
this.factory = factory;
data = (T[]) Array.newInstance(type, initialMaxSize);
if( factory != null ) {
for( int i = 0; i < initialMaxSize; i++ ) {
try {
data[i] = createInstance();
} ... |
python | def _insert_single_batch_into_database(
batchIndex,
log,
dbTableName,
uniqueKeyList,
dateModified,
replace,
batchSize,
reDatetime,
dateCreated):
"""*summary of function*
**Key Arguments:**
- ``batchIndex`` -- the index of the batch... |
java | private static Object convert(Class<?> clazz, String value) {
/* TODO create a new Converter class and move this method there for reuse */
if (Integer.class.equals(clazz) || int.class.equals(clazz)) {
return Integer.valueOf(value);
} else if (Double.class.equals(clazz) || double.class... |
java | public static void write(IDataSet dataSet, Writer writer) throws DataSetException {
logger.debug("write(dataSet={}, writer={}) - start", dataSet, writer);
write(dataSet, writer, null);
} |
java | public Multimap<String, Anim> deserializeAnim(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
{
Multimap<String, Anim> anims = ArrayListMultimap.create();
JsonObject obj = json.getAsJsonObject();
TypeToken<ArrayList<Anim>> token = new TypeToken<ArrayList<Anim>>()
... |
java | private String checkIfFile(Node node)
{
return ResourceUtil.isFile(node) ? Boolean.TRUE.toString() : Boolean.FALSE.toString();
} |
python | def set_attitude_target_send(self, time_boot_ms, target_system, target_component, type_mask, q, body_roll_rate, body_pitch_rate, body_yaw_rate, thrust, force_mavlink1=False):
'''
Sets a desired vehicle attitude. Used by an external controller to
command the vehicle (manua... |
java | public GroovyCodeSource createGroovyCodeSource(final ClassSource source) throws IOException {
checkNotNull(source);
if (source.getUrl() != null) {
return new GroovyCodeSource(source.getUrl());
}
if (source.getFile() != null) {
return new GroovyCodeSource(source.getFile());
}
if (sou... |
python | def process_default(self, event):
"""
Writes event string representation to file object provided to
my_init().
@param event: Event to be processed. Can be of any type of events but
IN_Q_OVERFLOW events (see method process_IN_Q_OVERFLOW).
@type event: Event ... |
java | public void assignData(XEvent event, String data) {
if (data != null && data.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_DATA.clone();
attr.setValue(data.trim());
event.getAttributes().put(KEY_DATA, ... |
java | public ResultHandlerContext<DPO, RI, RO, TRO> handleWith(ResultHandler<TRO> resultHandler) {
List<ResultHandler<TRO>> addedResultHandlers = new ArrayList<ResultHandler<TRO>>();
if (resultHandler != null) {
addedResultHandlers.add(resultHandler);
}
// Change context
r... |
java | @Override
public void save(T item) {
Serializable idValue = getOrGenerateIdValue(item);
save(idValue, item);
} |
python | def calcChebyshev(coeffs, validDomain, freqs):
"""
Given a set of coefficients,
this method evaluates a Chebyshev approximation.
Used for CASA bandpass reading.
input coeffs and freqs are numpy arrays
"""
logger = logging.getLogger(__name__)
domain = (validDomain[1] - validDomain[0])[0... |
java | public static int search(long[] longArray, long value, int occurrence) {
if(occurrence <= 0 || occurrence > longArray.length) {
throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than "
+ "the array length: " + occurrence);
}
in... |
python | def _to_sparky(self):
"""Save :class:`~nmrstarlib.plsimulator.PeakList` into Sparky-formatted string.
:return: Peak list representation in Sparky format.
:rtype: :py:class:`str`
"""
sparky_str = "Assignment\t\t{}\n\n".format("\t\t".join(["w" + str(i + 1) for i in range(len(self.... |
java | public Map<String, ActiveMQQueueStats> getQueueStats() {
Map<String, ActiveMQQueueStats> result;
result = new TreeMap<>();
synchronized ( this.queueStats ) {
for (QueueStatisticsCollection queueStatisticsCollection : this.queueStats.values()) {
result.put(queueStati... |
python | def _xorterm(lexer):
"""Return an xor term expresssion."""
prodterm = _prodterm(lexer)
xorterm_prime = _xorterm_prime(lexer)
if xorterm_prime is None:
return prodterm
else:
return ('xor', prodterm, xorterm_prime) |
java | @CheckResult
@NonNull
public static PowerAdapter concat(@NonNull Collection<? extends PowerAdapter> adapters) {
checkNotNull(adapters, "adapters");
if (adapters.isEmpty()) {
return EMPTY;
}
return new ConcatAdapterBuilder().addAll(adapters).build();
} |
java | @Nonnull
public static FileIOError deleteFile (@Nonnull final Path aFile)
{
ValueEnforcer.notNull (aFile, "Path");
final Path aRealFile = _getUnifiedPath (aFile);
if (!aRealFile.toFile ().isFile ())
return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFi... |
python | def cluster_stats(nodes=None, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluste... |
python | def my_version():
"""Return the version, checking both packaged and development locations"""
if os.path.exists(resource_filename(__name__, 'version')):
return resource_string(__name__, 'version')
return open(os.path.join(os.path.dirname(__file__),
"..", "version")).read... |
python | def _set_timeouts(self, timeouts):
""" Set socket timeouts for send and receive respectively """
(send_timeout, recv_timeout) = (None, None)
try:
(send_timeout, recv_timeout) = timeouts
except TypeError:
raise EndpointError(
'`timeouts` must be a... |
python | def build(self, mode='debug'):
"""
Builds the app project after the execution of validate and prepare.
This is the third and last step in the build process.
Needs to be implemented by the subclass.
"""
self.ensure_cache_folder()
ref = {
'debug': 'assembleDebug',
'release': 'ass... |
python | def read(self, line, f, data):
"""See :meth:`PunchParser.read`"""
assert("hessian" not in data)
f.readline()
N = len(data["symbols"])
hessian = np.zeros((3*N, 3*N), float)
tmp = hessian.ravel()
counter = 0
while True:
line = f.readline()
... |
java | public int compareTo(Object o) throws ClassCastException {
ElemTemplateElement ro = (ElemTemplateElement) o;
int roPrecedence = ro.getStylesheetComposed().getImportCountComposed();
int myPrecedence = this.getStylesheetComposed().getImportCountComposed();
if (myPrecedence < roPrecedence)
retu... |
python | def add_decimal_value(self, value, label=None):
"""stub"""
if label is None:
label = self._label_metadata['default_string_values'][0]
else:
if not self.my_osid_object_form._is_valid_string(
label, self.get_label_metadata()) or '.' in label:
... |
java | public Observable<WorkflowTriggerCallbackUrlInner> listCallbackUrlAsync(String resourceGroupName, String workflowName, String triggerName) {
return listCallbackUrlWithServiceResponseAsync(resourceGroupName, workflowName, triggerName).map(new Func1<ServiceResponse<WorkflowTriggerCallbackUrlInner>, WorkflowTrigge... |
java | private static int[] maximumSizes(Container container,
List formSpecs,
List[] componentLists,
Measure minMeasure,
Measure prefMeasure,
Measure defaultMeasure) {
FormSpec formSpec;
int size = formSpecs.size();
int[] result = new int[size... |
java | protected weka.core.Attribute wekaAttribute(int index, Attribute attribute) {
weka.core.Attribute wekaAttribute;
if (attribute.isNominal()) {
wekaAttribute = new weka.core.Attribute(attribute.name(), attribute.getAttributeValues(), index);
} else {
wekaAttribut... |
python | def set_hr_widths(result):
"""
We want the hrs indented by hirarchy...
A bit 2 much effort to calc, maybe just fixed with 10
style seps would have been enough visually:
◈────────────◈
"""
# set all hrs to max width of text:
mw = 0
hrs = []
if not hr_marker in result:
retu... |
java | public final AbstractImporter createImporter(ImporterConfig config)
{
AbstractImporter importer = create(config);
importer.setImportServerAdapter(m_importServerAdapter);
return importer;
} |
java | public static StringIsEqual isEqual(StringExpression left, Object constant) {
if (!(constant instanceof String))
throw new IllegalArgumentException("constant is not a String");
return new StringIsEqual(left, constant((String)constant));
} |
java | @Override
public final StringBuffer revealPageFilterData(
final Map<String, Object> pAddParam, final IRequestData pRequestData,
final Class<?> pEntityClass) throws Exception {
return this.hlpEntitiesPage.revealPageFilterData(
pAddParam, pRequestData, pEntityClass, this.isDbgSh);
} |
python | def GetAuthorizationHeader(cosmos_client,
verb,
path,
resource_id_or_fullname,
is_name_based,
resource_type,
headers):
"""Gets the authorization header.
... |
java | public static String getISO8601StringWithSpecificTimeZone(Date date, TimeZone zone) {
DateFormat formatter = getFormatter();
formatter.setTimeZone(zone);
return formatter.format(date);
} |
python | def QA_SU_save_stock_min(client=DATABASE, ui_log=None, ui_progress=None):
"""
聚宽实现方式
save current day's stock_min data
"""
# 导入聚宽模块且进行登录
try:
import jqdatasdk
# 请自行将 JQUSERNAME 和 JQUSERPASSWD 修改为自己的账号密码
jqdatasdk.auth("JQUSERNAME", "JQUSERPASSWD")
except:
rais... |
java | public final <R> Ix<R> publish(IxFunction<? super Ix<T>, ? extends Iterable<? extends R>> transform) {
return new IxPublishSelector<T, R>(this, nullCheck(transform, "transform is null"));
} |
java | public FlowConfig getFlowConfig(FlowId flowId)
throws RemoteInvocationException {
LOG.debug("getFlowConfig with groupName " + flowId.getFlowGroup() + " flowName " +
flowId.getFlowName());
GetRequest<FlowConfig> getRequest = _flowconfigsRequestBuilders.get()
.id(new ComplexResourceKey<>(fl... |
java | public static String join(final Collection<?> col, final String separator) {
return join(col, separator, ELEMENT_CONVERTER);
} |
java | public static UserRegistry getUserRegistry(String realmName) throws WSSecurityException {
try {
WSSecurityService ss = wsSecurityServiceRef.getService();
if (ss == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, ... |
java | private <T> void runClusterAction(CustomCommandLine<T> activeCommandLine, CommandLine commandLine, ClusterAction<T> clusterAction) throws FlinkException {
final ClusterDescriptor<T> clusterDescriptor = activeCommandLine.createClusterDescriptor(commandLine);
final T clusterId = activeCommandLine.getClusterId(comman... |
java | SubjectScheme getSubjectScheme(final Element root) {
subjectSchemeReader.reset();
logger.debug("Loading subject schemes");
final List<Element> subjectSchemes = toList(root.getElementsByTagName("*"));
subjectSchemes.stream()
.filter(SUBJECTSCHEME_ENUMERATIONDEF::matches)
... |
java | private void processTree(final GroupElement ce, boolean[] result) throws InvalidPatternException {
boolean hasChildOr = false;
// first we elimininate any redundancy
ce.pack();
for (Object child : ce.getChildren().toArray()) {
if (child instanceof GroupElement) {
... |
python | def load_file(self, filename):
"""Load and parse a RiveScript document.
:param str filename: The path to a RiveScript file.
"""
self._say("Loading file: " + filename)
fh = codecs.open(filename, 'r', 'utf-8')
lines = fh.readlines()
fh.close()
self._sa... |
python | def scp(self, local_file, remote_path=''):
"""Copy a local file to the given remote path."""
if self.args.user:
upload_spec = '{0}@{1}:{2}'.format(self.args.user,
self.args.server,
remote_path)
... |
java | protected String getI18n(final String aMessageKey, final Object... aObjArray) {
final String[] strings = new String[aObjArray.length];
for (int index = 0; index < aObjArray.length; index++) {
if (aObjArray[index] instanceof File) {
strings[index] = ((File) aObjArray[index]).... |
java | protected List<String> getCompatibilitySQL() {
List<String> sqlStatements = new ArrayList<>();
sqlStatements.add(SELECT_COMPATIBILITY_COINBASE_SQL);
return sqlStatements;
} |
java | public static List<CommercePriceList> findByCommerceCurrencyId(
long commerceCurrencyId, int start, int end) {
return getPersistence()
.findByCommerceCurrencyId(commerceCurrencyId, start, end);
} |
java | public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException
{
checkValid();
if (keepChanges)
{
dataManager.refresh(this.getData());
}
else
{
dataManager.rollback(this.getData());
}
} |
python | def predict_df(self, df, pstate_col=PSTATE_COL):
"""
Predict the class label of DataFrame df
"""
scores = {}
for label, pohmm in self.pohmms.items():
scores[label] = pohmm.score_df(df, pstate_col=pstate_col)
max_score_label = max(scores.items(), key=itemgetter... |
python | def update(self, lease_time=None):
'''Refresh this task's expiration time.
This tries to set the task's expiration time to the current
time, plus `lease_time` seconds. It requires the job to not
already be complete. If `lease_time` is negative, makes the
job immediately be ava... |
python | def store(self, result, filename, pretty=True):
"""
Write a result to the given file.
Parameters
----------
result : memote.MemoteResult
The dictionary structure of results.
filename : str or pathlib.Path
Store results directly to the given filena... |
java | private void setTTLPerRequest(Object value)
{
if (value instanceof String)
{
if (Boolean.valueOf((String) value).booleanValue())
{
this.cassandraClientBase.setTtlPerSession(false);
}
this.cassandraClientBase.setTtlPerRequest(Boolean.val... |
java | public boolean removeDividerByTag(Object tag) {
if (tag == null) return false;
for (int k = 0; k < list.getWidgetCount(); k++) {
Widget w = list.getWidget(k);
if (isDivider(w) && tag.equals(((JQMListDivider) w).getTag())) {
list.remove(k);
items.re... |
java | private void writeOutData() {
if (valuesHeld == 0) {
return;
}
int batchSize = batchItemSizePerEmmit == null ? DEFAULT_SORT_BATCH_PER_EMIT_BYTES
: batchItemSizePerEmmit;
ByteBuffer currentKey = getKeyValueFromPointer(0).getKey();
List<ByteBuffer> currentValues = new ArrayList<>();
... |
java | public static Object readDeclaredStaticField(final Class<?> cls, final String fieldName) throws IllegalAccessException {
return readDeclaredStaticField(cls, fieldName, false);
} |
python | def make_parser():
"""
Create a parser which is suitably configured for parsing an XMPP XML
stream. It comes equipped with :class:`XMPPLexicalHandler`.
"""
p = xml.sax.make_parser()
p.setFeature(xml.sax.handler.feature_namespaces, True)
p.setFeature(xml.sax.handler.feature_external_ges, Fals... |
java | @InterfaceStability.Experimental
@InterfaceAudience.Public
public static <D extends Document<?>> Single<D> getFirstPrimaryOrReplica(final String id,
final Class<D> target, final Bucket bucket, final long primaryTimeout, final long replicaTimeout) {
if (primaryTimeout <= 0) {
throw ne... |
java | @Override
public List<Namespace> getNamespaces(KamHandle kamHandle)
throws KamStoreServiceException {
List<Namespace> list = new ArrayList<Namespace>();
final String handle = kamHandle.getHandle();
try {
// Get the real Kam from the KamCache
org.openbel.f... |
python | def save(self, **kwargs):
"""
Save and return a list of object instances.
"""
# Guard against incorrect use of `serializer.save(commit=False)`
assert 'commit' not in kwargs, (
"'commit' is not a valid keyword argument to the 'save()' method. "
"If you need... |
java | public boolean isAnyProcessInTreeAlive() {
for (Integer pId : processTree.keySet()) {
if (isAlive(pId.toString())) {
return true;
}
}
return false;
} |
python | def get_all_activities(self, autoscale_group, activity_ids=None,
max_records=None, next_token=None):
"""
Get all activities for the given autoscaling group.
This action supports pagination by returning a token if there are more
pages to retrieve. To get the ne... |
python | def update(self, role_sid=values.unset,
last_consumed_message_index=values.unset,
last_consumption_timestamp=values.unset, date_created=values.unset,
date_updated=values.unset, attributes=values.unset):
"""
Update the MemberInstance
:param unicode ro... |
java | @Override
public S addProperty(String key, String value) {
TypedProperties properties = attributes.attribute(PROPERTIES).get();
properties.put(key, value);
attributes.attribute(PROPERTIES).set(properties);
XmlConfigHelper.setAttributes(attributes, properties, false, false);
this.propert... |
python | def from_conll(this_class, stream):
"""Construct a Corpus. stream is an iterable over strings where
each string is a line in CoNLL-X format."""
stream = iter(stream)
corpus = this_class()
while 1:
# read until we get an empty sentence
sentence = Sentence.f... |
java | @Override
public MetaProperty<?> findMetaProperty(Class<?> beanType, MetaBean metaBean, String propertyName) {
// dynamic beans force code by exception
try {
return metaBean.metaProperty(propertyName);
} catch (NoSuchElementException ex) {
return null;
}
} |
python | def _download_mlu_data(tmp_dir, data_dir):
"""Downloads and extracts the dataset.
Args:
tmp_dir: temp directory to download and extract the dataset
data_dir: The base directory where data and vocab files are stored.
Returns:
tmp_dir: temp directory containing the raw data.
"""
if not tf.gfile.Ex... |
java | public final Ix<Boolean> any(IxPredicate<? super T> predicate) {
return new IxAny<T>(this, nullCheck(predicate, "predicate is null"));
} |
java | public DevicePoolCompatibilityResult withIncompatibilityMessages(IncompatibilityMessage... incompatibilityMessages) {
if (this.incompatibilityMessages == null) {
setIncompatibilityMessages(new java.util.ArrayList<IncompatibilityMessage>(incompatibilityMessages.length));
}
for (Incomp... |
python | def retention_period(self):
"""Retrieve or set the retention period for items in the bucket.
:rtype: int or ``NoneType``
:returns: number of seconds to retain items after upload or release
from event-based lock, or ``None`` if the property is not
set locally.... |
java | @Override
protected AbstractChainedResourceBundlePostProcessor buildProcessorByKey(String procesorKey) {
if (PostProcessFactoryConstant.JSMIN.equals(procesorKey))
return buildJSMinPostProcessor();
else if (PostProcessFactoryConstant.LICENSE_INCLUDER.equals(procesorKey))
return buildLicensesProcessor();
els... |
java | public ListObjectsResponse listObjects(ListObjectsRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET);
if (request.getPrefix() != null) {
internalRequest.addParameter("prefix", req... |
python | def is_default(self):
"""Return True if no active values, or if the active value is the default"""
if not self.get_applicable_values():
return True
if self.get_value().is_default:
return True
return False |
java | public boolean hasAttribute(String name)
{
return DTM.NULL != dtm.getAttributeNode(node,null,name);
} |
java | public static <T> PollingState<T> create(Response<ResponseBody> response, LongRunningOperationOptions lroOptions, int defaultRetryTimeout, Type resourceType, SerializerAdapter<?> serializerAdapter) throws IOException {
PollingState<T> pollingState = new PollingState<>();
pollingState.initialHttpMethod =... |
java | protected Object getInstantiatedClass(String query) {
if (query.equals(Constants.ROBOTIUM_SOLO)) {
return solo;
} else if (query.equals(Constants.REMOTE_TEST_CLASS)) {
return testClass;
}
return null;
} |
python | def _update_netrc(self, netrc_path, auth_token, account_email):
''' a method to replace heroku login details in netrc file '''
# define patterns
import re
record_end = '(\n\n|\n\w|$)'
heroku_regex = re.compile('(machine\sapi\.heroku\.com.*?\nmachine\sgit\.heroku\... |
python | def _process_phenotype_cvterm(self):
"""
These are the qualifiers for the phenotype location itself.
But are just the qualifiers.
The actual "observable" part of the phenotype is only in
the phenotype table. These get added to a lookup variable used to
augment a phenotype... |
java | @Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.SEC__RESERVED:
return getRESERVED();
case AfplibPackage.SEC__COLSPCE:
return getCOLSPCE();
case AfplibPackage.SEC__COLSIZE1:
return getCOLSIZE1();
case AfplibPackage.SEC__C... |
python | def permutation_from_block_permutations(permutations):
"""Reverse operation to :py:func:`permutation_to_block_permutations`
Compute the concatenation of permutations
``(1,2,0) [+] (0,2,1) --> (1,2,0,3,5,4)``
:param permutations: A list of permutation tuples
``[t = ... |
java | public static Day getLastOfMonth(int dayOfWeek, int month, int year)
{
Day day = Day.getNthOfMonth(5, dayOfWeek, month, year);
return day != null ? day : Day.getNthOfMonth(4, dayOfWeek, month, year);
} |
python | def generate_not(self):
"""
Means that value have not to be valid by this definition.
.. code-block:: python
{'not': {'type': 'null'}}
Valid values for this definition are 'hello', 42, {} ... but not None.
Since draft 06 definition can be boolean. False means noth... |
python | def _calibrate_quantized_sym(qsym, th_dict):
"""Given a dictionary containing the thresholds for quantizing the layers,
set the thresholds into the quantized symbol as the params of requantize operators.
"""
if th_dict is None or len(th_dict) == 0:
return qsym
num_layer_outputs = len(th_dict... |
python | def form_valid(self, form):
"""First call the parent's form valid then let the user know it worked."""
form_valid_from_parent = super(HostCreate, self).form_valid(form)
messages.success(self.request, 'Host {} Successfully Created'.format(self.object))
return form_valid_from_parent |
python | def connect(self, slot, *extra_args):
"""
@slot: The method to be called on signal emission
Connects to @slot
"""
slot = Slot(slot, *extra_args)
self._functions.add(slot) |
java | public void update(byte buffer) {
if (skip) return;
for (int i=0; i < digests.size(); i++) {
digests.get(i).update(buffer);
}
} |
python | def with_relation(self, relation_name=None):
"""
if relation is not None, when fetch manytomany result, also
fetch relation record and saved them to manytomany object,
and named them as relation.
If relation_name is not given, then default value is 'relation'
"""... |
java | private boolean containsSkippable(Set<String> skipList, Exception e)
{
final String mName = "containsSkippable";
boolean retVal = false;
for ( Iterator it = skipList.iterator(); it.hasNext(); ) {
String exClassName = (String) it.next();
try {
ClassLoader tccl... |
python | def _objects_touch_each_other(self, object1: Object, object2: Object) -> bool:
"""
Returns true iff the objects touch each other.
"""
in_vertical_range = object1.y_loc <= object2.y_loc + object2.size and \
object1.y_loc + object1.size >= object2.y_loc
... |
python | def generate_digest(self):
"""RFC 2617."""
from hashlib import md5
ha1 = self.username + ':' + self.realm + ':' + self.password
HA1 = md5(ha1.encode('UTF-8')).hexdigest()
ha2 = self.method + ':' + self.url
HA2 = md5(ha2.encode('UTF-8')).hexdigest()
encrypt_respons... |
python | def listar_por_nome(self, nome):
"""Obtém um equipamento a partir do seu nome.
:param nome: Nome do equipamento.
:return: Dicionário com a seguinte estrutura:
::
{'equipamento': {'id': < id_equipamento >,
'nome': < nome_equipamento >,
'id_tipo_equi... |
python | def apply_to_transcript_if_exists(effect, fn, default):
"""
Apply function to transcript associated with effect,
if it exists, otherwise return default.
"""
return apply_to_field_if_exists(
effect=effect,
field_name="transcript",
fn=fn,
default=default) |
java | public Options createOptions(OptionsConfiguration optionsConfiguration)
throws MojoExecutionException {
final Options options = new Options();
options.verbose = optionsConfiguration.isVerbose();
options.debugMode = optionsConfiguration.isDebugMode();
options.classpaths.addAll(optionsConfiguration.getPlugin... |
java | public java.util.List<ClientVpnAuthentication> getAuthenticationOptions() {
if (authenticationOptions == null) {
authenticationOptions = new com.amazonaws.internal.SdkInternalList<ClientVpnAuthentication>();
}
return authenticationOptions;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.