language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public GetTranscriptionJobResult getTranscriptionJob(GetTranscriptionJobRequest request) {
request = beforeClientExecution(request);
return executeGetTranscriptionJob(request);
} |
java | public static String getClientUser(AlluxioConfiguration conf) throws AccessControlException {
try {
User user = get(conf);
if (user == null) {
throw new AccessControlException(
ExceptionMessage.AUTHORIZED_CLIENT_USER_IS_NULL.getMessage());
}
return user.getName();
} c... |
java | private TreeNode<T> assimilateOverlappingIntervals(TreeNode<T> from) {
ArrayList<Interval<T>> tmp = new ArrayList<>();
if (midpoint.compareTo(from.midpoint) < 0){
for (Interval<T> next: from.increasing){
if (next.isRightOf(midpoint))
break;
tmp.add(next);
}
} else {
for (Interval<T> next: f... |
python | def get_filter_value(self, column_name):
"""
Returns the filtered value for a certain column
:param column_name: The name of the column that we want the value from
:return: the filter value of the column
"""
for flt, value in zip(self.filters, self.values):
... |
java | public static void exports(Media configSheets, int tileWidth, int tileHeight, Collection<String> sheets)
{
Check.notNull(configSheets);
Check.notNull(sheets);
final Xml nodeSheets = new Xml(NODE_TILE_SHEETS);
nodeSheets.writeString(Constant.XML_HEADER, Constant.ENGINE_WEBSITE)... |
java | public void setDeliveryIndicator(com.google.api.ads.admanager.axis.v201808.DeliveryIndicator deliveryIndicator) {
this.deliveryIndicator = deliveryIndicator;
} |
python | def total_cycles(self) -> int:
"""The number of total number of cycles in the structure."""
return sum((int(re.sub(r'\D', '', op)) for op in self.tokens)) |
java | protected int getListingChunkLength(AlluxioConfiguration conf) {
return conf.getInt(PropertyKey.UNDERFS_LISTING_LENGTH) > getListingChunkLengthMax()
? getListingChunkLengthMax() : conf.getInt(PropertyKey.UNDERFS_LISTING_LENGTH);
} |
python | def _write_values(kwargs, variables):
"""Write values of kwargs and return thus-satisfied closures."""
writeto = []
for var_name, value in kwargs.items():
var = variables[var_name]
var.notify_will_write()
var.write(value)
writeto.append(var)
return _notify_reader_writes(w... |
python | def convert_subject_ids(self, subject_ids):
"""
Convert subject ids to strings if they are integers
"""
# TODO: need to make this generalisable via a
# splitting+mapping function passed to the repository
if subject_ids is not None:
subject_ids = set(
... |
python | def last(self, offset):
"""
Convenience method for subsetting final periods of time series data
based on a date offset.
Parameters
----------
offset : string, DateOffset, dateutil.relativedelta
Returns
-------
subset : same type as caller
... |
java | public RelationshipPrefetcher createRelationshipPrefetcher(ObjectReferenceDescriptor ord)
{
if (ord instanceof CollectionDescriptor)
{
CollectionDescriptor cds = (CollectionDescriptor)ord;
if (cds.isMtoNRelation())
{
return new MtoNCollectio... |
python | def calibrate_bt(array, attributes, index, band_name):
"""Calibration for the emissive channels."""
offset = np.float32(attributes["radiance_offsets"][index])
scale = np.float32(attributes["radiance_scales"][index])
array = (array - offset) * scale
# Planck constant (Joule second)
h__ = np.flo... |
java | @Override
public void index(ByteBuffer key, ColumnFamily columnFamily) {
Log.debug("Indexing row %s in index %s ", key, logName);
lock.readLock().lock();
try {
if (rowService != null) {
long timestamp = System.currentTimeMillis();
rowService.index(... |
java | private Number parseNumber(String numberValue, Object valueSource) throws WrongValueTypeException {
try {
Double d = Double.valueOf(numberValue);
return this.mathUtil.toSimplestNumber(d);
} catch (NumberFormatException e) {
throw new WrongValueTypeException(e, numberValue, valueSource, Number... |
java | public DelegationRequest<T> setScope(String scope) {
request.addParameter(ParameterBuilder.SCOPE_KEY, scope);
return this;
} |
python | def find_lemmata(tokens):
""" Annotates the tokens with lemmata for plural nouns and conjugated verbs,
where each token is a [word, part-of-speech] list.
"""
for token in tokens:
word, pos, lemma = token[0], token[1], token[0]
if pos.startswith(("DT", "JJ")):
lemma = pred... |
python | def remove_non_ground_states(self):
"""
Removes all non-ground state entries, i.e., only keep the lowest energy
per atom entry at each composition.
"""
group_func = lambda e: e.composition.reduced_formula
entries = sorted(self.entries, key=group_func)
ground_state... |
java | @Override @DefinedBy(Api.COMPILER_TREE)
public DCDocComment newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) {
ListBuffer<DCTree> lb = new ListBuffer<>();
lb.addAll(cast(fullBody));
List<DCTree> fBody = lb.toList();
// A dummy comment to keep the dia... |
java | public static List<Method> getAllMethods(Class<?> c, Class<? extends Annotation> annotationType) {
List<Method> annotated = new ArrayList<>();
inspectRecursively(c, annotated, annotationType);
return annotated;
} |
java | private int[] newChunk() {
if (defaultValue==0) return new int[chunkSize];
if (baseChunk==null) {
baseChunk = new int[chunkSize];
Arrays.fill(baseChunk,defaultValue);
}
return baseChunk.clone();
} |
java | public static byte[] getBytes(ByteBuffer buf) {
int savedPos = buf.position();
byte [] newBytes = new byte[buf.remaining()];
buf.get(newBytes);
buf.position(savedPos);
return newBytes;
} |
python | def dissociate(self, c, context, hm, pool_id):
"""Remove a pool association, and the healthmonitor if its the last one"""
self._dissociate(c, context, hm, pool_id)
pools = hm.get("pools", [])
if not any(p for p in pools if p.get("pool_id") != pool_id):
self._delete_unused(c,... |
python | def _request(self, base_url, client_id, client_secret,
parameters, **kwargs):
"""Make an API request to get the token"""
logging.debug('Getting an OAuth token for client "%s" with scope "%s"',
client_id, parameters.get('scope'))
headers = {'Content-Type': '... |
python | def load_dostime(buf, pos):
"""Load LE32 dos timestamp"""
stamp, pos = load_le32(buf, pos)
tup = parse_dos_time(stamp)
return to_datetime(tup), pos |
java | private void addUpdateAttributesOperation(UpdateAttributesOperation operation) {
if (!this.metadata.isSealedInStorage()) {
// Only process the operation if the Segment is not sealed in Storage. If it is, then so is the Attribute Index,
// and it means this operation has already been appl... |
java | public static final Function<LocalTime, String> localTimeToStr(final FormatType formatType, final String format) {
return new LocalTimeToStr(formatType, format);
} |
java | public static Integer[] sequence(final Integer from, final Integer to) {
return sequence(from, to, Integer.valueOf(from <= to? 1 : -1));
} |
python | def _insert_dLbl_in_sequence(self, idx):
"""
Return a newly created `c:dLbl` element having `c:idx` child of *idx*
and inserted in numeric sequence among the `c:dLbl` children of this
element.
"""
new_dLbl = self._new_dLbl()
new_dLbl.idx.val = idx
dLbl = ... |
python | def cmp_store_tlv_params(self, intf, tlv_data):
"""Compare and store the received TLV.
Compares the received TLV with stored TLV. Store the new TLV if it is
different.
"""
flag = False
attr_obj = self.get_attr_obj(intf)
remote_evb_mode = self.pub_lldp.get_remote_... |
python | def importProteinDatabase(filePath, proteindb=None, headerParser=None,
forceId=False, decoyTag='[decoy]', contaminationTag='[cont]',
ignoreIsoleucine=False, cleavageRule='[KR]', minLength=5, maxLength=40,
missedCleavage=0, removeNtermM=False):
"""Generates a :class:`ProteinDatabase` by in s... |
java | protected boolean isSourceFile(File file) {
String name = file.getName();
String extension = Files.getExtension(name).toLowerCase();
return sourceFileExtensions.contains(extension) || sourceFileNames.contains(name);
} |
python | def parse_xml(cls, node, runtime, keys, id_generator):
"""
Use `node` to construct a new block.
Arguments:
node (:class:`~xml.etree.ElementTree.Element`): The xml node to parse into an xblock.
runtime (:class:`.Runtime`): The runtime to use while parsing.
k... |
python | def thesis_info(self, key, value):
"""Populate the ``thesis_info`` key."""
def _get_degree_type(value):
DEGREE_TYPES_MAP = {
'RAPPORT DE STAGE': 'other',
'INTERNSHIP REPORT': 'other',
'DIPLOMA': 'diploma',
'BACHELOR': 'bachelor',
'LAUREA': 'lau... |
python | def _flash_encryption_tweak_range(flash_crypt_config=0xF):
""" Return a list of the bit indexes that the "key tweak" applies to,
as determined by the FLASH_CRYPT_CONFIG 4 bit efuse value.
"""
tweak_range = []
if (flash_crypt_config & 1) != 0:
tweak_range += range(67)
if (flash_crypt_conf... |
java | protected void addClassList(Content contentTree) {
List<String> classTableHeader = Arrays.asList(
resources.getText("doclet.Class"), resources.getText("doclet.Description"));
for (String packageName : usingPackageToUsedClasses.keySet()) {
PackageElement usingPackage = utils.e... |
java | public void inBatch(@NonNull Runnable runnable) throws CouchbaseLiteException {
if (runnable == null) { throw new IllegalArgumentException("runnable cannot be null."); }
synchronized (lock) {
mustBeOpen();
try {
boolean commit = false;
getC4Databa... |
java | @Override
public List<CPDefinitionSpecificationOptionValue> getCPDefinitionSpecificationOptionValues(
int start, int end) {
return cpDefinitionSpecificationOptionValuePersistence.findAll(start,
end);
} |
python | def run(self):
"""
Execute the reloader forever, blocking the current thread.
This will invoke ``sys.exit(1)`` if interrupted.
"""
self._capture_signals()
self._start_monitor()
try:
while True:
if not self._run_worker():
... |
java | public static Network loadNetwork(String networkPath)
throws ShanksException {
Network net = new Network();
net.readFile(networkPath);
net.setBayesianAlgorithm(BayesianAlgorithmType.Lauritzen);
net.updateBeliefs();
return net;
} |
python | def visit_comprehension(self, node: AST,
dfltChaining: bool = True) -> str:
"""Return `node`s representation as comprehension."""
target = node.target
try:
elts = target.elts # we have a tuple of names
except AttributeError:
na... |
java | public void setDimensions(java.util.Collection<SegmentDimensions> dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new java.util.ArrayList<SegmentDimensions>(dimensions);
} |
java | public static void failWithInvalidMethodSignException(boolean expression, SQLiteModelMethod method,
String messageFormat, Object... args) {
assertTrueOrInvalidMethodSignException(!expression, method, messageFormat, args);
} |
java | private List<String> listFiles( final File dir, final String parentName )
{
final List<String> fileNames = new ArrayList<String>();
File[] files = null;
if( dir.canRead() )
{
files = dir.listFiles();
}
if( files != null )
{
for( File fi... |
java | public RelationshipRoleSourceType<EjbRelationshipRoleType<T>> getOrCreateRelationshipRoleSource()
{
Node node = childNode.getOrCreate("relationship-role-source");
RelationshipRoleSourceType<EjbRelationshipRoleType<T>> relationshipRoleSource = new RelationshipRoleSourceTypeImpl<EjbRelationshipRoleType<T>>... |
python | def plot_mapping(self, plot_limits=None, which_data='all', which_parts='all', resolution=None, levels=20, samples=0, fignum=None, ax=None, fixed_inputs=[], linecol=Tango.colorsHex['darkBlue']):
"""
Plots the mapping associated with the model.
- In one dimension, the function is plotted.
- In two dim... |
python | def _set_op(self, node):
"""
Translate a set operator node into SQLQuery.
:param node: a treebrd node
:return: a SQLQuery object for the tree rooted at node
"""
select_block = str(node.attributes)
from_block = '({left} {operator} ALL {right}) AS {name}'.format(
... |
python | def create_asset(self, **kwargs):
"""
Creates an instance of the Asset Service.
"""
asset = predix.admin.asset.Asset(**kwargs)
asset.create()
client_id = self.get_client_id()
if client_id:
asset.grant_client(client_id)
asset.add_to_manifest(s... |
java | public void pruneSnapshots(final int numSnapshotsToKeep) throws StorageException {
checkInitialized();
checkArgument(numSnapshotsToKeep >= 0, "invalid number of snapshots to keep:%s", numSnapshotsToKeep);
try {
// first, get the suffix of the snapshots in the db, namely the snapsho... |
python | def linear_color_map(values, color_range=None):
"""
Linearly interpolate between two colors.
If colors are not specified the function will
interpolate between 0.0 values as red and 1.0 as green.
Parameters
--------------
values : (n, ) float
Values to interpolate
color_range : N... |
python | def getheader (self, name, default=None):
"""Get decoded header value.
@return: decoded header value or default of not found
@rtype: unicode or type of default
"""
value = self.headers.get(name)
if value is None:
return default
return unicode_safe(val... |
python | def Dix(x, rhol, rhog, sigma, m, D, g=g):
r'''Calculates void fraction in two-phase flow according to the model of
[1]_ as given in [2]_ and [3]_.
.. math::
\alpha = \frac{x}{\rho_g}\left[C_0\left(\frac{x}{\rho_g} + \frac{1-x}
{\rho_l}\right) +\frac{v_{gm}}{G} \right]^{-1}
... |
python | def _get_evidence_text(self, event_tag):
"""Extract the evidence for an event.
Pieces of text linked to an EVENT are fragments of a sentence. The
EVENT refers to the paragraph ID and the "uttnum", which corresponds
to a sentence ID. Here we find and return the full sentence from which
... |
java | private OnPreferenceChangeListener createToolbarElevationChangeListener() {
return new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
int elevation = Integer.valueOf((String) newValue);
... |
python | def QA_util_sql_async_mongo_setting(uri='mongodb://localhost:27017/quantaxis'):
"""异步mongo示例
Keyword Arguments:
uri {str} -- [description] (default: {'mongodb://localhost:27017/quantaxis'})
Returns:
[type] -- [description]
"""
# loop = asyncio.new_event_loop()
# asyncio.set_eve... |
python | def get_labels(self, field):
"""Return the labels of all clusters, for a given field."""
return {c: self.cluster_meta.get(field, c)
for c in self.clustering.cluster_ids} |
java | public ServiceFuture<MediaServiceInner> createAsync(String resourceGroupName, String mediaServiceName, MediaServiceInner parameters, final ServiceCallback<MediaServiceInner> serviceCallback) {
return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, mediaServiceName, parameters), serv... |
java | public static <T> Class<?>[] resolveGenerics(Class<T> superType, Class<? extends T> subType) {
checkNotNull(superType, "superType should not be null");
checkNotNull(subType, "subType should not be null");
Class<?> subTypeWithoutProxy = ProxyUtils.cleanProxy(subType);
return TypeResolver.... |
java | private static List<String> getPathList(File f) {
List<String> l = new ArrayList<String>();
File r;
try {
r = f.getCanonicalFile();
while(r != null) {
l.add(r.getName());
r = r.getParentFile();
}
}
catch (IOException e) {
e.printStackTrace();
l = null;
}
return l;
} |
java | @Override
public CreateGroupVersionResult createGroupVersion(CreateGroupVersionRequest request) {
request = beforeClientExecution(request);
return executeCreateGroupVersion(request);
} |
java | public Entity newEntity(QualifiedName id, Collection<Attribute> attributes) {
Entity res = newEntity(id);
setAttributes(res, attributes);
return res;
} |
java | public void setLeft(Keyword newLeft) {
if (newLeft != left) {
NotificationChain msgs = null;
if (left != null)
msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__LEFT, null, msgs);
if (newLeft != null)
msgs = ((InternalEObject)newLeft).eInverseA... |
java | public static <I> CompactDFA<I> minimizeDFA(DFA<?, I> dfa, Alphabet<I> alphabet, PruningMode pruningMode) {
return doMinimizeDFA(dfa, alphabet, new CompactDFA.Creator<>(), pruningMode);
} |
java | public void setPreferredNodeIdPrefix(String preferredNodeIdPrefix) {
LettuceAssert.notNull(preferredNodeIdPrefix, "preferredNodeIdPrefix must not be null");
boolean resetRoundRobin = false;
if (this.preferredNodeIdPrefix == null || !preferredNodeIdPrefix.equals(this.preferredNodeIdPrefix)) {
... |
java | public List<ARecordDeclIR> getRecords(SClassDeclIR definingClass)
{
List<ARecordDeclIR> records = new LinkedList<ARecordDeclIR>();
for (ATypeDeclIR typeDecl : definingClass.getTypeDecls())
{
SDeclIR decl = typeDecl.getDecl();
if (!(decl instanceof ARecordDeclIR))
{
continue;
}
ARecordDeclIR... |
python | def read_structs(fstream):
"""
Read all structs from likwid's file stream.
Args:
fstream: Likwid's output file stream.
Returns:
A generator that can be used to iterate over all structs in the
fstream.
"""
struct = read_struct(fstream)
while struct is not None:
... |
python | def define(cls, start, step, num, dtype=None):
"""Define a new `Index`.
The output is basically::
start + numpy.arange(num) * step
Parameters
----------
start : `Number`
The starting value of the index.
step : `Number`
The step size... |
python | def load(handle):
"""Loads a module from a handle.
Currently this method only works with Tensorflow 2.x and can only load modules
created by calling tensorflow.saved_model.save(). The method works in both
eager and graph modes.
Depending on the type of handle used, the call may involve downloading a
Tenso... |
java | private ElementRule<T, ?> getDerivedRule(
ChronoElement<?> element,
boolean wantsVeto
) {
if (element instanceof BasicElement && ChronoEntity.class.isAssignableFrom(this.getChronoType())) {
BasicElement<?> e = BasicElement.class.cast(element);
String veto = (wantsVe... |
java | protected String defaultActionHtmlContent() {
StringBuffer result = new StringBuffer(2048);
result.append("<table id='twolists' cellpadding='0' cellspacing='0' align='center' width='100%'>\n");
Iterator<A_CmsListDialog> i = m_wps.iterator();
while (i.hasNext()) {
A_CmsListDi... |
java | public Format decideTextureFormat(Format fmt) {
switch (colorType) {
case COLOR_TRUECOLOR:
if ((fmt == ABGR) || (fmt == RGBA) || (fmt == BGRA) || (fmt == RGB)) {
return fmt;
}
return RGB;
case COLOR_TRUEALPHA:
if ((fmt == ABGR) || (fmt =... |
python | def make_text_chunk(
type="tEXt", key="Comment", value="",
compression_flag=0, compression_method=0, lang="", translated_key=""):
"""Create a text chunk with a key value pair.
See https://www.w3.org/TR/PNG/#11textinfo for text chunk information.
Usage:
.. code:: python
from apng import APNG, make_text_chu... |
java | @TargetApi(Build.VERSION_CODES.FROYO)
@Nullable
public static CharSequence[] optCharSequenceArray(@Nullable Bundle bundle, @Nullable String key, @Nullable CharSequence[] fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getCharSequenceArray(key);
} |
python | def _split_queries(cls, sql):
"Splits sql statements at semicolons into discrete queries"
sql_s = dbt.compat.to_string(sql)
sql_buf = StringIO(sql_s)
split_query = snowflake.connector.util_text.split_statements(sql_buf)
return [part[0] for part in split_query] |
python | def search(self, filter, attributes=None):
"""Search LDAP for records."""
if attributes is None:
attributes = ['*']
if filter is None:
filter = ["(objectclass=*)"]
# Convert filter list into an LDAP-consumable format
filterstr = "(&{})".format(''.join(fi... |
java | public Observable<Void> disableMonitoringAsync(String resourceGroupName, String clusterName) {
return disableMonitoringWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
... |
python | def get_html_desc(self, markdown_inst=None):
"""
Translates the enum's 'desc' property into HTML.
Any RDLFormatCode tags used in the description are converted to HTML.
The text is also fed through a Markdown processor.
The additional Markdown processing allows designers the cho... |
java | public static Intent pickFile() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
return intent;
} |
python | def search_tags(self, *args, **kwargs):
"""
Args:
query (string): elasticsearch string query
order_by (optional[string]): property by which to order results
offset (optional[int]): number of results to skip for pagination
(default=0)
limit ... |
java | public Cell<C,T> top () {
if (align == null)
align = TOP;
else {
align |= TOP;
align &= ~BOTTOM;
}
return this;
} |
python | def align_images(self, n_particles=10, n_iterations=10, lowerLimit=-0.2, upperLimit=0.2, threadCount=1,
compute_bands=None):
"""
aligns the coordinate systems of different exposures within a fixed model parameterisation by executing a PSO
with relative coordinate shifts as f... |
java | @NonNull
public IconicsAnimationProcessor duration(long duration, @NonNull TimeUnit timeUnit) {
mDuration = timeUnit.toMillis(duration);
return this;
} |
java | public void marshall(DeleteResolverEndpointRequest deleteResolverEndpointRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteResolverEndpointRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.m... |
python | def _do_autocommit(self):
''' perform autocommit
'''
# commit()
self._commit_counter += 1
# autocommit as boolean
if isinstance(self._autocommit, bool) and self._autocommit:
self.commit()
self._commit_counter = 0
# autocommit as counter
... |
python | def _create_session(self):
"""
Creates a fresh session with the default header (random UA)
"""
self.driver = requests.Session(**self.driver_args)
# Set default headers
self.update_headers(self.current_headers)
self.update_cookies(self.current_cookies)
self... |
java | public static FormValidation validateNonNegativeInteger(String value) {
try {
if(Integer.parseInt(value)<0)
return error(hudson.model.Messages.Hudson_NotANonNegativeNumber());
return ok();
} catch (NumberFormatException e) {
return error(hudson.model.M... |
python | def _add_extra_attributes(attrs, extra_attr_map):
"""
:param attrs: Current Attribute list
:param extraAttrMap: Additional attributes to be added
:return: new_attr
"""
for attr in extra_attr_map:
if attr not in attrs:
attrs[attr] = extra_attr_map[attr]
return attrs |
java | public double dot(IntDoubleVector y) {
if (y instanceof IntDoubleSortedVector) {
IntDoubleSortedVector other = ((IntDoubleSortedVector) y);
double dot = 0;
int oc = 0;
for (int c = 0; c < used; c++) {
while (oc < other.used) {
i... |
java | public Optional<T> filter(Predicate<? super T> predicate) {
Objects.requireNonNull(predicate);
if (!isPresent())
return this;
else
return predicate.test(value) ? this : empty();
} |
python | def buy(self, price, pause=0):
""" Attempts to purchase a main shop item, returns result
Uses the item's stock id and brr to navigate to the haggle page. Auotmatically downloads
the OCR image from the haggle page and attempts to crack it. Submits the haggle form with
the given p... |
java | public synchronized void finish() throws IOException
{
synchronized(out)
{
for(ByteArrayOutputStream baos : all_buffers)
{
baos.writeTo(out);
baos.reset();
}
out.flush();
}
} |
python | def nearest_tile_to_node_using_tiles(tile_ids, node_coord):
"""
Get the first tile found adjacent to the given node. Returns a tile identifier.
:param tile_ids: tiles to look at for adjacency, list(Tile.tile_id)
:param node_coord: node coordinate to find an adjacent tile to, int
:return: tile ident... |
python | async def timeout(source, timeout):
"""Raise a time-out if an element of the asynchronous sequence
takes too long to arrive.
Note: the timeout is not global but specific to each step of
the iteration.
"""
async with streamcontext(source) as streamer:
while True:
try:
... |
java | public EClass getIfcMaterialSelect() {
if (ifcMaterialSelectEClass == null) {
ifcMaterialSelectEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(961);
}
return ifcMaterialSelectEClass;
} |
java | public CommandInvocation withCommandPlugins(CommandPlugin... commandPlugins) {
if (this.commandPlugins == null) {
setCommandPlugins(new com.amazonaws.internal.SdkInternalList<CommandPlugin>(commandPlugins.length));
}
for (CommandPlugin ele : commandPlugins) {
this.command... |
python | def set_transaction_execution_result(
self, txn_signature, is_valid, context_id, state_changes, events,
data, error_message, error_data):
"""Set the status of an executed transaction.
Called by the executor after a transaction has been processed.
The scheduler must know... |
java | public T removeFirst() {
if (isEmpty()) {
return null;
}
T firstElement = elements[firstIndex];
elements[firstIndex] = null;
firstIndex = incrementIndex(firstIndex, 0);
return firstElement;
} |
java | @Override
public int read(byte[] b, int startOffset, int length) throws IOException {
int temp;
if (ostart >= ofinish) {
for (temp = 0; temp == 0; temp = getMoreData())
;
if (temp == -1) {
return -1;
}
}
if (length ... |
java | public void clear() {
int currentCount = threadCounter.decrementAndGet();
if (log.isLoggable(Level.FINEST)) {
log.finest("Clear: Disassociate Thread from FragmentBuilder(1): current thread count=" + currentCount);
synchronized (threadNames) {
threadNames.remove(Th... |
python | def invert(a, b):
"""
The multiplicitive inverse of a in the integers modulo b.
:return int: x, where a * x == 1 mod b
"""
if HAVE_GMP:
s = int(gmpy2.invert(a, b))
# according to documentation, gmpy2.invert might return 0 on
# non-invertible element, although it seems to act... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.